Function: file-name-shadow-mode

file-name-shadow-mode is an interactive and byte-compiled function defined in rfn-eshadow.el.gz.

Signature

(file-name-shadow-mode &optional ARG)

Documentation

Toggle file-name shadowing in minibuffers (File-Name Shadow mode).

File-Name Shadow mode is a global minor mode. When enabled, any part of a filename being read in the minibuffer that would be ignored (because the result is passed through substitute-in-file-name) is given the properties in file-name-shadow-properties, which can be used to make that portion dim, invisible, or otherwise less visually noticeable.

This is a global minor mode. If called interactively, toggle the File-Name-Shadow 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 (default-value \=file-name-shadow-mode)'.

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

View in manual

Probably introduced at or before Emacs version 22.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/rfn-eshadow.el.gz
(define-minor-mode file-name-shadow-mode
  "Toggle file-name shadowing in minibuffers (File-Name Shadow mode).

File-Name Shadow mode is a global minor mode.  When enabled, any
part of a filename being read in the minibuffer that would be
ignored (because the result is passed through
`substitute-in-file-name') is given the properties in
`file-name-shadow-properties', which can be used to make that
portion dim, invisible, or otherwise less visually noticeable."
  :global t
  ;; At the point where the defcustom is evaluated,
  ;; the corresponding function isn't defined yet, so
  ;; custom-initialize-set signals an error.
  :initialize #'custom-initialize-after-file-load
  :init-value t
  :group 'minibuffer
  :version "22.1"
  (if file-name-shadow-mode
      ;; Enable the mode
      (add-hook 'minibuffer-setup-hook 'rfn-eshadow-setup-minibuffer)
    ;; Disable the mode
    (remove-hook 'minibuffer-setup-hook 'rfn-eshadow-setup-minibuffer)
    ;; Remove our entry from any post-command-hook variable's it's still in
    (dolist (minibuf rfn-eshadow-frobbed-minibufs)
      (with-current-buffer minibuf
	(remove-hook 'post-command-hook #'rfn-eshadow-update-overlay t)))
    (setq rfn-eshadow-frobbed-minibufs nil)))