|author||Sean Whitton <firstname.lastname@example.org>||2022-04-21 13:42:06 -0700|
|committer||Sean Whitton <email@example.com>||2022-04-21 13:43:12 -0700|
new blog entry
Diffstat (limited to 'blog/entry/apr22emacs.mdwn')
1 files changed, 61 insertions, 0 deletions
diff --git a/blog/entry/apr22emacs.mdwn b/blog/entry/apr22emacs.mdwn
new file mode 100644
@@ -0,0 +1,61 @@
+[[!meta title="Recent additions I've made to GNU Emacs"]]
+[[!tag tech Emacs]]
+Here are a few new features I've added to upstream GNU Emacs recently. Text
+is adapted from the in-tree documentation I wrote for the new features.
+Thanks to everyone who offered feedback on my patches.
+# New feature to easily bypass Eshell's own pipelining
+Prefixing `|`, `<` or `>` with an asterisk, i.e. `*|`, `*<` or `*>`, will
+cause the whole command to be passed to the operating system shell. This is
+particularly useful to bypass Eshell's own pipelining support for pipelines
+which will move a lot of data.
+This has long been an obstacle when it comes to using Eshell as one's main
+shell. The new syntax is easy to use and covers a lot of different use cases.
+# New Eshell module to help supplying absolute file names to remote commands
+After enabling the new `eshell-elecslash` module, typing a forward slash as
+the first character of a command line argument will automatically insert the
+Tramp prefix. The automatic insertion applies only when `default-directory`
+is remote and the command is a Lisp function. This frees you from having to
+keep track of whether commands are Lisp function or external when supplying
+absolute file name arguments.
+This is another attempt to solve an Eshell papercut. Suppose you execute
+ cd /ssh:root@@example.com:
+ find /etc -name "*gnu*"
+and in reviewing the output of the command, you identify a file `/etc/gnugnu`
+that should be moved somewhere else. So you type
+ mv /etc/gnugnu /tmp
+But since `mv` refers to the local Lisp function `eshell/mv`, not a remote
+shell command (unlike find(1)), to say this is to request that the local file
+`/etc/gnugnu` be moved into the local `/tmp` directory. After you enable
+`eshell-elecslash`, to then when you type the above `mv` invocation you will
+get the following input, which is what you intended:
+ mv /ssh:firstname.lastname@example.org:/etc/gnugnu /ssh:email@example.com:/tmp
+# `imenu` is now bound to `M-g i` globally
+This is a useful command but everyone has to come up with their own binding
+for it. No longer.
+# New macro-writing macros, `cl-with-gensyms` and `cl-once-only`
+These two macros are quite interesting. In the history of Common Lisp-style
+macros, these are the only two macro-writing macros that have emerged as
+essential tools for intermediate and advanced macrology. Most any other
+macro-writing macros are either project- or programmer-specific. In his book
+on Lisp macros [Doug Hoyte
+proposes](https://letoverlambda.com/index.cl/guest/chap3.html) an alternative
+to `defmacro`, `defmacro!`, which is just the same as `defmacro` except that
+it builds in a facilty equivalent to `cl-with-gensyms` and `cl-once-only`.
+I've long wanted to have these macros available in core Emacs Lisp, too, and
+now they are.