Function: majutsu--transient-with-selection-buffer

majutsu--transient-with-selection-buffer is a natively compiled function defined in majutsu-core.el.

Signature

(majutsu--transient-with-selection-buffer FN &rest ARGS)

Documentation

Call FN with ARGS in the active selection session buffer.

Majutsu transients store their originating buffer in transient-scope. Running default action suffixes in that buffer keeps repository context, default-directory, and buffer-local selection state consistent even if the transient UI or another callback changes the current buffer. If no Majutsu
  selection session is active, call FN in the current buffer.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-core.el
(defun majutsu--transient-with-selection-buffer (fn &rest args)
  "Call FN with ARGS in the active selection session buffer.

Majutsu transients store their originating buffer in `transient-scope'.
Running default action suffixes in that buffer keeps repository context,
`default-directory', and buffer-local selection state consistent even if the
transient UI or another callback changes the current buffer.  If no Majutsu
  selection session is active, call FN in the current buffer."
  (let ((scope (transient-scope)))
    (if (majutsu-selection-session-p scope)
        (let ((buffer (majutsu-selection-session-buffer scope)))
          (unless (buffer-live-p buffer)
            (user-error "Selection buffer is no longer live"))
          (with-current-buffer buffer
            (apply fn args)))
      (apply fn args))))