Use save-place-mode instead of save-place
* lisp/menu-bar.el (menu-bar-options-save, menu-bar-options-menu): * lisp/saveplace.el (save-place-to-alist, save-places-to-alist) (save-place-find-file-hook, save-place-dired-hook): Use save-place-mode instead of the obsolete save-place.
This commit is contained in:
parent
d28d54c767
commit
ca208e8388
2 changed files with 9 additions and 9 deletions
|
@ -689,7 +689,7 @@ The selected font will be the default on both the existing and future frames."
|
||||||
debug-on-quit debug-on-error
|
debug-on-quit debug-on-error
|
||||||
;; Somehow this works, when tool-bar and menu-bar don't.
|
;; Somehow this works, when tool-bar and menu-bar don't.
|
||||||
tooltip-mode window-divider-mode
|
tooltip-mode window-divider-mode
|
||||||
save-place uniquify-buffer-name-style fringe-mode
|
save-place-mode uniquify-buffer-name-style fringe-mode
|
||||||
indicate-empty-lines indicate-buffer-boundaries
|
indicate-empty-lines indicate-buffer-boundaries
|
||||||
case-fold-search font-use-system-font
|
case-fold-search font-use-system-font
|
||||||
current-language-environment default-input-method
|
current-language-environment default-input-method
|
||||||
|
@ -1413,7 +1413,7 @@ mail status in mode line"))
|
||||||
|
|
||||||
(bindings--define-key menu [save-place]
|
(bindings--define-key menu [save-place]
|
||||||
(menu-bar-make-toggle
|
(menu-bar-make-toggle
|
||||||
toggle-save-place-globally save-place
|
toggle-save-place-globally save-place-mode
|
||||||
"Save Place in Files between Sessions"
|
"Save Place in Files between Sessions"
|
||||||
"Saving place in files %s"
|
"Saving place in files %s"
|
||||||
"Visit files of previous session when restarting Emacs"
|
"Visit files of previous session when restarting Emacs"
|
||||||
|
@ -1421,7 +1421,7 @@ mail status in mode line"))
|
||||||
;; Do it by name, to avoid a free-variable
|
;; Do it by name, to avoid a free-variable
|
||||||
;; warning during byte compilation.
|
;; warning during byte compilation.
|
||||||
(set-default
|
(set-default
|
||||||
'save-place (not (symbol-value 'save-place)))))
|
'save-place-mode (not (symbol-value 'save-place-mode)))))
|
||||||
|
|
||||||
(bindings--define-key menu [uniquify]
|
(bindings--define-key menu [uniquify]
|
||||||
(menu-bar-make-toggle
|
(menu-bar-make-toggle
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
;; Automatically save place in files, so that visiting them later
|
;; Automatically save place in files, so that visiting them later
|
||||||
;; (even during a different Emacs session) automatically moves point
|
;; (even during a different Emacs session) automatically moves point
|
||||||
;; to the saved position, when the file is first found. Uses the
|
;; to the saved position, when the file is first found. Uses the
|
||||||
;; value of buffer-local variable save-place to determine whether to
|
;; value of buffer-local variable save-place-mode to determine whether to
|
||||||
;; save position or not.
|
;; save position or not.
|
||||||
;;
|
;;
|
||||||
;; Thanks to Stefan Schoef, who sent a patch with the
|
;; Thanks to Stefan Schoef, who sent a patch with the
|
||||||
|
@ -179,7 +179,7 @@ file:
|
||||||
|
|
||||||
(defun save-place-to-alist ()
|
(defun save-place-to-alist ()
|
||||||
;; put filename and point in a cons box and then cons that onto the
|
;; put filename and point in a cons box and then cons that onto the
|
||||||
;; front of the save-place-alist, if save-place is non-nil.
|
;; front of the save-place-alist, if save-place-mode is non-nil.
|
||||||
;; Otherwise, just delete that file from the alist.
|
;; Otherwise, just delete that file from the alist.
|
||||||
;; first check to make sure alist has been loaded in from the master
|
;; first check to make sure alist has been loaded in from the master
|
||||||
;; file. If not, do so, then feel free to modify the alist. It
|
;; file. If not, do so, then feel free to modify the alist. It
|
||||||
|
@ -309,8 +309,8 @@ may have changed) back to `save-place-alist'."
|
||||||
nil))))
|
nil))))
|
||||||
|
|
||||||
(defun save-places-to-alist ()
|
(defun save-places-to-alist ()
|
||||||
;; go through buffer-list, saving places to alist if save-place is
|
;; go through buffer-list, saving places to alist if save-place-mode
|
||||||
;; non-nil, deleting them from alist if it is nil.
|
;; is non-nil, deleting them from alist if it is nil.
|
||||||
(let ((buf-list (buffer-list)))
|
(let ((buf-list (buffer-list)))
|
||||||
(while buf-list
|
(while buf-list
|
||||||
;; put this into a save-excursion in case someone is counting on
|
;; put this into a save-excursion in case someone is counting on
|
||||||
|
@ -335,7 +335,7 @@ may have changed) back to `save-place-alist'."
|
||||||
(and (integerp (cdr cell))
|
(and (integerp (cdr cell))
|
||||||
(goto-char (cdr cell))))
|
(goto-char (cdr cell))))
|
||||||
;; and make sure it will be saved again for later
|
;; and make sure it will be saved again for later
|
||||||
(setq save-place t)))))
|
(setq save-place-mode t)))))
|
||||||
|
|
||||||
(declare-function dired-goto-file "dired" (file))
|
(declare-function dired-goto-file "dired" (file))
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ may have changed) back to `save-place-alist'."
|
||||||
((and (listp (cdr cell)) (assq 'dired-filename (cdr cell)))
|
((and (listp (cdr cell)) (assq 'dired-filename (cdr cell)))
|
||||||
(dired-goto-file (cdr (assq 'dired-filename (cdr cell)))))))
|
(dired-goto-file (cdr (assq 'dired-filename (cdr cell)))))))
|
||||||
;; and make sure it will be saved again for later
|
;; and make sure it will be saved again for later
|
||||||
(setq save-place t)))))
|
(setq save-place-mode t)))))
|
||||||
|
|
||||||
(defun save-place-kill-emacs-hook ()
|
(defun save-place-kill-emacs-hook ()
|
||||||
;; First update the alist. This loads the old save-place-file if nec.
|
;; First update the alist. This loads the old save-place-file if nec.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue