GNU bug report logs -
#18960
24.4; Eshell history substitution causes error
Previous Next
Reported by: Emanuel Evans <emanuel.evans <at> gmail.com>
Date: Wed, 5 Nov 2014 19:46:02 UTC
Severity: normal
Found in version 24.4
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Modified lisp/eshell/em-hist.el
> diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
> index b721b5d..e7e9a1e 100644
> --- a/lisp/eshell/em-hist.el
> +++ b/lisp/eshell/em-hist.el
> @@ -724,7 +724,7 @@ matched."
> (setq nth (eshell-hist-word-reference nth)))
> (unless (numberp mth)
> (setq mth (eshell-hist-word-reference mth)))
> - (cons (mapconcat 'identity (eshell-sublist textargs nth mth) "")
> + (cons (mapconcat 'identity (eshell-sublist textargs nth mth) " ")
> end))))
Can you explain why this is needed?
> @@ -737,7 +737,7 @@ matched."
> (goto-char (point-min))
> (let ((modifiers (cdr (eshell-parse-modifiers))))
> (dolist (mod modifiers)
> - (setq hist (funcall mod hist)))
> + (setq hist (car (funcall mod (list hist)))))
> hist))
> (delete-region here (point)))))
The docstring of eshell-parse-modifiers says:
Parse value modifiers and predicates at point.
If ALLOW-PREDS is non-nil, predicates will be parsed as well.
Return a cons cell of the form
(PRED-FUNC-LIST . MOD-FUNC-LIST)
NEW-STRING is STRING minus any modifiers. PRED-FUNC-LIST is a list of
predicate functions. MOD-FUNC-LIST is a list of result modifier
functions. PRED-FUNCS take a filename and return t if the test
succeeds; MOD-FUNCS take any string and preform a modification,
returning the resultant string.
If I read this right, `mod' (which is one of MOD-FUNCS) should take
a string and return a string, IIUC. So, maybe the right fix is not to
change this code but to change the functions returned by
`eshell-parse-modifiers'.
Stefan
This bug report was last modified 10 years and 174 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.