unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion
@ 2014-12-16  4:35 dylan
  2015-02-24 10:59 ` bug#19391: [PATCH] " Samer Masterson
  0 siblings, 1 reply; 6+ messages in thread
From: dylan @ 2014-12-16  4:35 UTC (permalink / raw)
  To: 19391


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))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19391: [PATCH] bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion
  2014-12-16  4:35 bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion dylan
@ 2015-02-24 10:59 ` Samer Masterson
  2015-03-03 15:56   ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Samer Masterson @ 2015-02-24 10:59 UTC (permalink / raw)
  To: 19391

[-- Attachment #1: Type: text/plain, Size: 2371 bytes --]

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)

[-- Attachment #2: Type: text/html, Size: 4809 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#19391: [PATCH] bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion
  2015-02-24 10:59 ` bug#19391: [PATCH] " Samer Masterson
@ 2015-03-03 15:56   ` Eli Zaretskii
  2015-03-04  7:50     ` Samer Masterson
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2015-03-03 15:56 UTC (permalink / raw)
  To: Samer Masterson; +Cc: 19391

> Date: Tue, 24 Feb 2015 02:59:46 -0800
> From: Samer Masterson <samer@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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19391: [PATCH] bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion
  2015-03-03 15:56   ` Eli Zaretskii
@ 2015-03-04  7:50     ` Samer Masterson
  2015-03-04 17:28       ` Eli Zaretskii
  2017-11-27  2:42       ` Noam Postavsky
  0 siblings, 2 replies; 6+ messages in thread
From: Samer Masterson @ 2015-03-04  7:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 19391

[-- Attachment #1: Type: text/plain, Size: 1837 bytes --]

On Tue, Mar 3, 2015 at 7:56 AM, Eli Zaretskii <eliz@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

[-- Attachment #2: Type: text/html, Size: 2073 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19391: [PATCH] bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion
  2015-03-04  7:50     ` Samer Masterson
@ 2015-03-04 17:28       ` Eli Zaretskii
  2017-11-27  2:42       ` Noam Postavsky
  1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2015-03-04 17:28 UTC (permalink / raw)
  To: Samer Masterson; +Cc: 19391

> Date: Tue, 03 Mar 2015 23:50:34 -0800
> From: Samer Masterson <samer@samertm.com>
> Cc: 19391@debbugs.gnu.org
> 
> On Tue, Mar 3, 2015 at 7:56 AM, Eli Zaretskii <eliz@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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19391: [PATCH] bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion
  2015-03-04  7:50     ` Samer Masterson
  2015-03-04 17:28       ` Eli Zaretskii
@ 2017-11-27  2:42       ` Noam Postavsky
  1 sibling, 0 replies; 6+ messages in thread
From: Noam Postavsky @ 2017-11-27  2:42 UTC (permalink / raw)
  To: Samer Masterson; +Cc: 19391

tags 19391 fixed
close 19391 25.1
quit

Samer Masterson <samer@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>





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-27  2:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-16  4:35 bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion dylan
2015-02-24 10:59 ` bug#19391: [PATCH] " Samer Masterson
2015-03-03 15:56   ` Eli Zaretskii
2015-03-04  7:50     ` Samer Masterson
2015-03-04 17:28       ` Eli Zaretskii
2017-11-27  2:42       ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).