diff options
| author | Stéphane Marks | 2025-12-15 15:21:23 -0500 |
|---|---|---|
| committer | Sean Whitton | 2025-12-17 12:01:29 +0000 |
| commit | d76e61d218742396a5f48cbe44af27cacecbea22 (patch) | |
| tree | fe2bfffc897baf0ce196167b3c2aae686773f70f | |
| parent | 91d4120289e79c7c8097691cbf89ff5b304b74e4 (diff) | |
| download | emacs-d76e61d218742396a5f48cbe44af27cacecbea22.tar.gz emacs-d76e61d218742396a5f48cbe44af27cacecbea22.zip | |
New bookmark-after-load-file-hook (bug#80003)
* lisp/bookmark.el (bookmark-after-load-file-hook): New
defcustom (bug#80003).
(bookmark-load): Call the new hook.
* etc/NEWS: Announce the new hook.
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/bookmark.el | 8 |
2 files changed, 14 insertions, 0 deletions
| @@ -1533,6 +1533,12 @@ This user option controls the width of the type column on the bookmark | |||
| 1533 | menu 'bookmark-bmenu-list'. The default value is 8 which is backwards | 1533 | menu 'bookmark-bmenu-list'. The default value is 8 which is backwards |
| 1534 | compatible. | 1534 | compatible. |
| 1535 | 1535 | ||
| 1536 | --- | ||
| 1537 | *** New hook 'bookmark-after-load-file-hook'. | ||
| 1538 | This hook is run by 'bookmark-load' after loading a bookmark file. This | ||
| 1539 | hook can be used, for example, to reconcile 'bookmark-alist' against | ||
| 1540 | bookmark state that you, or a package that you use, maintains. | ||
| 1541 | |||
| 1536 | ** Recentf | 1542 | ** Recentf |
| 1537 | 1543 | ||
| 1538 | --- | 1544 | --- |
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 75071ddb9ce..f2a1c69929b 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el | |||
| @@ -1763,6 +1763,13 @@ This is a helper for `bookmark-import-new-list'." | |||
| 1763 | (bookmark-set-name full-record new-name))))) | 1763 | (bookmark-set-name full-record new-name))))) |
| 1764 | 1764 | ||
| 1765 | 1765 | ||
| 1766 | (defcustom bookmark-after-load-file-hook nil | ||
| 1767 | "Hook run after a bookmark file is loaded by `bookmark-load`. | ||
| 1768 | This hook can be used, for example, to reconcile 'bookmark-alist' | ||
| 1769 | against bookmark state that you, or a package that you use, maintains." | ||
| 1770 | :type 'hook | ||
| 1771 | :version "31.1") | ||
| 1772 | |||
| 1766 | ;;;###autoload | 1773 | ;;;###autoload |
| 1767 | (defun bookmark-load (file &optional overwrite no-msg default) | 1774 | (defun bookmark-load (file &optional overwrite no-msg default) |
| 1768 | "Load bookmarks from FILE (which must be in bookmark format). | 1775 | "Load bookmarks from FILE (which must be in bookmark format). |
| @@ -1824,6 +1831,7 @@ unique numeric suffixes \"<2>\", \"<3>\", etc." | |||
| 1824 | (bookmark-bmenu-surreptitiously-rebuild-list) | 1831 | (bookmark-bmenu-surreptitiously-rebuild-list) |
| 1825 | (setq bookmark-file-coding-system buffer-file-coding-system)) | 1832 | (setq bookmark-file-coding-system buffer-file-coding-system)) |
| 1826 | (kill-buffer (current-buffer))) | 1833 | (kill-buffer (current-buffer))) |
| 1834 | (run-hooks 'bookmark-after-load-file-hook) | ||
| 1827 | (unless no-msg | 1835 | (unless no-msg |
| 1828 | (progress-reporter-done reporter))))) | 1836 | (progress-reporter-done reporter))))) |
| 1829 | 1837 | ||