[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66458: 30.0.50; [PATCH] Improve Eshell support for special reference
From: |
Jim Porter |
Subject: |
bug#66458: 30.0.50; [PATCH] Improve Eshell support for special reference types |
Date: |
Tue, 10 Oct 2023 17:47:52 -0700 |
X-Debbugs-Cc: monnier@iro.umontreal.ca
(Stefan, I added some fairly-tricky calls to Pcomplete in the second
patch - see 'eshell-complete-special-reference' - so let me know if you
have any thoughts on that code.)
These patches do a few things to improve how Eshell's special references
work (these are ways of typing out special Lisp objects like buffers or
processes, e.g. "#<buffer FOO>").
First, this resolves an edge case where the arguments to a special
reference weren't parsed as regular Eshell arguments. That meant that
you couldn't do things like "#<buffer $some-variable>". This does
introduce one very minor incompatible edge case though. Previously, to
refer to a buffer named " foo" (note the leading space), you could type
"#<buffer foo>" (note the two spaces). Now, you'd need to do something
like "#<buffer ' foo'>". I think this is super unlikely to occur in
practice though, and (in my opinion) makes it a lot more obvious how to
refer to these buffers in Eshell anyway.
Second, this makes it possible to (relatively) easily add new special
reference types. In this patch, I also reworked how special refs use
Pcomplete. This lets us write Pcomplete functions for any special ref
type, so we can do the usual '(pcomplete-here ...)' magic in them.
Stefan, if you have any comments on this, I'm all ears. The code works
in all the cases I can think of, but maybe there are cleaner ways to do
things.
Finally, I added a new, hopefully-useful special ref type: markers.
Since Eshell lets you redirect output of commands to a marker, I think
this would make it easier to create these on-the-fly. It also helps to
stress-test some of the new code here, since a marker ref can contain a
nested buffer ref: "#<marker 1 #<buffer my-buffer>>".
0001-Support-arbitrary-Eshell-arguments-inside-special-re.patch
Description: Text document
0002-Add-eshell-special-ref-alist-to-allow-extending-Eshe.patch
Description: Text document
0003-Add-a-new-Eshell-special-reference-type-for-markers.patch
Description: Text document
- bug#66458: 30.0.50; [PATCH] Improve Eshell support for special reference types,
Jim Porter <=