Use for this completing-read. You can write a function that asks the user for this bookmark:
(defun my-function ()
(interactive)
(let ((bookmark (completing-read "Bookmark: " (bookmark-all-names))))
...))
If you prefer the invitation to be part interactive(so that the result will be automatically bound to your function arguments), you can use the following alternative:
(defun my-function (bookmark)
(interactive (list (completing-read "Bookmark: " (bookmark-all-names))))
...)
In order for Emacs to find the function bookmark-all-names, you also need to add the following line to the .emacs file:
(require 'bookmark)
source
share