Variable: majutsu-blob-edit-mode
majutsu-blob-edit-mode is a buffer-local variable defined in
majutsu-file.el.
Documentation
Non-nil if Majutsu-Blob-Edit mode is enabled.
Use the command majutsu-blob-edit-mode(var)/majutsu-blob-edit-mode(fun) to change this variable.
Key Bindings
This command is not in any keymaps.
Source Code
;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-file.el
(define-minor-mode majutsu-blob-edit-mode
"Minor mode for editable blob buffers.
Saving in this mode applies changes through `jj diffedit'."
:lighter " BlobEdit"
:keymap majutsu-blob-edit-mode-map
(if majutsu-blob-edit-mode
(progn
(setq-local majutsu-blob-edit--original-content
(buffer-substring-no-properties (point-min) (point-max)))
(setq-local majutsu-blob-edit--original-point (point))
(setq-local majutsu-blob-edit--saved-blob-mode-enabled
(bound-and-true-p majutsu-blob-mode))
(when majutsu-blob-edit--saved-blob-mode-enabled
(majutsu-blob-mode -1))
(majutsu-blob-edit--save-cursor-state)
(majutsu-blob-edit--set-cursor-hint majutsu-blob-edit-cursor-type)
;; Use `read-only-mode' so read-only hooks (e.g. annotate keymap sync)
;; stay in sync with editable blob mode state.
(read-only-mode -1)
(add-hook 'write-contents-functions #'majutsu-blob-edit--write-contents nil t)
(message "Editable blob mode enabled. Save to apply; C-x C-q to exit; C-c C-k to abort."))
(remove-hook 'write-contents-functions #'majutsu-blob-edit--write-contents t)
(majutsu-blob-edit--restore-cursor-state)
(when majutsu-blob-edit--saved-blob-mode-enabled
(majutsu-blob-mode 1)
(setq-local majutsu-blob-edit--saved-blob-mode-enabled nil))
(read-only-mode 1)))