mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Handle error in bookmark-relocate when filename is nil
* lisp/bookmark.el (bookmark-relocate): Handle error when filename is nil. (Bug#59326)
This commit is contained in:
parent
d46d67bef1
commit
fbad9c05ea
1 changed files with 18 additions and 13 deletions
|
|
@ -1396,20 +1396,25 @@ after a bookmark was set in it."
|
|||
(interactive (list (bookmark-completing-read "Bookmark to relocate")))
|
||||
(bookmark-maybe-historicize-string bookmark-name)
|
||||
(bookmark-maybe-load-default-file)
|
||||
(let* ((bmrk-filename (bookmark-get-filename bookmark-name))
|
||||
(newloc (abbreviate-file-name
|
||||
(expand-file-name
|
||||
(read-file-name
|
||||
(format "Relocate %s to: " bookmark-name)
|
||||
(file-name-directory bmrk-filename))))))
|
||||
(bookmark-set-filename bookmark-name newloc)
|
||||
(bookmark-update-last-modified bookmark-name)
|
||||
(setq bookmark-alist-modification-count
|
||||
(1+ bookmark-alist-modification-count))
|
||||
(if (bookmark-time-to-save-p)
|
||||
(let ((bmrk-filename (bookmark-get-filename bookmark-name)))
|
||||
;; FIXME: Make `bookmark-relocate' support bookmark Types
|
||||
;; besides files and directories.
|
||||
(unless bmrk-filename
|
||||
(user-error "Cannot relocate bookmark of type \"%s\""
|
||||
(bookmark-type-from-full-record
|
||||
(bookmark-get-bookmark bookmark-name))))
|
||||
(let ((newloc (abbreviate-file-name
|
||||
(expand-file-name
|
||||
(read-file-name
|
||||
(format "Relocate %s to: " bookmark-name)
|
||||
(file-name-directory bmrk-filename))))))
|
||||
(bookmark-set-filename bookmark-name newloc)
|
||||
(bookmark-update-last-modified bookmark-name)
|
||||
(setq bookmark-alist-modification-count
|
||||
(1+ bookmark-alist-modification-count))
|
||||
(when (bookmark-time-to-save-p)
|
||||
(bookmark-save))
|
||||
(bookmark-bmenu-surreptitiously-rebuild-list)))
|
||||
|
||||
(bookmark-bmenu-surreptitiously-rebuild-list))))
|
||||
|
||||
;;;###autoload
|
||||
(defun bookmark-insert-location (bookmark-name &optional no-history)
|
||||
|
|
|
|||
Loading…
Reference in a new issue