[Top][All Lists]

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

bug#29157: 25.3; Eshell parsing fails sometimes, e.g. "date" and "sed"

From: Noam Postavsky
Subject: bug#29157: 25.3; Eshell parsing fails sometimes, e.g. "date" and "sed"
Date: Sun, 05 Nov 2017 08:58:22 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

Pierre Neidhardt <address@hidden> writes:

> - emacs -Q
> - M-x eshell
>       > date +%Z
>       Invalid time specification

    ~/src/emacs $ which date
    eshell/date is an alias for ‘current-time-string’ in ‘em-unix.el’.
    ~/src/emacs $ which *date
    ~/src/emacs $ *date +%Z

>       > echo $PATH | sed "s/[^o]foo[^o]/bar/g"
>       Unknown predicate character ‘b’

M-x toggle-debug-on-error gives more hints about this.  Apparently this
matches a "history reference":

    (defun eshell-history-reference (reference)
      "Expand directory stack REFERENCE.
    The syntax used here was taken from the Bash info manual.
    Returns the resultant reference, or the same string REFERENCE if none
      ;; `^string1^string2^'
      ;;      Quick Substitution.  Repeat the last command, replacing
      ;;      STRING1 with STRING2.  Equivalent to `!!:s/string1/string2/'

Debugger entered--Lisp error: (error "Unknown predicate character ‘b’")
  signal(error ("Unknown predicate character ‘b’"))
  error("Unknown predicate character `%c'" 98)
  eshell-hist-parse-modifier("printf '<<%s>>\\n' \"s/[^o]foo/\"" 
  eshell-expand-history-references(#<marker at 43 in *eshell*> 81)
  run-hook-with-args(eshell-expand-history-references #<marker at 43 in 
*eshell*> 81)
  funcall-interactively(eshell-send-input nil)
  call-interactively(eshell-send-input nil nil)

My suggestion for this is just to stop adding
eshell-expand-history-references to eshell-expand-input-functions, and
maybe even deprecate eshell-expand-history-references.  I find the
history expansion mechanism to be an annoyance in bash as well.

--- i/lisp/eshell/em-hist.el
+++ w/lisp/eshell/em-hist.el
@@ -218,9 +218,6 @@ eshell-input-filter-initial-space
 (defun eshell-hist-initialize ()
   "Initialize the history management code for one Eshell buffer."
-  (add-hook 'eshell-expand-input-functions
-           'eshell-expand-history-references nil t)
   (when (eshell-using-module 'eshell-cmpl)
     (add-hook 'pcomplete-try-first-hook
              'eshell-complete-history-reference nil t))

reply via email to

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