[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-editor 5bb0b8a 012/140: with-editor-sleeping-editor:
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/with-editor 5bb0b8a 012/140: with-editor-sleeping-editor: document csh complications |
Date: |
Fri, 6 Aug 2021 12:51:10 -0400 (EDT) |
branch: elpa/with-editor
commit 5bb0b8ae05bc7c42779cbbf3f0368b5dd4b996b3
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
with-editor-sleeping-editor: document csh complications
Closes #9.
---
with-editor.el | 22 +++++++++++++++++++++-
with-editor.org | 21 ++++++++++++++++++++-
with-editor.texi | 21 ++++++++++++++++++++-
3 files changed, 61 insertions(+), 3 deletions(-)
diff --git a/with-editor.el b/with-editor.el
index 665de74..423db88 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -184,7 +184,27 @@ Where the latter uses a socket to communicate with Emacs'
server,
this substitute prints edit requests to its standard output on
which a process filter listens for such requests. As such it is
not a complete substitute for a proper Emacsclient, it can only
-be used as $EDITOR of child process of the current Emacs instance."
+be used as $EDITOR of child process of the current Emacs instance.
+
+Some shells do not execute traps immediately when waiting for a
+child process, but by default we do use such a blocking child
+process.
+
+If you use such a shell (e.g. `csh' on FreeBSD, but not Debian),
+then you have to edit this option. You can either replace \"sh\"
+with \"bash\" (and install that), or you can use the older, less
+performant implementation:
+
+ \"sh -c '\\
+ echo \\\"WITH-EDITOR: $$ OPEN $0\\\"; \\
+ trap \\\"exit 0\\\" USR1; \\
+ trap \\\"exit 1\" USR2; \\
+ while true; do sleep 1; done'\"
+
+Note that this leads to a delay of up to a second. The delay can
+be shortened by replacing \"sleep 1\" with \"sleep 0.01\", or if your
+implementation does not support floats, then by using `nanosleep'
+instead."
:group 'with-editor
:type 'string)
diff --git a/with-editor.org b/with-editor.org
index edf0134..7fb73fc 100644
--- a/with-editor.org
+++ b/with-editor.org
@@ -127,7 +127,26 @@ it receives a signal.
not a complete substitute for a proper Emacsclient, it can only
be used as ~$EDITOR~ of child process of the current Emacs instance.
- It is unlikely that you should ever have to customize this option.
+ Some shells do not execute traps immediately when waiting for a
+ child process, but by default we do use such a blocking child
+ process.
+
+ If you use such a shell (e.g. ~csh~ on FreeBSD, but not Debian), then
+ you have to edit this option. You can either replace ~sh~ with ~bash~
+ (and install that), or you can use the older, less performant
+ implementation:
+
+ #+BEGIN_SRC emacs-lisp
+ "sh -c '\
+ echo \"WITH-EDITOR: $$ OPEN $0\"; \
+ trap \"exit 0\" USR1; \
+ trap \"exit 1\" USR2; \
+ while true; do sleep 1; done'"
+ #+END_SRC
+
+ This leads to a delay of up to a second. The delay can be shortened
+ by replacing ~sleep 1~ with ~sleep 0.01~, or if your implementation does
+ not support floats, then by using ~nanosleep 0.01~ instead.
** Using With-Editor commands
diff --git a/with-editor.texi b/with-editor.texi
index 66e8d64..93fd6b3 100644
--- a/with-editor.texi
+++ b/with-editor.texi
@@ -166,7 +166,26 @@ which a process filter listens for such requests. As such
it is
not a complete substitute for a proper Emacsclient, it can only
be used as @code{$EDITOR} of child process of the current Emacs instance.
-It is unlikely that you should ever have to customize this option.
+Some shells do not execute traps immediately when waiting for a
+child process, but by default we do use such a blocking child
+process.
+
+If you use such a shell (e.g. @code{csh} on FreeBSD, but not Debian), then
+you have to edit this option. You can either replace @code{sh} with
@code{bash}
+(and install that), or you can use the older, less performant
+implementation:
+
+@lisp
+"sh -c '\
+echo \"WITH-EDITOR: $$ OPEN $0\"; \
+trap \"exit 0\" USR1; \
+trap \"exit 1\" USR2; \
+while true; do sleep 1; done'"
+@end lisp
+
+This leads to a delay of up to a second. The delay can be shortened
+by replacing @code{sleep 1} with @code{sleep 0.01}, or if your implementation
does
+not support floats, then by using @code{nanosleep 0.01} instead.
@end defopt
@node Using With-Editor commands
- [nongnu] elpa/with-editor 19716e9 007/140: remove with-editor.info, (continued)
- [nongnu] elpa/with-editor 19716e9 007/140: remove with-editor.info, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ecff6bb 019/140: with-editor-file-name-history-exclude: new variable, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 4929d43 015/140: release version 2.5.2, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 650e0ad 025/140: manual: include sub-minor part of version in subtitle, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 7b6ac3a 026/140: base the Makefile on the same template used for other packages, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor d28d074 008/140: regenerate manual after updating org and ox-texinfo+, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor f602113 014/140: make: add bump-versions target, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor aaaeb98 022/140: prefer debianized binary name, if available, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor fb1e10a 030/140: Ignore /dir, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 1126035 004/140: Add remaps for common evil commands, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 5bb0b8a 012/140: with-editor-sleeping-editor: document csh complications,
Jonas Bernoulli <=
- [nongnu] elpa/with-editor 15b2565 013/140: AUTHORS.md: update list of contributors, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 19201be 021/140: with-editor-locate-emacsclient-1: look for yet another suffix, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor c05420c 020/140: don't use pcase-dolist, not all supported Emacsen have it, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor de4022e 018/140: stop directing users to the issue tracker of magit, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ee41302 029/140: manual: minor improvements and typo fixes, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 2248a63 031/140: bump version, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor eb00831 033/140: with-editor-debug: add link to manual to doc-string, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 9fc0477 040/140: with-editor-output-filter: don't use tramp-make-tramp-file-name, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor ae405e9 052/140: with-editor-export-editor: remove unnecessary leftovers, Jonas Bernoulli, 2021/08/06
- [nongnu] elpa/with-editor 216ee34 056/140: Build on Travis, Jonas Bernoulli, 2021/08/06