Reputation: 11
Is it possible to have the default bookmark name ( when we add a bookmark ) as the "name of the file: line number" instead of prompting us everytime ? Trying to get the bookmark+.el package be similar to bm.el.
Upvotes: 1
Views: 98
Reputation: 30708
Bookmark+ gives you lots of possibilities, including the ability to bookmark files without visiting them and to have the bookmark name be taken automatically from the file name. So I think the OP is mistaken.
See, for instance:
bm.el
bookmarks, which you mentioned -- the bookmark name reflects the file name and position in the file.Upvotes: 2
Reputation: 74480
You can customize the bookmark-make-record-function
variable to a new routine which creates a default name that you want:
(setq bookmark-make-record-function 'my-bookmark-make-record-default)
(defun my-bookmark-make-record-default ()
"add on a default name for the bookmark"
(cons (format "%s:%d" (bookmark-buffer-name) (line-number-at-pos (point)))
(bookmark-make-record-default)))
Note: this makes the default name be what you requested (file:line), but you're still prompted - just press RET to accept the new name.
Upvotes: 3