From unknown Sat Aug 09 05:04:42 2025
X-Loop: help-debbugs@gnu.org
Subject: bug#24838: 26.0.50; Parse error in certain shell scripts
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 31 Oct 2016 15:24:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: report 24838
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: 24838@debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@gnu.org
Received: via spool by submit@debbugs.gnu.org id=B.147792741528455
(code B ref -1); Mon, 31 Oct 2016 15:24:01 +0000
Received: (at submit) by debbugs.gnu.org; 31 Oct 2016 15:23:35 +0000
Received: from localhost ([127.0.0.1]:38194 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1c1EQw-0007Os-N8
for submit@debbugs.gnu.org; Mon, 31 Oct 2016 11:23:35 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58457)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1c1EQu-0007Og-Sn
for submit@debbugs.gnu.org; Mon, 31 Oct 2016 11:23:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1c1EQo-00005r-GN
for submit@debbugs.gnu.org; Mon, 31 Oct 2016 11:23:27 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: *
X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50,
FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled
version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:53724)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
(Exim 4.71) (envelope-from )
id 1c1EQo-00005g-D8
for submit@debbugs.gnu.org; Mon, 31 Oct 2016 11:23:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49418)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1c1EQm-00079S-ST
for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2016 11:23:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1c1EQk-0008Ua-Vz
for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2016 11:23:24 -0400
Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:35536)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from )
id 1c1EQk-0008Tz-OT
for bug-gnu-emacs@gnu.org; Mon, 31 Oct 2016 11:23:22 -0400
Received: by mail-wm0-x22c.google.com with SMTP id a197so26657856wmd.0
for ; Mon, 31 Oct 2016 08:23:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=from:to:subject:date:message-id:mime-version
:content-transfer-encoding;
bh=Yk8rk4cpG1K5AJHXiXDgh5DFrK7+GXho6ouz5rIb6NY=;
b=KHk4CasqW9hhLfQgkki6Fj3p3teW/1I4bXbXOpCiTLvVK65Hfx5PhE0q+s30zg71uo
ZvygSWk1A6RVXokGseCpI4rV9mKQ/10xBQYdLfirO+/qKf3eZWWjF8SJP96IRAmTvTf0
iw7FiP7qziAIiLUXvPILU+LPBY6vNS+6cJsnJqEQFpP+PxKlZWtJiGu5iVzi5diCeaP9
lnM+DLn0I9WqFSQDcxAyTbDK/6chLxnlQ2tAq936F4zuAkJqf9n7X2UamAo3vJeffyXK
FbK2GGreq3IH01igX50hsADx4jz22Uugzm/FZ0kKmu4kLvSaANBYemt/GN+ePmvZEm0x
yjrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:from:to:subject:date:message-id:mime-version
:content-transfer-encoding;
bh=Yk8rk4cpG1K5AJHXiXDgh5DFrK7+GXho6ouz5rIb6NY=;
b=ip5ntjO0BK+rB4ugkDK0TjQ3BYZgcu6FgrcMhiHmqDk+oRLApCfwPWwhVfF/xxYx5u
8WnAl1nxqThk/3rVG/JiErCIj2NtpWQU2Sav8CDlSsAXTEqvLfO8xHsbWWaSFUrMMFxY
iYBC2+4yi/m9ZxrHH6sW+GNOGxGpJSBp8vxksfYL8SERPEoKyPcuA2zmYf4B8pEHNkkn
QPTAuLaIKDNKN8121susMk3NdtbE5Ted8xctU1GN5Uyugas0wlLevC6hF9NNmWPkZhvC
p8mWKbWf1QSZi7MVXM8SweM10XYKZqUudVGQJq2uhLDgsx3Es1KBu3KGRz9NCKER/Bwt
lErw==
X-Gm-Message-State: ABUngvcN+uMMYdfR2PYzjz9NKjc+yONQjV8BGPJd9+LerDGVOwOZYX0N37inrnuLRDNyhw==
X-Received: by 10.28.146.143 with SMTP id u137mr12121793wmd.57.1477927401267;
Mon, 31 Oct 2016 08:23:21 -0700 (PDT)
Received: from a.muc.corp.google.com ([2a00:79e0:15:4:2854:fb86:c9b6:a09d])
by smtp.gmail.com with ESMTPSA id o143sm25328453wmd.7.2016.10.31.08.23.20
for
(version=TLS1_2 cipher=AES128-SHA bits=128/128);
Mon, 31 Oct 2016 08:23:20 -0700 (PDT)
From: Philipp Stephani
Date: Mon, 31 Oct 2016 16:23:16 +0100
Message-ID:
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.8 (---)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit"
X-Spam-Score: -3.8 (---)
Visit the following file in shell-script-mode:
#!/bin/bash
a=3D"
("
if b; then
c
else
d
# '
fi
Now move point inside 'fi', and run M-x show-paren-mode. You'll notice
that the 'fi' is marked as syntax error, and 'if' isn't highlighted,
indicating that the construct wasn't parsed correctly.
Now run C-c ?. This will cause an error "smie-indent-keyword: Wrong
type argument: number-or-marker-p, noindent". The stack trace is
(wrong-type-argument number-or-marker-p noindent)
smie-indent--rule(:before "fi" nil (t 50 "'") 50)
smie-indent-keyword()
run-hook-with-args-until-success(smie-indent-keyword)
smie-indent-calculate()
smie-config--get-trace()
smie-config-show-indent()
sh-show-indent(nil)
funcall-interactively(sh-show-indent nil)
call-interactively(sh-show-indent nil nil)
command-execute(sh-show-indent)
Now hit M-> and hit RET. The indentation now inserted will be
completely off.
My suspicion is that this might be a result of
`open-paren-in-column-0-is-defun-start'. I guess that variable should
be set to nil in shell-script-mode, as parens in column 0 can never
start a function in shell scripts.
In GNU Emacs 26.0.50.14 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
of 2016-10-31 built on locahost
Repository revision: 8e7b1af1d708dcf41695cf3fbeff9d35cdb8e5b6
Windowing system distributor 'The X.Org Foundation', version 11.0.11501000
System Description: Ubuntu 14.04 LTS
Recent messages:
Setting up indent for shell type bash
Indentation variables are now local.
Indentation setup for shell type bash
Error: (wrong-type-argument number-or-marker-p noindent) [3 times]
Show-Paren mode enabled
s-h is undefined
Type C-x 1 to delete the help window, C-M-v to scroll help.
mwheel-scroll: Beginning of buffer [2 times]
Saving file /tmp/aa.sh...
Wrote /tmp/aa.sh
Configured using:
'configure --with-modules --enable-checking
--enable-check-lisp-object-type 'CFLAGS=3D-ggdb3 -O0''
Configured features:
XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Shell-script
Minor modes in effect:
show-paren-mode: t
sh-electric-here-document-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message subr-x puny seq byte-opt gv
bytecomp byte-compile cl-extra cconv dired dired-loaddefs format-spec
rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util
rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils pp wid-edit descr-text help-mode easymenu
cl-loaddefs pcase cl-lib cus-start cus-load paren sh-script smie
executable time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)
Memory information:
((conses 16 201926 10234)
(symbols 48 33043 0)
(miscs 40 361 231)
(strings 32 75698 7320)
(string-bytes 1 1792773)
(vectors 16 16013)
(vector-slots 8 535350 19029)
(floats 8 194 57)
(intervals 56 314 11)
(buffers 976 14)
(heap 1024 50030 1243))
--=20
Google Germany GmbH
Erika-Mann-Stra=C3=9Fe 33
80636 M=C3=BCnchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Gesch=C3=A4ftsf=C3=BChrer: Matthew Scott Sucherman, Paul Terence Manicle
Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind,
leiten Sie diese bitte nicht weiter, informieren Sie den Absender und l=C3=
=B6schen
Sie die E-Mail und alle Anh=C3=A4nge. Vielen Dank.
This e-mail is confidential. If you are not the right addressee please do =
not
forward it, please inform the sender, and please erase this e-mail including
any attachments. Thanks.
From unknown Sat Aug 09 05:04:42 2025
X-Loop: help-debbugs@gnu.org
Subject: bug#24838: 26.0.50; Parse error in certain shell scripts
Resent-From: Noam Postavsky
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sat, 10 Feb 2018 14:02:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 24838
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Philipp Stephani
Cc: 24838@debbugs.gnu.org
Received: via spool by 24838-submit@debbugs.gnu.org id=B24838.151827130919050
(code B ref 24838); Sat, 10 Feb 2018 14:02:01 +0000
Received: (at 24838) by debbugs.gnu.org; 10 Feb 2018 14:01:49 +0000
Received: from localhost ([127.0.0.1]:36237 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1ekViu-0004wi-BK
for submit@debbugs.gnu.org; Sat, 10 Feb 2018 09:01:48 -0500
Received: from mail-it0-f44.google.com ([209.85.214.44]:51157)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1ekVit-0004r3-3q; Sat, 10 Feb 2018 09:01:47 -0500
Received: by mail-it0-f44.google.com with SMTP id x128so1814184ite.0;
Sat, 10 Feb 2018 06:01:47 -0800 (PST)
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=/4uQa1MFK6310T5zztrVSUfTQgUg/NtZYdLZuJSEOBo=;
b=tHMNX0esKrIiCYJ88jCXjt5v02oeo9UuKoQS2zYzW11KbNe1TfVqVg8B6ifffGvwK3
OVtocbX4JBaSUfeWr+839ik1fBKJqciWqepo+VN9lH0BZgAcYExVYQxQZH4gDiRwhmqD
glOYa865dpE98CVerwdbjGlIZ3i9LPqKrmjsE7k5mCKrDwUDr2jCqgti8Ph6GyaGiBP9
kUXUHhQlDHf5npr/LkQc8goDN+1pKdy87YO4EPFblzdYANeLFYsjH4uRKXafxkEdJrvp
9msFBx3Ia9Q0R/WKqn6PYuXJSBioRsJ8fHgGSM4ngSfXkv8Jq8ufLmQJm918GgzzcQKF
ix3g==
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=/4uQa1MFK6310T5zztrVSUfTQgUg/NtZYdLZuJSEOBo=;
b=L5aiKEiBFzDv9ilO1TDQvxyddrKadYDYCKs2O8FAmySaSccQ+AvDRWxksNLc/lw5X4
SpQ/a20hxgBhLJtqTnFoHs1tulv1XGOz5vUlGsM1Nngf8uxbTDDGXHKmO1dp4fxO9jq1
/jc3JljQdxHrTHW+k4tQ+jpKAw+U5HCeDooARUsR1QTUMgd6kYkbT5EUKMQbIyp1DiRk
JisJ9Q2OxClxCuyOyWmPkmmc+vF9ohQPCNP1Ujeojv2r4iHOM02iZMtQyeeGDb4ayT5A
Lr3WPbyN1C2dVr19KHYnV8gGQgHIB27L6LsbIn1h0eFgOvahygHimyFAONecMGs8y9+F
5zOg==
X-Gm-Message-State: APf1xPBTKrAH1Ckq44KpoPqYvEiemikqUaIsM00RwIHXAPpBMQohDIoE
ycY0wiRTOHWn1AJKozEBLKpIIA==
X-Google-Smtp-Source: AH8x225YSIxSD2IV2ecl/rOVwq5NlS1GH6q3dhoovGLsyo9xjF3Yoc+nWSAwNmu4b7KY8mnC5aAk0A==
X-Received: by 10.36.230.195 with SMTP id e186mr1781789ith.147.1518271301333;
Sat, 10 Feb 2018 06:01:41 -0800 (PST)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
by smtp.googlemail.com with ESMTPSA id
e7sm2278369ita.17.2018.02.10.06.01.40
(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
Sat, 10 Feb 2018 06:01:40 -0800 (PST)
From: Noam Postavsky
References:
Date: Sat, 10 Feb 2018 09:01:39 -0500
In-Reply-To: (Philipp Stephani's
message of "Mon, 31 Oct 2016 16:23:16 +0100")
Message-ID: <87y3k1aqpo.fsf@users.sourceforge.net>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.5 (/)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit"
X-Spam-Score: 0.5 (/)
tags 24838 fixed
close 24838 27.1
quit
Philipp Stephani writes:
> Visit the following file in shell-script-mode:
>
> #!/bin/bash
>
> a="
> ("
>
> if b; then
> c
> else
> d
> # '
> fi
>
> Now move point inside 'fi', and run M-x show-paren-mode. You'll notice
> that the 'fi' is marked as syntax error, and 'if' isn't highlighted,
> indicating that the construct wasn't parsed correctly.
> Now run C-c ?. This will cause an error "smie-indent-keyword: Wrong
> type argument: number-or-marker-p, noindent".
This is fixed in master.
[1: 14b9558752]: 2017-12-12 23:03:00 -0500
* src/syntax.c (find_defun_start): Use syntax-ppss
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=14b95587520959c5b54356547a0a69932a9bb480