[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#28568: 26.0.60; [eshell] Incompatible change in alias argument handl
From: |
Noam Postavsky |
Subject: |
bug#28568: 26.0.60; [eshell] Incompatible change in alias argument handling |
Date: |
Sat, 23 Sep 2017 09:21:47 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) |
> Jay Kamat <jaygkamat@gmail.com> writes:
>
>> It seems that the fix to
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27954 (commit
>> e66e81679c3c91d6bf8f62c7abcd968430b4d1fe) caused this issue. I had an
>> eshell alias defined as
>>
>> alias sudo eshell/sudo $*
>>
>> Which seems to no longer work (with the error described).
Right. The problem is that the arguments are now getting submitted twice.
sudo ls -> {{eshell/sudo $*}} ls -> eshell/sudo ls ls
I'm thinking we should probably revert the fix for Bug#27954; the
comments at the top of em-alias.el explicitly say using '$*' (and '$1',
'$2') in the alias definition is the supported way to handle arguments.
;;;_* Creating aliases
;;
;; The user interface is simple: type 'alias' followed by the command
;; name followed by the definition. Argument references are made
;; using '$1', '$2', etc., or '$*'. For example:
;;
;; alias ll 'ls -l $*'
;;
;; This will cause the command 'll NEWS' to be replaced by 'ls -l
;; NEWS'. This is then passed back to the command parser for
;; reparsing.{Only the command text specified in the alias definition
;; will be reparsed. Argument references (such as '$*') are handled
;; using variable values, which means that the expansion will not be
;; reparsed, but used directly.}
The manual is a bit inconsistent about it, with `(eshell) Built-ins'
suggesting
alias sudo '*sudo $*'
and `(eshell) Aliases' suggesting
alias ll ls -l
I think this just means we should correct the `(eshell) Aliases' page.
Michael Albinus <michael.albinus@gmx.de> writes:
> There's also bug#28320, which seems to report the same problem.
No, that is a different problem, I've opened a new bug for this one.