bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19410: [PATCH] bug#19391: 25.0.50; eshell-buffer-shorthand breaks co


From: samer
Subject: bug#19410: [PATCH] bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion
Date: Fri, 19 Dec 2014 03:31:12 -0800
User-agent: Roundcube Webmail/0.9.5

The issue is that the subcommand requests a target for the symbol 'eshell-temp', but eshell-get-target returns the point marker for a buffer named 'eshell-temp' instead of setting 'eshell-temp's value to nil and returning the symbol. That's because eshell-get-target can't tell the difference between a symbol and a buffer when eshell-buffer-shorthand is set, so it assumes that every symbol is a buffer.

We could treat 'eshell-temp' similarly to 't and 'nil by ignoring this branch if the name of the symbol is 'eshell-temp', but I'm 90% sure that eshell-buffer-shorthand doesn't work anyways and it's probably better to remove it (notice that the examples in the docstring for eshell-buffer-shorthand don't work).

Also, I've submitted a patch for the issue regarding external subcommands having no output on bug #12680.

Best,
Samer

Patch below:

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@samertm.com>
+
+       * eshell/esh-io.el (eshell-get-target, eshell-buffer-shorthand):
+       Remove eshell-buffer-shorthand (bug#19391).
+
 2014-11-28  Martin Rudalics  <rudalics@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)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]