Variable: magit-blob-mode-hook

magit-blob-mode-hook is a customizable variable defined in magit-files.el.

Value

nil

Documentation

Hook run after entering or leaving magit-blob-mode(var)/magit-blob-mode(fun).

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-files.el
(define-minor-mode magit-blob-mode
  "Enable key bindings, which are useful in blob-visiting buffers.

\\{magit-blob-mode-map}
When the user disables `read-only-mode', these bindings would conflict
with bindings for `self-insert-command'.  To avoid this conflict,
`read-only-mode' is remapped to `magit-blob-mode' and disabling the
latter disables both modes.  Likewise, enabling it, also enables
`read-only-mode'.

When this mode is disabled, many of the commands, for which it would
single-character bindings, are accessible via \\[magit-file-dispatch]."
  :package-version '(magit . "2.3.0")
  ;; Don't actually call `read-only-mode'.  Because
  ;; that could enable the incompatible `view-mode'.
  (setq-local buffer-read-only magit-blob-mode)
  (setq-local read-only-mode--state magit-blob-mode))