;; Author: Karl Fogel <kfogel@cs.oberlin.edu>
;; Maintainer: FSF
;; Created: July, 1993
-;; Version: 1.2
;; Keywords: bookmarks, placeholders
;; This file is part of GNU Emacs.
\(setq-default save-place t\)"
(interactive "P")
(if (not buffer-file-name)
- (message "Buffer \"%s\" not visiting a file." (buffer-name))
+ (message "Buffer `%s' not visiting a file" (buffer-name))
(if (and save-place (or (not parg) (<= parg 0)))
(progn
- (message "No place will be saved in this file.")
+ (message "No place will be saved in this file")
(setq save-place nil))
- (message "Place will be saved.")
+ (message "Place will be saved")
(setq save-place t))))
(defun save-place-to-alist ()
(setq save-place-alist (delq cell save-place-alist))))
(if save-place
(setq save-place-alist
- (cons (cons buffer-file-name
+ (cons (cons buffer-file-name
(if (not (eq major-mode 'hexl-mode))
(point)
(1+ (hexl-current-address))))
(or save-place-loaded (load-save-place-alist-from-file))
(let ((cell (assoc buffer-file-name save-place-alist)))
(if cell
- (progn
+ (progn
(or after-find-file-from-revert-buffer
(goto-char (cdr cell)))
;; and make sure it will be saved again for later
(setq save-place t)))))
(defun save-place-kill-emacs-hook ()
+ ;; First update the alist. This loads the old save-place-file if nec.
(save-places-to-alist)
- (save-place-alist-to-file))
+ ;; Now save the alist in the file, if we have ever loaded the file
+ ;; (including just now).
+ (if save-place-loaded
+ (save-place-alist-to-file)))
(add-hook 'find-file-hooks 'save-place-find-file-hook t)