From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Samer Masterson <nosefrog@gmail.com>
Cc: 18960@debbugs.gnu.org, Emanuel Evans <emanuel.evans@gmail.com>
Subject: bug#18960: 24.4; Eshell history substitution causes error
Date: Tue, 09 Dec 2014 17:16:21 -0500 [thread overview]
Message-ID: <jwvppbslbhc.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAP6_t8g1_jwab+-tb6LFyrR2DRG-z-DGtv9=t4=b-KEw+SMk5Q@mail.gmail.com> (Samer Masterson's message of "Mon, 8 Dec 2014 03:54:46 -0800")
> 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
next prev parent reply other threads:[~2014-12-09 22:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-05 19:45 bug#18960: 24.4; Eshell history substitution causes error Emanuel Evans
2014-12-08 11:54 ` Samer Masterson
2014-12-09 22:16 ` Stefan Monnier [this message]
[not found] ` <CAP6_t8j6xtzurbz3S5+CTKu9eM+fxDXXZvuPhRvnBBaAt=bJWg@mail.gmail.com>
2014-12-09 22:49 ` bug#18960: Fwd: " Samer Masterson
2014-12-10 12:51 ` Samer Masterson
2015-02-24 10:47 ` Samer Masterson
2015-02-24 19:04 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvppbslbhc.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=18960@debbugs.gnu.org \
--cc=emanuel.evans@gmail.com \
--cc=nosefrog@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.