Function: save-place-local-mode

save-place-local-mode is an autoloaded, interactive and byte-compiled function defined in saveplace.el.gz.

Signature

(save-place-local-mode &optional ARG)

Documentation

Toggle whether to save your place in this file between sessions.

If this mode is enabled, point is recorded when you kill the buffer or exit Emacs. Visiting this file again will go to that position, even in a later Emacs session.

To save places automatically in all files, put this in your init file:

(save-place-mode 1)

This is a minor mode. If called interactively, toggle the Save-Place-Local mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate the variable save-place-mode(var)/save-place-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

Probably introduced at or before Emacs version 25.1.

Key Bindings

Aliases

toggle-save-place (obsolete since 25.1)

Source Code

;; Defined in /usr/src/emacs/lisp/saveplace.el.gz
;;;###autoload
(define-minor-mode save-place-local-mode
  "Toggle whether to save your place in this file between sessions.
If this mode is enabled, point is recorded when you kill the buffer
or exit Emacs.  Visiting this file again will go to that position,
even in a later Emacs session.

To save places automatically in all files, put this in your init
file:

\(save-place-mode 1)"
  :variable save-place-mode
  (if (not (or buffer-file-name (and (derived-mode-p 'dired-mode)
                                     (boundp 'dired-subdir-alist)
				     dired-subdir-alist
				     (dired-current-directory))))
      (message "Buffer `%s' not visiting a file or directory" (buffer-name))
    (save-place--setup-hooks save-place-mode)
    (save-place--manage-timer)))