GNU bug report logs - #24838
26.0.50; Parse error in certain shell scripts

Previous Next

Package: emacs;

Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>

Date: Mon, 31 Oct 2016 15:24:01 UTC

Severity: minor

Tags: fixed

Found in version 26.0.50

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

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 24838 in the body.
You can then email your comments to 24838 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 bug-gnu-emacs <at> gnu.org:
bug#24838; Package emacs. (Mon, 31 Oct 2016 15:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philipp Stephani <p.stephani2 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 31 Oct 2016 15:24:02 GMT) Full text and rfc822 format available.

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

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Parse error in certain shell scripts
Date: Mon, 31 Oct 2016 16:23:16 +0100
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".  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=-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))

-- 
Google Germany GmbH
Erika-Mann-Straße 33
80636 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: 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öschen
Sie die E-Mail und alle Anhänge.  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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24838; Package emacs. (Sat, 10 Feb 2018 14:02:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 24838 <at> debbugs.gnu.org
Subject: Re: bug#24838: 26.0.50; Parse error in certain shell scripts
Date: Sat, 10 Feb 2018 09:01:39 -0500
tags 24838 fixed
close 24838 27.1
quit

Philipp Stephani <p.stephani2 <at> gmail.com> 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




Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sat, 10 Feb 2018 14:02:04 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 24838 <at> debbugs.gnu.org and Philipp Stephani <p.stephani2 <at> gmail.com> Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Sat, 10 Feb 2018 14:02:04 GMT) Full text and rfc822 format available.

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

This bug report was last modified 7 years and 152 days ago.

Previous Next


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