Variable: save-place-abbreviate-file-names

save-place-abbreviate-file-names is a customizable variable defined in saveplace.el.gz.

Value

nil

Documentation

If non-nil, abbreviate file names before saving them.

This can simplify sharing the save-place-file file across different hosts.

Changing this option requires rewriting save-place-alist with corresponding file name format, therefore setting this option just using setq may cause out-of-sync problems. You should use either setopt or M-x customize-variable (customize-variable) to set this option.

This variable was added, or its default value changed, in Emacs 28.1.

Probably introduced at or before Emacs version 28.1.

Source Code

;; Defined in /usr/src/emacs/lisp/saveplace.el.gz
(defcustom save-place-abbreviate-file-names nil
  "If non-nil, abbreviate file names before saving them.
This can simplify sharing the `save-place-file' file across
different hosts.

Changing this option requires rewriting `save-place-alist' with
corresponding file name format, therefore setting this option
just using `setq' may cause out-of-sync problems.  You should use
either `setopt' or \\[customize-variable] to set this option."
  :type 'boolean
  :set (lambda (sym val)
         (set-default sym val)
         (or save-place-loaded (save-place-load-alist-from-file))
         (let ((fun (if val #'abbreviate-file-name #'expand-file-name))
               ;; Don't expand file names for non-existing remote connections.
               (non-essential t))
           (setq save-place-alist
                 (cl-delete-duplicates
                  (cl-loop for (k . v) in save-place-alist
                           collect
                           (cons (funcall fun k)
                                 (if (listp v)
                                     (cl-loop for (k1 . v1) in v
                                              collect
                                              (cons k1 (funcall fun v1)))
                                   v)))
                  :key #'car
                  :from-end t
                  :test #'equal)))
         val)
  :version "28.1")