Function: save-places-to-alist

save-places-to-alist is a byte-compiled function defined in saveplace.el.gz.

Signature

(save-places-to-alist)

Documentation

Save all buffer filenames and positions to save-place-alist.

See save-place-to-alist.

Source Code

;; Defined in /usr/src/emacs/lisp/saveplace.el.gz
(defun save-places-to-alist ()
  "Save all buffer filenames and positions to `save-place-alist'.
See `save-place-to-alist'."
  (let ((buf-list (buffer-list)))
    (while buf-list
      ;; put this into a save-excursion in case someone is counting on
      ;; another function in kill-emacs-hook to act on the last buffer
      ;; they were in:
      (with-current-buffer (car buf-list)
	;; save-place checks buffer-file-name too, but we can avoid
	;; overhead of function call by checking here too.
	(when (and (or buffer-file-name
                       (and (derived-mode-p 'dired-mode)
                            (boundp 'dired-subdir-alist)
                            dired-subdir-alist
                            (dired-current-directory)))
                   ;; Don't save place in literally-visited file
                   ;; because this will commonly differ from the place
                   ;; when visiting literally (and
                   ;; `find-file-literally' always places point at the
                   ;; start of the buffer).
                   (not find-file-literally))
	  (save-place-to-alist))
	(setq buf-list (cdr buf-list))))))