Function: magit-emacs-Q-command

magit-emacs-Q-command is an autoloaded, interactive and byte-compiled function defined in magit-base.el.

Signature

(magit-emacs-Q-command)

Documentation

Show a shell command that runs an uncustomized Emacs with only Magit loaded.

See info node (magit)Debugging Tools for more information.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-base.el
;;; Debug Utilities

;;;###autoload
(defun magit-emacs-Q-command ()
  "Show a shell command that runs an uncustomized Emacs with only Magit loaded.
See info node `(magit)Debugging Tools' for more information."
  (interactive)
  (let ((cmd (mapconcat
              #'shell-quote-argument
              `(,(concat invocation-directory invocation-name)
                "-Q" "--eval" "(setq debug-on-error t)"
                ,@(mapcan
                   (##list "-L" %)
                   (delete-dups
                    (seq-keep
                     (lambda (lib)
                       (if-let ((path (locate-library lib)))
                           (file-name-directory path)
                         (error "Cannot find mandatory dependency %s" lib)))
                     '(;; Like `LOAD_PATH' in `default.mk'.
                       "compat"
                       "cond-let"
                       "llama"
                       "seq"
                       "transient"
                       "with-editor"
                       ;; Obviously `magit' itself is needed too.
                       "magit"
                       ;; While this is part of the Magit repository,
                       ;; it is distributed as a separate package.
                       "magit-section"))))
                ;; Avoid Emacs bug#16406 by using full path.
                "-l" ,(file-name-sans-extension (locate-library "magit")))
              " ")))
    (message "Uncustomized Magit command saved to kill-ring, %s"
             "please run it in a terminal.")
    (kill-new cmd)))