Commit 7c68485e authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-with-editor-envvar: New variable

Setting this to `GIT_SEQUENCE_EDITOR' means that Emacs will be used to
edit a file on behalf of `git rebase -i' but not when creating commits.
In that case `GIT_EDITOR' (if set, else `EDITOR') will be used to edit
commit messages and similar files.  Setting one of these env variables
is the responsibility of the user; by setting this variable, they have
opted out of having Magit do it for them.

Closes #3629.
parent 863569fd
......@@ -215,8 +215,15 @@ framework ultimately determines how the collection is displayed."
value)))
,@body)))
(defvar magit-with-editor-envvar "GIT_EDITOR"
"The environment variable exported by `magit-with-editor'.
Set this to \"GIT_SEQUENCE_EDITOR\" if you do not want to use
Emacs to edit commit messages but would like to do so to edit
rebase sequences.")
(defmacro magit-with-editor (&rest body)
"Like `with-editor' but let-bind some more variables."
"Like `with-editor' but let-bind some more variables.
Also respect the value of `magit-with-editor-envvar'."
(declare (indent 0) (debug (body)))
`(let ((magit-process-popup-time -1)
;; The user may have customized `shell-file-name' to
......@@ -231,7 +238,7 @@ framework ultimately determines how the collection is displayed."
(not magit-cygwin-mount-points))
"cmdproxy"
shell-file-name)))
(with-editor "GIT_EDITOR"
(with-editor magit-with-editor-envvar
,@body)))
(defun magit-process-git-arguments (args)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment