GNU bug report logs - #26217
25.2; shell syntax does not know for i do

Previous Next

Package: emacs;

Reported by: Martin Vath <martin <at> mvath.de>

Date: Wed, 22 Mar 2017 11:37:02 UTC

Severity: minor

Tags: confirmed, patch

Merged with 2910, 21244, 30170, 46093, 48193

Found in versions 25.0.95, 25.2

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#48193: closed (Youngsters in charge of emacs vs. basic Bourne
 shell "for" statement)
Date: Sat, 14 Oct 2023 15:03:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 14 Oct 2023 11:01:40 -0400
with message-id <jwvpm1hjljr.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#2910: 23.0.60; Shell-script coloring bug
has caused the debbugs.gnu.org bug report #26217,
regarding Youngsters in charge of emacs vs. basic Bourne shell "for" statement
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
26217: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26217
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Youngsters in charge of emacs vs. basic Bourne shell "for" statement
Date: Mon, 03 May 2021 22:48:16 +0800
for i do
    true
done
    : This line and the whole rest of the program misindented because emacs shallow knowlege of shell grammar.
    : Test with TAB. Emacs only knows about:
    for i
    do
	true
    done
    : If this was python, well, you would have to have the language change to accomidate emacs.
    : Also if we are colaborating on a big project we cannot just rip up line of other peoples code so
    : they are not misindeted for only us.
    : Yes, some emacs programmers do not know shell grammar and just assume... indeed the word "do" on the
    : first line is not even in a different color. But the word in right here in this line is! Three times!
    : Hmmm, [including this part of] the sh language is, maybe 50 years
    : old. Not something checkbashisms --extra --force --posix has an issue with. It is part
    : of sh, bash, dash, ksh, ...
    : I.e., not something invented before emacs...
    : What could be even older? Well, sh must have been written in C...
    : Yes, I reported this before. But it was closed by programmers who
    : do not know basic Bourne shell "for" statement grammar.
    : emacs-version "27.1"

Indeed, I was just reading in RISKS Digest,

> https://www.wired.com/story/ai-latest-trick-writing-computer-code/

> What fun -- being second-guessed in real time by software that doesn't
> understand my code...


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Martin Vath <martin <at> mvath.de>, 2910-done <at> debbugs.gnu.org,
 26217-done <at> debbugs.gnu.org
Subject: Re: bug#2910: 23.0.60; Shell-script coloring bug
Date: Sat, 14 Oct 2023 11:01:40 -0400
>> I haven't found problems, but I'm suspicious because it seems too easy.
> Welcome to the world of Emacs, where "if it's easy it must be right".

BTW, pushed to `master`, thank you.


        Stefan



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

Previous Next


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