GNU bug report logs - #61778
30.0.50; [PATCH] Be more cautious in completing Eshell variable assignments

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Sat, 25 Feb 2023 06:03:01 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61778 in the body.
You can then email your comments to 61778 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#61778; Package emacs. (Sat, 25 Feb 2023 06:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Porter <jporterbugs <at> gmail.com>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Sat, 25 Feb 2023 06:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [PATCH] Be more cautious in completing Eshell variable
 assignments
Date: Fri, 24 Feb 2023 22:02:14 -0800
[Message part 1 (text/plain, inline)]
X-Debbugs-Cc: monnier <at> iro.umontreal.ca

Starting from "emacs -Q":

  M-x shell RET
  tar --directory=<TAB>
  ;; Notice that completions only show directories.

  M-x eshell RET
  tar --directory=<TAB>
  ;; Completions include files *and* directories(!)

After quite a bit of digging, I figured out the issue: Eshell was 
treating "--directory=" as the beginning of a local variable assignment 
(like when you run "CC=gcc make"). The function 
'eshell-complete-variable-assignment' is over-aggressive in identifying 
local variable assignments, and so it picked this up as a false positive.

Attached is a fix for this, plus a regression test.
[0001-Be-more-cautious-in-completing-Eshell-variable-assig.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61778; Package emacs. (Sat, 25 Feb 2023 23:26:02 GMT) Full text and rfc822 format available.

Message #8 received at 61778 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 61778 <at> debbugs.gnu.org
Subject: Re: bug#61778: 30.0.50; [PATCH] Be more cautious in completing
 Eshell variable assignments
Date: Sat, 25 Feb 2023 18:25:06 -0500
> After quite a bit of digging, I figured out the issue: Eshell was treating
>  "--directory=" as the beginning of a local variable assignment (like when
>  you run "CC=gcc make"). The function 'eshell-complete-variable-assignment'
>  is over-aggressive in identifying local variable assignments, and so it
> picked this up as a false positive.
>
> Attached is a fix for this, plus a regression test.

LGTM, thanks,


        Stefan





Reply sent to Jim Porter <jporterbugs <at> gmail.com>:
You have taken responsibility. (Sun, 26 Feb 2023 04:41:03 GMT) Full text and rfc822 format available.

Notification sent to Jim Porter <jporterbugs <at> gmail.com>:
bug acknowledged by developer. (Sun, 26 Feb 2023 04:41:03 GMT) Full text and rfc822 format available.

Message #13 received at 61778-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 61778-done <at> debbugs.gnu.org
Subject: Re: bug#61778: 30.0.50; [PATCH] Be more cautious in completing Eshell
 variable assignments
Date: Sat, 25 Feb 2023 20:40:41 -0800
On 2/25/2023 3:25 PM, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
>> Attached is a fix for this, plus a regression test.
> 
> LGTM, thanks,

Thanks. Pushed as 9565e34762. Closing this now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 26 Mar 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 30 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.