Function: pretty-sha-path-mode

pretty-sha-path-mode is an interactive and natively compiled function defined in pretty-sha-path.el.

Signature

(pretty-sha-path-mode &optional ARG)

Documentation

Toggle Pretty SHA Path mode.

With a prefix argument ARG, enable Pretty SHA Path mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil.

When Pretty SHA Path mode is enabled, SHA-parts of the Guix/Nix store paths (see pretty-sha-path-regexp) are prettified, i.e. displayed as pretty-sha-path-char character. This mode can be enabled programmatically using hooks:

  (add-hook 'shell-mode-hook 'pretty-sha-path-mode)

It is possible to enable the mode in any buffer, however not any buffer's highlighting may survive after adding new elements to font-lock-keywords (see pretty-sha-path-special-modes for details).

Also you can use global-pretty-sha-path-mode(var)/global-pretty-sha-path-mode(fun) to enable Pretty SHA Path mode for all modes that support font-locking.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/0sidmpcpzq7hwxvxlmkbzsm399sak6g6-emacs-packages-deps/share/emacs/site-lisp/elpa/pretty-sha-path-20141105.1826/pretty-sha-path.el
;;;###autoload
(define-minor-mode pretty-sha-path-mode
  "Toggle Pretty SHA Path mode.

With a prefix argument ARG, enable Pretty SHA Path mode if ARG is
positive, and disable it otherwise.  If called from Lisp, enable
the mode if ARG is omitted or nil.

When Pretty SHA Path mode is enabled, SHA-parts of the Guix/Nix
store paths (see `pretty-sha-path-regexp') are prettified,
i.e. displayed as `pretty-sha-path-char' character.  This mode
can be enabled programmatically using hooks:

  (add-hook 'shell-mode-hook 'pretty-sha-path-mode)

It is possible to enable the mode in any buffer, however not any
buffer's highlighting may survive after adding new elements to
`font-lock-keywords' (see `pretty-sha-path-special-modes' for
details).

Also you can use `global-pretty-sha-path-mode' to enable Pretty
SHA Path mode for all modes that support font-locking."
  :init-value nil
  :lighter " …"
  (let ((keywords `((,pretty-sha-path-regexp
                     (,pretty-sha-path-regexp-group
                      (pretty-sha-path-compose))))))
    (if pretty-sha-path-mode
        ;; Turn on.
        (font-lock-add-keywords nil keywords)
      ;; Turn off.
      (font-lock-remove-keywords nil keywords)
      (pretty-sha-path-decompose-buffer))
    (and pretty-sha-path-flush-function
         (funcall pretty-sha-path-flush-function))))