all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Tobias Zawada <i_inbox@tn-home.de>
Cc: 27954@debbugs.gnu.org
Subject: bug#27954: 25.2; eshell alias: arguments get lost
Date: Thu, 10 Aug 2017 22:22:03 -0400	[thread overview]
Message-ID: <87tw1e269g.fsf@users.sourceforge.net> (raw)
In-Reply-To: <1361672640.232249.1501833141832@email.1und1.de> (Tobias Zawada's message of "Fri, 4 Aug 2017 09:52:21 +0200 (CEST)")

[-- 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


  reply	other threads:[~2017-08-11  2:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04  7:52 bug#27954: 25.2; eshell alias: arguments get lost Tobias Zawada
2017-08-11  2:22 ` npostavs [this message]
2017-08-19  2:30   ` npostavs

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=87tw1e269g.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=27954@debbugs.gnu.org \
    --cc=i_inbox@tn-home.de \
    /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.