mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
New hook save-place-after-find-file-hook
This is intended for use in Org mode, where we currently use advise. * lisp/saveplace.el (save-place-after-find-file-hook): New hook. (save-place-find-file-hook): Run new hook.
This commit is contained in:
parent
80cf13a3d2
commit
bf65073767
2 changed files with 11 additions and 1 deletions
4
etc/NEWS
4
etc/NEWS
|
|
@ -2911,6 +2911,10 @@ when used as part of a property list specification for the
|
|||
** 'defalias' records a more precise history of definitions.
|
||||
This is recorded in the 'function-history' symbol property.
|
||||
|
||||
---
|
||||
** New hook 'save-place-after-find-file-hook'.
|
||||
This is called at the end of 'save-place-find-file-hook'.
|
||||
|
||||
---
|
||||
** 'indian-tml-base-table' no longer translates digits.
|
||||
Use 'indian-tml-base-digits-table' if you want digits translation.
|
||||
|
|
|
|||
|
|
@ -346,7 +346,12 @@ may have changed) back to `save-place-alist'."
|
|||
(save-place-to-alist))
|
||||
(setq buf-list (cdr buf-list))))))
|
||||
|
||||
(defvar save-place-after-find-file-hook nil
|
||||
"Hook run at the end of `save-place-find-file-hook'.")
|
||||
|
||||
(defun save-place-find-file-hook ()
|
||||
"Function added to `find-file-hook' by `save-place-mode'.
|
||||
It runs the hook `save-place-after-find-file-hook'."
|
||||
(or save-place-loaded (load-save-place-alist-from-file))
|
||||
(let ((cell (assoc buffer-file-name save-place-alist)))
|
||||
(if cell
|
||||
|
|
@ -355,7 +360,8 @@ may have changed) back to `save-place-alist'."
|
|||
(and (integerp (cdr cell))
|
||||
(goto-char (cdr cell))))
|
||||
;; and make sure it will be saved again for later
|
||||
(setq save-place-mode t)))))
|
||||
(setq save-place-mode t))))
|
||||
(run-hooks 'save-place-after-find-file-hook))
|
||||
|
||||
(declare-function dired-goto-file "dired" (file))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue