unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27954: 25.2; eshell alias: arguments get lost
@ 2017-08-04  7:52 Tobias Zawada
  2017-08-11  2:22 ` npostavs
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Zawada @ 2017-08-04  7:52 UTC (permalink / raw)
  To: 27954

[-- Attachment #1: Type: text/html, Size: 32028 bytes --]

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

* bug#27954: 25.2; eshell alias: arguments get lost
  2017-08-04  7:52 bug#27954: 25.2; eshell alias: arguments get lost Tobias Zawada
@ 2017-08-11  2:22 ` npostavs
  2017-08-19  2:30   ` npostavs
  0 siblings, 1 reply; 3+ messages in thread
From: npostavs @ 2017-08-11  2:22 UTC (permalink / raw)
  To: Tobias Zawada; +Cc: 27954

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

tags 27954 + patch
quit

Tobias Zawada <i_inbox@tn-home.de> writes:

> In eshell:
>
> alias ll ls -l
>
> gives a full listing of all files as result of the following eshell-command:
>
> ll test.txt
>
> But, I expect only the listing for the file test.txt.
>
> At that link location there is also the following fast hack as workaround:
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;; beginning of hack
>
> (defun eshell-maybe-replace-by-alias-bugfix-25.2.1 (command args)
> "If COMMAND has an alias definition, call that instead using ARGS."
> (unless (and eshell-prevent-alias-expansion
> (member command eshell-prevent-alias-expansion))
> (let ((alias (eshell-lookup-alias command)))
> (if alias
> (throw 'eshell-replace-command
> `(let ((eshell-command-name ',eshell-last-command-name)
> (eshell-command-arguments ',eshell-last-arguments)
> (eshell-prevent-alias-expansion
> ',(cons command eshell-prevent-alias-expansion)))
> ,(eshell-parse-command (nth 1 alias) args)))))))
>
> (advice-add #'eshell-maybe-replace-by-alias :override #'eshell-maybe-replace-by-alias-bugfix-25.2.1)

So this really just a case not ignoring ARGS, right?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1026 bytes --]

From fe2f8c4ce36a0775faedb1d7d4e9cbffec96f4cb Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Mon, 7 Aug 2017 08:56:42 -0400
Subject: [PATCH v1] Don't lose arguments to eshell aliases (Bug#27954)

* lisp/eshell/em-alias.el (eshell-maybe-replace-by-alias): Use ARGS.
---
 lisp/eshell/em-alias.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el
index 5bf80b2310..990eb02024 100644
--- a/lisp/eshell/em-alias.el
+++ b/lisp/eshell/em-alias.el
@@ -225,7 +225,7 @@ eshell-maybe-replace-by-alias
                         (eshell-command-arguments ',eshell-last-arguments)
                         (eshell-prevent-alias-expansion
                          ',(cons command eshell-prevent-alias-expansion)))
-                    ,(eshell-parse-command (nth 1 alias))))))))
+                    ,(eshell-parse-command (nth 1 alias) args)))))))
 
 (defun eshell-alias-completions (name)
   "Find all possible completions for NAME.
-- 
2.11.1


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

* bug#27954: 25.2; eshell alias: arguments get lost
  2017-08-11  2:22 ` npostavs
@ 2017-08-19  2:30   ` npostavs
  0 siblings, 0 replies; 3+ messages in thread
From: npostavs @ 2017-08-19  2:30 UTC (permalink / raw)
  To: Tobias Zawada; +Cc: 27954

tags 27954 fixed
close 27954 26.1
quit

npostavs@users.sourceforge.net writes:

> So this really just a case not ignoring ARGS, right?

Pushed to master.

[1: e66e81679c]: 2017-08-18 22:29:36 -0400
  Don't lose arguments to eshell aliases (Bug#27954)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e66e81679c3c91d6bf8f62c7abcd968430b4d1fe





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

end of thread, other threads:[~2017-08-19  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-04  7:52 bug#27954: 25.2; eshell alias: arguments get lost Tobias Zawada
2017-08-11  2:22 ` npostavs
2017-08-19  2:30   ` npostavs

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