aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/bookmark.el31
1 files changed, 18 insertions, 13 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 15e7273f917..7f3a264f53d 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1396,20 +1396,25 @@ after a bookmark was set in it."
1396 (interactive (list (bookmark-completing-read "Bookmark to relocate"))) 1396 (interactive (list (bookmark-completing-read "Bookmark to relocate")))
1397 (bookmark-maybe-historicize-string bookmark-name) 1397 (bookmark-maybe-historicize-string bookmark-name)
1398 (bookmark-maybe-load-default-file) 1398 (bookmark-maybe-load-default-file)
1399 (let* ((bmrk-filename (bookmark-get-filename bookmark-name)) 1399 (let ((bmrk-filename (bookmark-get-filename bookmark-name)))
1400 (newloc (abbreviate-file-name 1400 ;; FIXME: Make `bookmark-relocate' support bookmark Types
1401 (expand-file-name 1401 ;; besides files and directories.
1402 (read-file-name 1402 (unless bmrk-filename
1403 (format "Relocate %s to: " bookmark-name) 1403 (user-error "Cannot relocate bookmark of type \"%s\""
1404 (file-name-directory bmrk-filename)))))) 1404 (bookmark-type-from-full-record
1405 (bookmark-set-filename bookmark-name newloc) 1405 (bookmark-get-bookmark bookmark-name))))
1406 (bookmark-update-last-modified bookmark-name) 1406 (let ((newloc (abbreviate-file-name
1407 (setq bookmark-alist-modification-count 1407 (expand-file-name
1408 (1+ bookmark-alist-modification-count)) 1408 (read-file-name
1409 (if (bookmark-time-to-save-p) 1409 (format "Relocate %s to: " bookmark-name)
1410 (file-name-directory bmrk-filename))))))
1411 (bookmark-set-filename bookmark-name newloc)
1412 (bookmark-update-last-modified bookmark-name)
1413 (setq bookmark-alist-modification-count
1414 (1+ bookmark-alist-modification-count))
1415 (when (bookmark-time-to-save-p)
1410 (bookmark-save)) 1416 (bookmark-save))
1411 (bookmark-bmenu-surreptitiously-rebuild-list))) 1417 (bookmark-bmenu-surreptitiously-rebuild-list))))
1412
1413 1418
1414;;;###autoload 1419;;;###autoload
1415(defun bookmark-insert-location (bookmark-name &optional no-history) 1420(defun bookmark-insert-location (bookmark-name &optional no-history)