Function: bookmark-insert

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

Signature

(bookmark-insert BOOKMARK-NAME)

Documentation

Insert the text of the file pointed to by bookmark BOOKMARK-NAME.

BOOKMARK-NAME is a bookmark name (a string), not a bookmark record. Refuse to insert bookmarks if its handler's property bookmark-inhibit, which is a list, contains insert.

You may have a problem using this function if the value of variable bookmark-alist is nil. If that happens, you need to load in some bookmarks. See help on function bookmark-load for more about this.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/bookmark.el.gz
;;;###autoload
(defun bookmark-insert (bookmark-name)
  "Insert the text of the file pointed to by bookmark BOOKMARK-NAME.
BOOKMARK-NAME is a bookmark name (a string), not a bookmark record.
Refuse to insert bookmarks if its handler's property `bookmark-inhibit',
which is a list, contains `insert'.

You may have a problem using this function if the value of variable
`bookmark-alist' is nil.  If that happens, you need to load in some
bookmarks.  See help on function `bookmark-load' for more about
this."
  (interactive (list (bookmark-completing-read "Insert bookmark contents")))
  (bookmark-maybe-historicize-string bookmark-name)
  (bookmark-maybe-load-default-file)
  (if (memq 'insert (get (or (bookmark-get-handler bookmark-name)
                             #'bookmark-default-handler)
                         'bookmark-inhibit))
      (error "Insert not supported for bookmark %s" bookmark-name)
    (let ((orig-point (point))
	  (str-to-insert
	   (save-current-buffer
             (bookmark-handle-bookmark bookmark-name)
	     (buffer-string))))
      (insert str-to-insert)
      (push-mark)
      (goto-char orig-point))))