GNU bug report logs -
#66458
30.0.50; [PATCH] Improve Eshell support for special reference types
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Wed, 11 Oct 2023 00:49:02 UTC
Severity: wishlist
Tags: patch
Found in version 30.0.50
Fixed in version 30.1
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#66458: 30.0.50; [PATCH] Improve Eshell support for special reference types
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 66458 <at> debbugs.gnu.org.
--
66458: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66458
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Version: 30.1
On 10/10/2023 5:47 PM, Jim Porter wrote:
> 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>").
Merged to master as 64aa01f60ad. Closing this now.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
X-Debbugs-Cc: monnier <at> 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 (text/plain, attachment)]
[0002-Add-eshell-special-ref-alist-to-allow-extending-Eshe.patch (text/plain, attachment)]
[0003-Add-a-new-Eshell-special-reference-type-for-markers.patch (text/plain, attachment)]
This bug report was last modified 1 year and 208 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.