Offer simple completion when creating external bookmarks
In dired, offer all marked files, or the currently selected file if there are none. Otherwise, just use the list of recently opened files as completing. This is meant as a very simple replacement for dired+'s dired bookmarks.
This commit is contained in:
parent
a20b5faa42
commit
c9e84a7e28
@ -473,8 +473,14 @@ it. The bookmarks will finally be sorted by their name."
|
|||||||
(setq bookmark-alist (cl-sort bookmark-alist #'string-lessp :key #'car)))
|
(setq bookmark-alist (cl-sort bookmark-alist #'string-lessp :key #'car)))
|
||||||
|
|
||||||
(defun db/bookmark-add-external (location name)
|
(defun db/bookmark-add-external (location name)
|
||||||
"Add NAME as bookmark to LOCATION that is opened by the operating system."
|
"Add NAME as bookmark to LOCATION that is opened by the operating system.
|
||||||
(interactive "sLocation: \nsName: ")
|
Offers simple completing from the list of recently opened files.
|
||||||
|
In dired, offer all marked files or the currently selected file
|
||||||
|
as completing instead."
|
||||||
|
(interactive (list (completing-read "Location: " (if (derived-mode-p 'dired-mode)
|
||||||
|
(dired-get-marked-files)
|
||||||
|
recentf-list))
|
||||||
|
(read-string "Name: ")))
|
||||||
(db/bookmark-add-with-handler name location #'db/system-open))
|
(db/bookmark-add-with-handler name location #'db/system-open))
|
||||||
|
|
||||||
(defun db/bookmark-add-url (url name)
|
(defun db/bookmark-add-url (url name)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user