]> code.delx.au - gnu-emacs/blobdiff - lisp/saveplace.el
(mouse-show-mark): Use temporary highlighting if possible instead of a pause.
[gnu-emacs] / lisp / saveplace.el
index f86c48a6f7c89f3215cd4727a3c62d0059f84396..364e766dcb016c916a0719e3b39bf729a8d69d6d 100644 (file)
@@ -5,7 +5,6 @@
 ;; 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.
@@ -114,7 +113,7 @@ To save places automatically in all files, put this in your `.emacs' file:
               (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))))
@@ -204,15 +203,19 @@ To save places automatically in all files, put this in your `.emacs' file:
   (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)