summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS.md7
-rw-r--r--LICENSE22
-rw-r--r--Makefile13
-rw-r--r--README.md13
-rw-r--r--debian/changelog41
-rw-r--r--debian/compat1
-rw-r--r--debian/control7
-rwxr-xr-xdebian/rules4
-rw-r--r--debian/watch4
-rw-r--r--with-editor.el127
-rw-r--r--with-editor.org62
-rw-r--r--with-editor.texi47
12 files changed, 243 insertions, 105 deletions
diff --git a/AUTHORS.md b/AUTHORS.md
index 0a8b10d..1f4d453 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -2,9 +2,16 @@ Authors
=======
- Barak A. Pearlmutter <barak+git@pearlmutter.net>
+- Christian Johansson <christian@cvj.se>
+- Itai Y. Efrat <itai3397@gmail.com>
- Jonas Bernoulli <jonas@bernoul.li>
- Justin Burkett <justin@burkett.cc>
+- Kyle Meyer <kyle@kyleam.com>
- Lele Gaifax <lele@metapensiero.it>
+- Mario Rodas <marsam@users.noreply.github.com>
+- Mark Shroyer <mark@shroyer.name>
- Noam Postavsky <npostavs@users.sourceforge.net>
- Philipp Stephani <phst@google.com>
- Rémi Vanicat <vanicat@debian.org>
+- Stéphane Soppera <soppera@users.noreply.github.com>
+- Suvayu Ali <fatkasuvayu+linux@gmail.com>
diff --git a/LICENSE b/LICENSE
index bf0f7d3..f288702 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,12 +1,11 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
@@ -69,7 +68,7 @@ patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
- TERMS AND CONDITIONS
+ TERMS AND CONDITIONS
0. Definitions.
@@ -619,9 +618,9 @@ an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
- END OF TERMS AND CONDITIONS
+ END OF TERMS AND CONDITIONS
- How to Apply These Terms to Your New Programs
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -646,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@@ -665,12 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
+<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
diff --git a/Makefile b/Makefile
index a0af182..a71265b 100644
--- a/Makefile
+++ b/Makefile
@@ -17,9 +17,8 @@ LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
LOAD_PATH += -L .
ifndef ORG_LOAD_PATH
-ORG_LOAD_PATH = -L ../dash
-ORG_LOAD_PATH += -L ../org/lisp
-ORG_LOAD_PATH += -L ../org/contrib/lisp
+ORG_LOAD_PATH = -L ../org/lisp
+ORG_LOAD_PATH += -L ../org-contrib/lisp
ORG_LOAD_PATH += -L ../ox-texinfo+
endif
@@ -56,8 +55,8 @@ info: $(PKG).info dir
html: $(PKG).html
pdf: $(PKG).pdf
-ORG_ARGS = --batch -Q $(ORG_LOAD_PATH) -l ox-extra -l ox-texinfo+.el
-ORG_EVAL = --eval "(ox-extras-activate '(ignore-headlines))"
+ORG_ARGS = --batch -Q $(ORG_LOAD_PATH) -l ox-texinfo+.el
+ORG_EVAL = --eval "(setq org-texinfo+-dissolve-noexport-headlines t)"
ORG_EVAL += --eval "(setq indent-tabs-mode nil)"
ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)"
ORG_EVAL += --funcall org-texinfo-export-to-texinfo
@@ -84,7 +83,8 @@ dir: $(PKG).info
@printf "%s" $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@
HTML_FIXUP_CSS = '/<link rel="stylesheet" type="text\/css" href="\/assets\/page.css">/a\
-<link class="s-css-s--style" rel="stylesheet" title="Default" href="/assets/themes/default.css">\
+<link rel="icon" href="/assets/magit_alt1.ico">\
+\n<link class="s-css-s--style" rel="stylesheet" title="Default" href="/assets/themes/default.css">\
\n<link class="s-css-s--style" rel="stylesheet alternate" title="Default high contrast" href="/assets/themes/default-high-contrast.css">\
\n<link class="s-css-s--style" rel="stylesheet alternate" title="Solarized dark xterm" href="/assets/themes/solarized-dark-xterm.css">\
\n<link class="s-css-s--style" rel="stylesheet alternate" title="Black on white" href="/assets/themes/black-on-white.css">\
@@ -148,6 +148,7 @@ clean:
@printf "Cleaning...\n"
@rm -rf $(CLEAN)
+.PHONY: authors AUTHORS.md
authors: AUTHORS.md
AUTHORS.md:
diff --git a/README.md b/README.md
index 3f2daea..4d41774 100644
--- a/README.md
+++ b/README.md
@@ -26,15 +26,16 @@ which always sets `$EDITOR` for all Emacs commands which ultimately
use `shell-command` to asynchronously run some shell command.
The command `with-editor-export-editor` exports `$EDITOR` or
-another such environment variable in `shell-mode`, `term-mode` and
-`eshell-mode` buffers. Use this Emacs command before executing a
-shell command which needs the editor set, or always arrange for the
-current Emacs instance to be used as editor by adding it to the
-appropriate mode hooks:
+another such environment variable in `shell-mode`, `eshell-mode`,
+`term-mode` and `vterm-mode` buffers. Use this Emacs command
+before executing a shell command which needs the editor set, or
+always arrange for the current Emacs instance to be used as editor
+by adding it to the appropriate mode hooks:
(add-hook 'shell-mode-hook 'with-editor-export-editor)
- (add-hook 'term-exec-hook 'with-editor-export-editor)
(add-hook 'eshell-mode-hook 'with-editor-export-editor)
+ (add-hook 'term-exec-hook 'with-editor-export-editor)
+ (add-hook 'vterm-mode-hook 'with-editor-export-editor)
Some variants of this function exist, these two forms are
equivalent:
diff --git a/debian/changelog b/debian/changelog
index 694dea7..bedc5c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,44 @@
+with-editor (3.0.5-1) unstable; urgency=medium
+
+ * New upstream release.
+
+ -- Rémi Vanicat <vanicat@debian.org> Sun, 17 Oct 2021 18:24:28 +0200
+
+with-editor (3.0.4-1) unstable; urgency=medium
+
+ * Team upload
+
+ [ Rémi Vanicat ]
+ * New upstream release.
+ * Update the watch file
+
+ [ Matteo F. Vescovi ]
+ * debian/watch: version bump 3 -> 4
+ * debian/control: S-V bump 4.1.4 -> 4.6.0 (no changes needed)
+
+ -- Rémi Vanicat <vanicat@debian.org> Fri, 20 Aug 2021 09:09:04 +0200
+
+with-editor (3.0.2-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream release.
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Sat, 07 Nov 2020 12:26:22 -0700
+
+with-editor (2.9.1-2) unstable; urgency=medium
+
+ [ Nicholas D Steeves]
+ * Team upload.
+ * Drop emacs25 from Enhances; it has been a dummy package since buster.
+ * Switch to debhelper-compat 13.
+ * control: Add Rules-Requires-Root: no.
+
+ [ Sven Joachim ]
+ * d/rules: Compute VERSION from d/changelog rather than hardcoding it,
+ which means it gets outdated quickly (Closes: #924512)
+
+ -- Nicholas D Steeves <nsteeves@gmail.com> Sun, 31 May 2020 22:56:08 -0400
+
with-editor (2.9.1-1) unstable; urgency=medium
[ David Krauser ]
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index b4de394..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-11
diff --git a/debian/control b/debian/control
index b200295..72225ce 100644
--- a/debian/control
+++ b/debian/control
@@ -3,9 +3,10 @@ Section: editors
Priority: optional
Maintainer: Debian Emacsen Team <debian-emacsen@lists.debian.org>
Uploaders: Rémi Vanicat <vanicat@debian.org>
-Build-Depends: debhelper (>= 11), dh-elpa (>= 1.7),
+Build-Depends: debhelper-compat (= 13), dh-elpa (>= 1.7),
install-info, texinfo
-Standards-Version: 4.1.4
+Rules-Requires-Root: no
+Standards-Version: 4.6.0
Homepage: https://magit.vc/
Vcs-Browser: https://salsa.debian.org/emacsen-team/with-editor
Vcs-Git: https://salsa.debian.org/emacsen-team/with-editor.git
@@ -13,7 +14,7 @@ Vcs-Git: https://salsa.debian.org/emacsen-team/with-editor.git
Package: elpa-with-editor
Architecture: all
Depends: ${misc:Depends}, ${elpa:Depends}
-Enhances: emacs, emacs25
+Enhances: emacs
Description: call program using Emacs as $EDITOR
With this package, you can call program from Emacs such that they
will use Emacs as an editor.
diff --git a/debian/rules b/debian/rules
index 0bb4fe0..80eb9b2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,7 @@
#!/usr/bin/make -f
-VERSION=2.6.0
+
+include /usr/share/dpkg/pkg-info.mk
+VERSION=$(DEB_VERSION_UPSTREAM)
CP ?= install -p -m 644
MKDIR ?= install -p -m 755 -d
diff --git a/debian/watch b/debian/watch
index 90cfa06..518f39f 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,2 @@
-version=3
-https://github.com/magit/with-editor/releases /magit/with-editor/archive/v(\d.+).tar.gz
+version=4
+https://github.com/magit/with-editor/releases /magit/with-editor/archive/refs/tags/v(\d.+).tar.gz
diff --git a/with-editor.el b/with-editor.el
index 7612200..751133f 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -1,32 +1,35 @@
;;; with-editor.el --- Use the Emacsclient as $EDITOR -*- lexical-binding: t -*-
-;; Copyright (C) 2014-2020 The Magit Project Contributors
+;; Copyright (C) 2014-2021 The Magit Project Contributors
;;
;; You should have received a copy of the AUTHORS.md file. If not,
;; see https://github.com/magit/with-editor/blob/master/AUTHORS.md.
;; Author: Jonas Bernoulli <jonas@bernoul.li>
;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-
-;; Package-Requires: ((emacs "24.4") (async "1.9"))
;; Keywords: tools
;; Homepage: https://github.com/magit/with-editor
-;; This file is not part of GNU Emacs.
+;; Package-Requires: ((emacs "24.4"))
+;; Package-Version: 3.0.5
+
+;; SPDX-License-Identifier: GPL-3.0-or-later
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
-
+;;
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
-
+;;
;; You should have received a copy of the GNU General Public License
;; along with Magit. If not, see http://www.gnu.org/licenses.
+;; This file is not part of GNU Emacs.
+
;;; Commentary:
;; This library makes it possible to reliably use the Emacsclient as
@@ -54,15 +57,16 @@
;; use `shell-command' to asynchronously run some shell command.
;; The command `with-editor-export-editor' exports `$EDITOR' or
-;; another such environment variable in `shell-mode', `term-mode' and
-;; `eshell-mode' buffers. Use this Emacs command before executing a
-;; shell command which needs the editor set, or always arrange for the
-;; current Emacs instance to be used as editor by adding it to the
-;; appropriate mode hooks:
+;; another such environment variable in `shell-mode', `eshell-mode',
+;; `term-mode' and `vterm-mode' buffers. Use this Emacs command
+;; before executing a shell command which needs the editor set, or
+;; always arrange for the current Emacs instance to be used as editor
+;; by adding it to the appropriate mode hooks:
;;
;; (add-hook 'shell-mode-hook 'with-editor-export-editor)
-;; (add-hook 'term-exec-hook 'with-editor-export-editor)
;; (add-hook 'eshell-mode-hook 'with-editor-export-editor)
+;; (add-hook 'term-exec-hook 'with-editor-export-editor)
+;; (add-hook 'vterm-mode-hook 'with-editor-export-editor)
;; Some variants of this function exist, these two forms are
;; equivalent:
@@ -80,27 +84,27 @@
;;; Code:
(require 'cl-lib)
-;; `pcase-dolist' is not autoloaded on Emacs 24.
-(eval-when-compile (require 'pcase))
+(eval-when-compile
+ (require 'pcase) ; `pcase-dolist' is not autoloaded on Emacs 24.
+ (require 'subr-x))
(require 'server)
(require 'shell)
-(and (require 'async-bytecomp nil t)
- (let ((pkgs (bound-and-true-p async-bytecomp-allowed-packages)))
- (if (consp pkgs)
- (cl-intersection '(all magit) pkgs)
- (memq pkgs '(all t))))
- (fboundp 'async-bytecomp-package-mode)
- (async-bytecomp-package-mode 1))
-
(eval-when-compile
(progn (require 'dired nil t)
(require 'eshell nil t)
(require 'term nil t)
+ (condition-case err
+ (require 'vterm nil t)
+ (error (message "Error(vterm): %S" err)))
(require 'warnings nil t)))
(declare-function dired-get-filename 'dired)
(declare-function term-emulate-terminal 'term)
+(declare-function vterm-send-return 'vterm)
+(declare-function vterm-send-string 'vterm)
(defvar eshell-preoutput-filter-functions)
+(defvar git-commit-post-finish-hook)
+(defvar vterm--process)
;;; Options
@@ -176,7 +180,7 @@ please see https://github.com/magit/magit/wiki/Emacsclient."))))
(defcustom with-editor-sleeping-editor "\
sh -c '\
-echo \"WITH-EDITOR: $$ OPEN $0 IN $(pwd)\"; \
+printf \"WITH-EDITOR: $$ OPEN $0\\037 IN $(pwd)\\n\"; \
sleep 604800 & sleep=$!; \
trap \"kill $sleep; exit 0\" USR1; \
trap \"kill $sleep; exit 1\" USR2; \
@@ -317,12 +321,9 @@ And some tools that do not handle $EDITOR properly also break."
(put 'with-editor-post-finish-hook 'permanent-local t)
(put 'with-editor-post-cancel-hook 'permanent-local t)
-(defvar with-editor-show-usage t)
-(defvar with-editor-cancel-message nil)
-(defvar with-editor-previous-winconf nil)
-(make-variable-buffer-local 'with-editor-show-usage)
-(make-variable-buffer-local 'with-editor-cancel-message)
-(make-variable-buffer-local 'with-editor-previous-winconf)
+(defvar-local with-editor-show-usage t)
+(defvar-local with-editor-cancel-message nil)
+(defvar-local with-editor-previous-winconf nil)
(put 'with-editor-cancel-message 'permanent-local t)
(put 'with-editor-previous-winconf 'permanent-local t)
@@ -539,7 +540,7 @@ at run-time.
server-window))
(defun server-switch-buffer--with-editor-server-window-alist
- (fn &optional next-buffer killed-one filepos)
+ (fn &optional next-buffer &rest args)
"Honor `with-editor-server-window-alist' (which see)."
(let ((server-window (with-current-buffer
(or next-buffer (current-buffer))
@@ -547,7 +548,7 @@ at run-time.
(setq with-editor-previous-winconf
(current-window-configuration)))
(with-editor-server-window))))
- (funcall fn next-buffer killed-one filepos)))
+ (apply fn next-buffer args)))
(advice-add 'server-switch-buffer :around
'server-switch-buffer--with-editor-server-window-alist)
@@ -579,6 +580,48 @@ the appropriate editor environment variable."
(advice-add 'start-file-process :around
'start-file-process--with-editor-process-filter)
+(cl-defun make-process--with-editor-process-filter
+ (fn &rest keys &key name buffer command coding noquery stop
+ connection-type filter sentinel stderr file-handler
+ &allow-other-keys)
+ "When called inside a `with-editor' form and the Emacsclient
+cannot be used, then give the process the filter function
+`with-editor-process-filter'. To avoid overriding the filter
+being added here you should use `with-editor-set-process-filter'
+instead of `set-process-filter' inside `with-editor' forms.
+
+When the `default-directory' is located on a remote machine and
+FILE-HANDLER is non-nil, then also manipulate COMMAND in order
+to set the appropriate editor environment variable."
+ (if (or (not file-handler) (not with-editor--envvar))
+ (apply fn keys)
+ (when (file-remote-p default-directory)
+ (unless (equal (car command) "env")
+ (push "env" command))
+ (push (concat with-editor--envvar "=" with-editor-sleeping-editor)
+ (cdr command)))
+ (let* ((filter (if filter
+ (lambda (process output)
+ (funcall filter process output)
+ (with-editor-process-filter process output t))
+ #'with-editor-process-filter))
+ (process (funcall fn
+ :name name
+ :buffer buffer
+ :command command
+ :coding coding
+ :noquery noquery
+ :stop stop
+ :connection-type connection-type
+ :filter filter
+ :sentinel sentinel
+ :stderr stderr
+ :file-handler file-handler)))
+ (process-put process 'default-dir default-directory)
+ process)))
+
+(advice-add #'make-process :around #'make-process--with-editor-process-filter)
+
(defun with-editor-set-process-filter (process filter)
"Like `set-process-filter' but keep `with-editor-process-filter'.
Give PROCESS the new FILTER but keep `with-editor-process-filter'
@@ -587,7 +630,7 @@ if that was added earlier by the advised `start-file-process'.
Do so by wrapping the two filter functions using a lambda, which
becomes the actual filter. It calls `with-editor-process-filter'
first, passing t as NO-STANDARD-FILTER. Then it calls FILTER,
-which may or may not insert the text into the PROCESS' buffer."
+which may or may not insert the text into the PROCESS's buffer."
(set-process-filter
process
(if (eq (process-filter process) 'with-editor-process-filter)
@@ -649,11 +692,12 @@ Set and export the environment variable ENVVAR, by default
\"EDITOR\". The value is automatically generated to teach
commands to use the current Emacs instance as \"the editor\".
-This works in `shell-mode', `term-mode' and `eshell-mode'."
+This works in `shell-mode', `term-mode', `eshell-mode' and
+`vterm'."
(interactive (list (with-editor-read-envvar)))
(cond
((derived-mode-p 'comint-mode 'term-mode)
- (let ((process (get-buffer-process (current-buffer))))
+ (when-let ((process (get-buffer-process (current-buffer))))
(goto-char (process-mark process))
(process-send-string
process (format " export %s=%s\n" envvar
@@ -667,6 +711,21 @@ This works in `shell-mode', `term-mode' and `eshell-mode'."
(add-to-list 'eshell-preoutput-filter-functions
'with-editor-output-filter)
(setenv envvar with-editor-sleeping-editor))
+ ((derived-mode-p 'vterm-mode)
+ (if with-editor-emacsclient-executable
+ (let ((with-editor--envvar envvar)
+ (process-environment process-environment))
+ (with-editor--setup)
+ (while (accept-process-output vterm--process 0.1))
+ (when-let ((v (getenv envvar)))
+ (vterm-send-string (format "export %s=%S" envvar v))
+ (vterm-send-return))
+ (when-let ((v (getenv "EMACS_SERVER_FILE")))
+ (vterm-send-string (format "export EMACS_SERVER_FILE=%S" v))
+ (vterm-send-return))
+ (vterm-send-string "clear")
+ (vterm-send-return))
+ (error "Cannot use sleeping editor in this buffer")))
(t
(error "Cannot export environment variables in this buffer")))
(message "Successfully exported %s" envvar))
diff --git a/with-editor.org b/with-editor.org
index 3e51df2..7686dd9 100644
--- a/with-editor.org
+++ b/with-editor.org
@@ -2,19 +2,19 @@
:PREAMBLE:
#+AUTHOR: Jonas Bernoulli
#+EMAIL: jonas@bernoul.li
-#+DATE: 2015-2020
+#+DATE: 2015-2021
#+LANGUAGE: en
#+TEXINFO_DIR_CATEGORY: Emacs
#+TEXINFO_DIR_TITLE: With-Editor: (with-editor).
#+TEXINFO_DIR_DESC: Using the Emacsclient as $EDITOR
-#+SUBTITLE: for version 2.9.1
+#+SUBTITLE: for version 3.0.5
#+TEXINFO_DEFFN: t
+#+OPTIONS: H:4 num:4 toc:2
#+PROPERTY: header-args :eval never
#+BIND: ox-texinfo+-before-export-hook ox-texinfo+-update-copyright-years
#+BIND: ox-texinfo+-before-export-hook ox-texinfo+-update-version-strings
-#+OPTIONS: H:4 num:4 toc:2
The library ~with-editor~ makes it easy to use the Emacsclient as the
~$EDITOR~ of child processes, making sure they know how to call home.
@@ -32,10 +32,10 @@ additional functionality which makes it useful even for end-users, who
don't use Magit or another package which uses it internally.
#+TEXINFO: @noindent
-This manual is for With-Editor version 2.9.1.
+This manual is for With-Editor version 3.0.5.
#+BEGIN_QUOTE
-Copyright (C) 2015-2020 Jonas Bernoulli <jonas@bernoul.li>
+Copyright (C) 2015-2021 Jonas Bernoulli <jonas@bernoul.li>
You can redistribute this document and/or modify it under the terms
of the GNU General Public License as published by the Free Software
@@ -193,17 +193,18 @@ Alternatively use the global ~shell-command-with-editor-mode~.
command. This affects most variants of that command, whether they
are defined in Emacs or in some third-party package.
-The command ~with-editor-export-editor~ exports ~$EDITOR~ or
-another such environment variable in ~shell-mode~, ~term-mode~ and
-~eshell-mode~ buffers. Use this Emacs command before executing a
-shell command which needs the editor set, or always arrange for the
-current Emacs instance to be used as editor by adding it to the
-appropriate mode hooks:
+The command ~with-editor-export-editor~ exports ~$EDITOR~ or another
+such environment variable in ~shell-mode~, ~eshell-mode~, ~term-mode~ and
+~vterm-mode~ buffers. Use this Emacs command before executing a shell
+command which needs the editor set, or always arrange for the current
+Emacs instance to be used as editor by adding it to the appropriate
+mode hooks:
#+BEGIN_SRC emacs-lisp
(add-hook 'shell-mode-hook 'with-editor-export-editor)
- (add-hook 'term-exec-hook 'with-editor-export-editor)
(add-hook 'eshell-mode-hook 'with-editor-export-editor)
+ (add-hook 'term-exec-hook 'with-editor-export-editor)
+ (add-hook 'vterm-exec-hook 'with-editor-export-editor)
#+END_SRC
Some variants of this function exist; these two forms are equivalent:
@@ -216,9 +217,9 @@ Some variants of this function exist; these two forms are equivalent:
- Command: with-editor-export-editor
- When invoked in a ~shell-mode~, ~term-mode~, or ~eshell-mode~ buffer, this
- command teaches shell commands to use the current Emacs instance as
- the editor, by exporting ~$EDITOR~.
+ When invoked in a ~shell-mode~, ~eshell-mode~, ~term-mode~ or ~vterm-mode~
+ buffer, this command teaches shell commands to use the current Emacs
+ instance as the editor, by exporting ~$EDITOR~.
- Command: with-editor-export-git-editor
@@ -285,20 +286,28 @@ https://github.com/magit/with-editor/issues and provide information
about your Emacs installation. Most importantly how did you install
Emacs and what is the output of ~M-x with-editor-debug RET~.
-# LocalWords: LocalWords
-# LocalWords: Magit Emacs emacsclient FreeBSD macOS texinfo
-# LocalWords: async eval hg init performant rebase startup
-
-# Local Variables:
-# eval: (require 'ox-texinfo+ nil t)
-# End:
+* Command Index
+:PROPERTIES:
+:APPENDIX: t
+:INDEX: cp
+:END:
+* Function Index
+:PROPERTIES:
+:APPENDIX: t
+:INDEX: fn
+:END:
+* Variable Index
+:PROPERTIES:
+:APPENDIX: t
+:INDEX: vr
+:END:
* _ Copying
:PROPERTIES:
:COPYING: t
:END:
#+BEGIN_QUOTE
-Copyright (C) 2015-2020 Jonas Bernoulli <jonas@bernoul.li>
+Copyright (C) 2015-2021 Jonas Bernoulli <jonas@bernoul.li>
You can redistribute this document and/or modify it under the terms
of the GNU General Public License as published by the Free Software
@@ -311,14 +320,15 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
#+END_QUOTE
-* _ :ignore:
+# LocalWords: LocalWords
+# LocalWords: Magit Emacs emacsclient FreeBSD macOS texinfo
+# LocalWords: async eval hg init performant rebase startup
# IMPORTANT: Also update ORG_ARGS and ORG_EVAL in the Makefile.
# Local Variables:
# eval: (require 'magit-utils nil t)
-# eval: (require 'ox-extra nil t)
# eval: (require 'ox-texinfo+ nil t)
-# eval: (and (featurep 'ox-extra) (ox-extras-activate '(ignore-headlines)))
+# org-texinfo+-dissolve-noexport-headlines: t
# indent-tabs-mode: nil
# org-src-preserve-indentation: nil
# End:
diff --git a/with-editor.texi b/with-editor.texi
index 542004d..afdf587 100644
--- a/with-editor.texi
+++ b/with-editor.texi
@@ -8,7 +8,7 @@
@copying
@quotation
-Copyright (C) 2015-2020 Jonas Bernoulli <jonas@@bernoul.li>
+Copyright (C) 2015-2021 Jonas Bernoulli <jonas@@bernoul.li>
You can redistribute this document and/or modify it under the terms
of the GNU General Public License as published by the Free Software
@@ -31,7 +31,7 @@ General Public License for more details.
@finalout
@titlepage
@title With-Editor User Manual
-@subtitle for version 2.9.1
+@subtitle for version 3.0.5
@author Jonas Bernoulli
@page
@vskip 0pt plus 1filll
@@ -60,10 +60,10 @@ additional functionality which makes it useful even for end-users, who
don't use Magit or another package which uses it internally.
@noindent
-This manual is for With-Editor version 2.9.1.
+This manual is for With-Editor version 3.0.5.
@quotation
-Copyright (C) 2015-2020 Jonas Bernoulli <jonas@@bernoul.li>
+Copyright (C) 2015-2021 Jonas Bernoulli <jonas@@bernoul.li>
You can redistribute this document and/or modify it under the terms
of the GNU General Public License as published by the Free Software
@@ -82,6 +82,9 @@ General Public License for more details.
* Using the With-Editor package::
* Using With-Editor as a library::
* Debugging::
+* Command Index::
+* Function Index::
+* Variable Index::
@detailmenu
--- The Detailed Node Listing ---
@@ -255,17 +258,18 @@ command. This affects most variants of that command, whether they
are defined in Emacs or in some third-party package.
@end defvar
-The command @code{with-editor-export-editor} exports @code{$EDITOR} or
-another such environment variable in @code{shell-mode}, @code{term-mode} and
-@code{eshell-mode} buffers. Use this Emacs command before executing a
-shell command which needs the editor set, or always arrange for the
-current Emacs instance to be used as editor by adding it to the
-appropriate mode hooks:
+The command @code{with-editor-export-editor} exports @code{$EDITOR} or another
+such environment variable in @code{shell-mode}, @code{eshell-mode}, @code{term-mode} and
+@code{vterm-mode} buffers. Use this Emacs command before executing a shell
+command which needs the editor set, or always arrange for the current
+Emacs instance to be used as editor by adding it to the appropriate
+mode hooks:
@lisp
(add-hook 'shell-mode-hook 'with-editor-export-editor)
-(add-hook 'term-exec-hook 'with-editor-export-editor)
(add-hook 'eshell-mode-hook 'with-editor-export-editor)
+(add-hook 'term-exec-hook 'with-editor-export-editor)
+(add-hook 'vterm-exec-hook 'with-editor-export-editor)
@end lisp
Some variants of this function exist; these two forms are equivalent:
@@ -279,9 +283,9 @@ Some variants of this function exist; these two forms are equivalent:
@cindex with-editor-export-editor
@deffn Command with-editor-export-editor
-When invoked in a @code{shell-mode}, @code{term-mode}, or @code{eshell-mode} buffer, this
-command teaches shell commands to use the current Emacs instance as
-the editor, by exporting @code{$EDITOR}.
+When invoked in a @code{shell-mode}, @code{eshell-mode}, @code{term-mode} or @code{vterm-mode}
+buffer, this command teaches shell commands to use the current Emacs
+instance as the editor, by exporting @code{$EDITOR}.
@end deffn
@cindex with-editor-export-git-editor
@@ -357,4 +361,19 @@ in Magit, then please open a new issue at
about your Emacs installation. Most importantly how did you install
Emacs and what is the output of @code{M-x with-editor-debug RET}.
+@node Command Index
+@appendix Command Index
+
+@printindex cp
+
+@node Function Index
+@appendix Function Index
+
+@printindex fn
+
+@node Variable Index
+@appendix Variable Index
+
+@printindex vr
+
@bye