From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#27954: 25.2; eshell alias: arguments get lost Date: Thu, 10 Aug 2017 22:22:03 -0400 Message-ID: <87tw1e269g.fsf@users.sourceforge.net> References: <1361672640.232249.1501833141832@email.1und1.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1502418075 16295 195.159.176.226 (11 Aug 2017 02:21:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 Aug 2017 02:21:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 27954@debbugs.gnu.org To: Tobias Zawada Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 11 04:21:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfzZW-0003xd-CR for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Aug 2017 04:21:10 +0200 Original-Received: from localhost ([::1]:47418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfzZc-0008V2-Ib for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Aug 2017 22:21:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfzZU-0008Tq-D1 for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2017 22:21:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfzZP-0005BO-Cx for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2017 22:21:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46280) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfzZP-0005B9-8w for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2017 22:21:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dfzZN-0003Z2-Ty for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2017 22:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Aug 2017 02:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27954 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27954-submit@debbugs.gnu.org id=B27954.150241803913660 (code B ref 27954); Fri, 11 Aug 2017 02:21:01 +0000 Original-Received: (at 27954) by debbugs.gnu.org; 11 Aug 2017 02:20:39 +0000 Original-Received: from localhost ([127.0.0.1]:54961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfzZ0-0003YG-Ov for submit@debbugs.gnu.org; Thu, 10 Aug 2017 22:20:39 -0400 Original-Received: from mail-it0-f67.google.com ([209.85.214.67]:33878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfzYu-0003Xg-1j; Thu, 10 Aug 2017 22:20:33 -0400 Original-Received: by mail-it0-f67.google.com with SMTP id t78so2868401ita.1; Thu, 10 Aug 2017 19:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=01lsmQvMvdzLoB/iVFVUoZXUDDf5zVedxNONlGO9RKs=; b=e7JlpZT0drJhG7a14jTY4rtmNNzNDBb8NLW5KLSNSqrOFO96LeXuuBGK0J3F8Me3tq 7Jl6iJ1h8kOMiPOIGAjgPyGKY9UETDgf/PfVJx3L3d5aqpXCwk5xLelYWGxd6MZapvDF vomqWaOO/h+Gv6d9h44sv8xMe10ZwprpNy3uS9BifNhiJjVMfH3Bau13sv/4Vvj3FEZk g0UiJP4RcAvfBUPURrVlXgZy9alol7GBtLS71Iw7H51o9wOYRRa9ApfoOw257Hvj7ada PgOIpRxDMAyGlDig00EoexXayrWyjuyNi6ApJ7uxQy/HG1TtTmMDd1Gg9twFoL/Fqfw+ yTig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=01lsmQvMvdzLoB/iVFVUoZXUDDf5zVedxNONlGO9RKs=; b=cBE/Clig4s5b/K283UuL/CtbIF7L3nkhrIYiBwSYAWvc+3Wg/aSBW20p+FhRSqcqjj VlmQ8wBG+2DZiR3+8eBWBFPNat7+S73H1blLkuoZSvkUtKVro+vNN8VeTswFvuIdJ3jj OHXnJ4hWUVaS38thZIr/88w4ZT3Cls7v3Jv4tmr9jUZhiGIajpGE2+NLGGBia6ZHeRhg fMExFRf1V4GVZUo+98yelns4IBj3o2LBg4tOmAsj6v8gsRqo/ufugwRNUg179KYDPtCJ QojV6YODfWtA2/64WgWGp1SUkv3bFB3eBeOmC7KGQrNZ5Klt1L4ALqzv/UyKiiSo/Igx vLtg== X-Gm-Message-State: AIVw110rMbBE0JldFx+Lsi+h3smxK4NLKcbQqutVfPPKEZj51pGJJj5y DLypWgVRrFWDLzH7 X-Received: by 10.36.134.5 with SMTP id u5mr14012514itd.73.1502418026201; Thu, 10 Aug 2017 19:20:26 -0700 (PDT) Original-Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id e92sm7489033itd.0.2017.08.10.19.20.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Aug 2017 19:20:25 -0700 (PDT) In-Reply-To: <1361672640.232249.1501833141832@email.1und1.de> (Tobias Zawada's message of "Fri, 4 Aug 2017 09:52:21 +0200 (CEST)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135640 Archived-At: --=-=-= Content-Type: text/plain tags 27954 + patch quit Tobias Zawada 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? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Don-t-lose-arguments-to-eshell-aliases-Bug-27954.patch Content-Description: patch >From fe2f8c4ce36a0775faedb1d7d4e9cbffec96f4cb Mon Sep 17 00:00:00 2001 From: Noam Postavsky 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 --=-=-=--