Function: bookmark-set-no-overwrite

bookmark-set-no-overwrite is an autoloaded, interactive and byte-compiled function defined in bookmark.el.gz.

Signature

(bookmark-set-no-overwrite &optional NAME PUSH-BOOKMARK)

Documentation

Set a bookmark named NAME at the current location.

If NAME is nil, then prompt the user.

If a bookmark named NAME already exists and prefix argument PUSH-BOOKMARK is non-nil, then push the new bookmark onto the bookmark alist. Pushing it means that among bookmarks named NAME, this one becomes the one in effect, but the others are still there, in order, and become effective again if the user ever deletes the most recent one.

Otherwise, if a bookmark named NAME already exists but PUSH-BOOKMARK is nil, raise an error.

To yank words from the text of the buffer and use them as part of the bookmark name, type C-w (bookmark-yank-word) while setting a bookmark. Successive C-w (bookmark-yank-word)'s yank successive words.

Typing C-u (universal-argument) inserts (at the bookmark name prompt) the name of the last bookmark used in the document where the new bookmark is being set; this helps you use a single bookmark name to track progress through a large document. If there is no prior bookmark for this document, then C-u (universal-argument) inserts an appropriate name based on the buffer or file.

Use M-x bookmark-delete (bookmark-delete) to remove bookmarks (you give it a name and it removes only the first instance of a bookmark with that name from the list of bookmarks.)

View in manual

Probably introduced at or before Emacs version 25.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/bookmark.el.gz
;;;###autoload
(defun bookmark-set-no-overwrite (&optional name push-bookmark)
  "Set a bookmark named NAME at the current location.
If NAME is nil, then prompt the user.

If a bookmark named NAME already exists and prefix argument
PUSH-BOOKMARK is non-nil, then push the new bookmark onto the
bookmark alist.  Pushing it means that among bookmarks named
NAME, this one becomes the one in effect, but the others are
still there, in order, and become effective again if the user
ever deletes the most recent one.

Otherwise, if a bookmark named NAME already exists but PUSH-BOOKMARK
is nil, raise an error.

To yank words from the text of the buffer and use them as part of the
bookmark name, type \\<bookmark-minibuffer-read-name-map>\
\\[bookmark-yank-word] while setting a bookmark.  Successive \
\\[bookmark-yank-word]'s
yank successive words.

Typing \\[universal-argument] inserts (at the bookmark name prompt) the name of the last
bookmark used in the document where the new bookmark is being set;
this helps you use a single bookmark name to track progress through a
large document.  If there is no prior bookmark for this document, then
\\[universal-argument] inserts an appropriate name based on the buffer or file.

Use \\[bookmark-delete] to remove bookmarks (you give it a name and
it removes only the first instance of a bookmark with that name from
the list of bookmarks.)"
  (interactive (list nil current-prefix-arg))
  (bookmark-set-internal "Set bookmark" name (if push-bookmark 'push nil)))