unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24838: 26.0.50; Parse error in certain shell scripts
@ 2016-10-31 15:23 Philipp Stephani
  2018-02-10 14:01 ` Noam Postavsky
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Stephani @ 2016-10-31 15:23 UTC (permalink / raw)
  To: 24838


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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#24838: 26.0.50; Parse error in certain shell scripts
  2016-10-31 15:23 bug#24838: 26.0.50; Parse error in certain shell scripts Philipp Stephani
@ 2018-02-10 14:01 ` Noam Postavsky
  0 siblings, 0 replies; 2+ messages in thread
From: Noam Postavsky @ 2018-02-10 14:01 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: 24838

tags 24838 fixed
close 24838 27.1
quit

Philipp Stephani <p.stephani2@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-10 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-31 15:23 bug#24838: 26.0.50; Parse error in certain shell scripts Philipp Stephani
2018-02-10 14:01 ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).