GNU bug report logs -
#19391
25.0.50; eshell-buffer-shorthand breaks command dollar expansion
Previous Next
Reported by: dylan <at> hardison.net
Date: Tue, 16 Dec 2014 04:41:01 UTC
Severity: normal
Tags: fixed, patch
Merged with 19410
Found in version 25.0.50
Fixed in version 25.1
Done: Noam Postavsky <npostavs <at> users.sourceforge.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19391 in the body.
You can then email your comments to 19391 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19391
; Package
emacs
.
(Tue, 16 Dec 2014 04:41:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
dylan <at> hardison.net
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 16 Dec 2014 04:41:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Soemthing is wrong with dollar expansion on commands (${foo}).
It seems to break if eshell-buffer-shorthand on,
and also ${command} when command is a shell command seems to get lost...
M-x eshell RET
~ $ (setq eshell-buffer-shorthand t)
t
~ $ echo ${uptime}
Symbol's value as variable is void: eshell-temp
~ $ echo ${emacs-uptime}
Symbol's value as variable is void: eshell-temp
~ $ (setq eshell-buffer-shorthand nil)
nil
~ $ echo ${uptime}
# no output!
~ $ echo ${emacs-uptime}
4 minutes, 39 seconds
In GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5)
of 2014-12-15 on thor
Repository revision: 872617ad730906f9437b90c3b90af2e2458f00f6
Windowing system distributor `The X.Org Foundation', version 11.0.11602000
Configured using:
`configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
--localstatedir=/var --mandir=/usr/share/man
--pdfdir=/usr/share/doc/emacs/pdf --with-sound=alsa --without-gconf
--with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64 -mtune=generic
-O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4'
CPPFLAGS=-D_FORTIFY_SOURCE=2
LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
Important settings:
value of $LC_COLLATE: POSIX
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: EShell
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
Recent messages:
Loading em-unix...done
History item: 17
History item: 16
History item: 15
History item: 14
History item: 13
History item: 12
delete-backward-char: Text is read-only
Sole completion
Partially completed
Load-path shadows:
None found.
Features:
(shadow sort gnus-util mail-extr emacsbug message idna dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils em-unix em-term term disp-table
easymenu ehelp em-script em-prompt em-ls cl-loaddefs cl-lib em-hist
em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias pcomplete
comint ansi-color ring esh-var esh-io esh-cmd esh-opt esh-ext esh-proc
esh-arg esh-groups eshell esh-module esh-mode esh-util time-date tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button
faces cus-face macroexp files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind gfilenotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)
Memory information:
((conses 16 95819 8904)
(symbols 48 20003 0)
(miscs 40 99 168)
(strings 32 17152 4610)
(string-bytes 1 527657)
(vectors 16 12478)
(vector-slots 8 417838 5964)
(floats 8 77 97)
(intervals 56 322 11)
(buffers 976 14)
(heap 1024 43589 956))
Merged 19391 19410.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Fri, 19 Dec 2014 16:59:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19391
; Package
emacs
.
(Tue, 24 Feb 2015 11:01:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 19391 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi,
My copyright papers have been processed. Can we apply this to master?
Best,
Samer
2 files changed, 17 insertions(+), 28 deletions(-)
lisp/ChangeLog | 10 ++++++++++
lisp/eshell/esh-io.el | 35 +++++++----------------------------
Modified lisp/ChangeLog
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 45ba279..9aec808 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2014-12-19 Samer Masterson <samer <at> samertm.com>
+
+ * eshell/esh-io.el (eshell-get-target, eshell-buffer-shorthand):
+ Remove eshell-buffer-shorthand (bug#19391).
+
2014-11-28 Martin Rudalics <rudalics <at> gmx.at>
Fix two issues around help-window-select. (Bug#11039) (Bug#19012)
Modified lisp/eshell/esh-io.el
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index ebbca58..3f70f48 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -98,19 +98,6 @@ other buffers) ."
:type 'integer
:group 'eshell-io)
-(defcustom eshell-buffer-shorthand nil
- "If non-nil, a symbol name can be used for a buffer in redirection.
-If nil, redirecting to a buffer requires buffer name syntax. If this
-variable is set, redirection directly to Lisp symbols will be
-impossible.
-
-Example:
-
- echo hello > '*scratch* ; works if `eshell-buffer-shorthand' is t
- echo hello > #<buffer *scratch*> ; always works"
- :type 'boolean
- :group 'eshell-io)
-
(defcustom eshell-print-queue-size 5
"The size of the print queue, for doing buffered printing.
This is basically a speed enhancement, to avoid blocking the Lisp code
@@ -355,21 +342,13 @@ it defaults to `insert'."
(goto-char (point-max))))
(point-marker))))))
- ((or (bufferp target)
- (and (boundp 'eshell-buffer-shorthand)
- (symbol-value 'eshell-buffer-shorthand)
- (symbolp target)
- (not (memq target '(t nil)))))
- (let ((buf (if (bufferp target)
- target
- (get-buffer-create
- (symbol-name target)))))
- (with-current-buffer buf
- (cond ((eq mode 'overwrite)
- (erase-buffer))
- ((eq mode 'append)
- (goto-char (point-max))))
- (point-marker))))
+ ((bufferp target)
+ (with-current-buffer target
+ (cond ((eq mode 'overwrite)
+ (erase-buffer))
+ ((eq mode 'append)
+ (goto-char (point-max))))
+ (point-marker)))
((functionp target) nil)
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19391
; Package
emacs
.
(Tue, 03 Mar 2015 15:57:01 GMT)
Full text and
rfc822 format available.
Message #13 received at 19391 <at> debbugs.gnu.org (full text, mbox):
> Date: Tue, 24 Feb 2015 02:59:46 -0800
> From: Samer Masterson <samer <at> samertm.com>
>
> Modified lisp/ChangeLog
> diff --git a/lisp/ChangeLog b/lisp/ChangeLog
> index 45ba279..9aec808 100644
> --- a/lisp/ChangeLog
> +++ b/lisp/ChangeLog
> @@ -1,3 +1,13 @@
> +2014-12-19 Samer Masterson <samer <at> samertm.com>
> +
> + * eshell/esh-io.el (eshell-get-target, eshell-buffer-shorthand):
> + Remove eshell-buffer-shorthand (bug#19391).
Can you explain why we should lose this user option? I understand
that it causes trouble in this scenario, but can we solve the bug
without losing the option? If not, why having the limitation
documented in the doc string is not good enough?
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19391
; Package
emacs
.
(Wed, 04 Mar 2015 07:51:01 GMT)
Full text and
rfc822 format available.
Message #16 received at 19391 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Tue, Mar 3, 2015 at 7:56 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> Can you explain why we should lose this user option? I understand
> that it causes trouble in this scenario, but can we solve the bug
> without losing the option? If not, why having the limitation
> documented in the doc string is not good enough?
>
> Thanks.
I think the strongest reason for losing the option is that it currently
doesn't work: If you type "echo hello > '*scratch" into eshell and
press enter, eshell adds a newline without evaluating the command
because it thinks it's in a string because of the unmatched single
quote. Its implementation also makes eshell more complex, because
eshell-get-target *only* checks for symbols if the option is selected,
and then gets-or-creates a buffer with the symbol name.
I think having a shorthand for buffers in eshell is a good thing, but
it should be different in three ways:
- The syntax for the shorthand should be distinct from any other lisp
objects, so that we don't have to put out fires when people try to do
things that are valid but overlap with the shorthand (e.g. this bug was
caused by eshell's external shell feature redirecting to a symbol.)
Something like #<name-of-buffer> would work.
- The shorthand should be processed as a buffer (similar to how
#<buffer name-of-buffer> is processed). That means the shorthand won't
require extra code anywhere except for the reader.
- The shorthand should be on by default, and probably shouldn't have
an option to disable it. The reason for this is that the shorthand
would be universally beneficial and backwards compatible, and making it
controlled by an option is inviting bugs when we shouldn't be.
Let me know what you think of the above, and I can add more detail to
the proposal and submit it to emacs-devel.
Best,
Samer
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19391
; Package
emacs
.
(Wed, 04 Mar 2015 17:29:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 19391 <at> debbugs.gnu.org (full text, mbox):
> Date: Tue, 03 Mar 2015 23:50:34 -0800
> From: Samer Masterson <samer <at> samertm.com>
> Cc: 19391 <at> debbugs.gnu.org
>
> On Tue, Mar 3, 2015 at 7:56 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> Can you explain why we should lose this user option? I understand that it
> causes trouble in this scenario, but can we solve the bug without losing
> the option? If not, why having the limitation documented in the doc string
> is not good enough? Thanks.
>
> I think the strongest reason for losing the option is that it currently doesn't
> work: If you type "echo hello > '*scratch" into eshell and press enter, eshell
> adds a newline without evaluating the command because it thinks it's in a
> string because of the unmatched single quote. Its implementation also makes
> eshell more complex, because eshell-get-target *only* checks for symbols if the
> option is selected, and then gets-or-creates a buffer with the symbol name.
>
> I think having a shorthand for buffers in eshell is a good thing, but it should
> be different in three ways:
If you are saying that redesigning eshell-buffer-shorthand would
resolve this bug without losing the option, then I agree it's a better
way. I don't know about Eshell enough to judge whether your
suggestion won't run into problems, though, so I indeed think it's
best to post it to emacs-devel.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19391
; Package
emacs
.
(Mon, 27 Nov 2017 02:43:01 GMT)
Full text and
rfc822 format available.
Message #22 received at 19391 <at> debbugs.gnu.org (full text, mbox):
tags 19391 fixed
close 19391 25.1
quit
Samer Masterson <samer <at> samertm.com> writes:
> - The syntax for the shorthand should be distinct from any other
> lisp objects, so that we don't have to put out fires when people try
> to do things that are valid but overlap with the shorthand (e.g. this
> bug was caused by eshell's external shell feature redirecting to a
> symbol.) Something like #<name-of-buffer> would work.
> - The shorthand should be processed as a buffer (similar to how #
> <buffer name-of-buffer> is processed). That means the shorthand won't
> require extra code anywhere except for the reader.
> - The shorthand should be on by default, and probably shouldn't have
> an option to disable it. The reason for this is that the shorthand
> would be universally beneficial and backwards compatible, and making
> it controlled by an option is inviting bugs when we shouldn't be.
Something along these lines was pushed for Emacs 25.
[1: e37da5a4a8]: 2015-05-17 14:28:51 -0700
eshell: Introduce new buffer syntax
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e37da5a4a8055826f0fc1051083495a828509672>
Added tag(s) fixed.
Request was from
Noam Postavsky <npostavs <at> users.sourceforge.net>
to
control <at> debbugs.gnu.org
.
(Mon, 27 Nov 2017 02:43:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 25.1, send any further explanations to
19391 <at> debbugs.gnu.org and dylan <at> hardison.net
Request was from
Noam Postavsky <npostavs <at> users.sourceforge.net>
to
control <at> debbugs.gnu.org
.
(Mon, 27 Nov 2017 02:43:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 25 Dec 2017 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 256 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.