Function: majutsu-blob-edit-finish

majutsu-blob-edit-finish is an interactive and natively compiled function defined in majutsu-file.el.

Signature

(majutsu-blob-edit-finish)

Documentation

Save and apply editable blob changes.

Key Bindings

majutsu-blob-edit-mode-map C-c C-c

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-file.el
(defun majutsu-blob-edit-finish ()
  "Save and apply editable blob changes."
  (interactive)
  (unless majutsu-blob-edit-mode
    (user-error "Blob editable mode is not active"))
  (if (majutsu-blob-edit--changed-p)
      (progn
        ;; `save-buffer' skips write hooks if modified flag is nil.
        ;; In editable blob buffers this can happen after undo-like edits,
        ;; so force the modified flag when content differs from snapshot.
        (unless (buffer-modified-p)
          (set-buffer-modified-p t))
        (save-buffer))
    (majutsu-blob-edit-mode -1)
    (set-buffer-modified-p nil)
    (setq buffer-undo-list nil)
    (message "(No changes need to be saved)")))