From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#23526: 25.0.93; sh-mode heredoc triggers incorrectly Date: Fri, 13 May 2016 09:51:59 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113d064aacdd960532b48c73 X-Trace: ger.gmane.org 1463126007 22790 80.91.229.3 (13 May 2016 07:53:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 May 2016 07:53:27 +0000 (UTC) To: 23526@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 13 09:53:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b17uH-0003yX-9M for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 May 2016 09:53:09 +0200 Original-Received: from localhost ([::1]:33222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b17uG-0007G8-K8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 May 2016 03:53:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b17uD-0007Cs-1O for bug-gnu-emacs@gnu.org; Fri, 13 May 2016 03:53:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b17uA-0006F8-Ac for bug-gnu-emacs@gnu.org; Fri, 13 May 2016 03:53:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b17uA-0006F4-7i for bug-gnu-emacs@gnu.org; Fri, 13 May 2016 03:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b17uA-0001Nj-2e for bug-gnu-emacs@gnu.org; Fri, 13 May 2016 03:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 May 2016 07:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23526 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14631259375243 (code B ref -1); Fri, 13 May 2016 07:53:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 May 2016 07:52:17 +0000 Original-Received: from localhost ([127.0.0.1]:49515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b17tR-0001MU-2s for submit@debbugs.gnu.org; Fri, 13 May 2016 03:52:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b17tP-0001MJ-TS for submit@debbugs.gnu.org; Fri, 13 May 2016 03:52:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b17tJ-0005oH-3I for submit@debbugs.gnu.org; Fri, 13 May 2016 03:52:10 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b17tI-0005o5-Vj for submit@debbugs.gnu.org; Fri, 13 May 2016 03:52:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b17tG-0006Fi-A6 for bug-gnu-emacs@gnu.org; Fri, 13 May 2016 03:52:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b17tA-0005m1-HA for bug-gnu-emacs@gnu.org; Fri, 13 May 2016 03:52:05 -0400 Original-Received: from mail-vk0-x234.google.com ([2607:f8b0:400c:c05::234]:32856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b17tA-0005lw-AR for bug-gnu-emacs@gnu.org; Fri, 13 May 2016 03:52:00 -0400 Original-Received: by mail-vk0-x234.google.com with SMTP id o133so127817990vka.0 for ; Fri, 13 May 2016 00:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=MVWbJuYSsCLZQQsAmPaBnJSOLqhn7+TOvsXEJsvDbow=; b=WCqslridO5GtOPtkhAP15mSlwvm8lg1L3Y98KPwgHicNdCECqNuemcmsflb2Nbr9uy Tm2wOGL5EKe0LGUwfsp4e8mXMao+l37hN+SAnKpssL0L566pcntL1uwy1YcNHaQkvX97 j14O9QdH+ovIauPB0VByE0PcOFDB0xNxUZy38WnR+A5IktkuZvDcEiBufHF+/9zmjQAq mWB7A0Gmm4nr3zow/9/L+sg/MeuZrGKj7vAqAHU+I3AUB1wJN1XBbtYs/t6tMFar2lVs z8gIVJYSVdPxSlQaAjqBrkGm44egmCZQFAn9Zy686qw5DyqQ9u0Xz9GzFnYnhK7lS9T+ aUdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=MVWbJuYSsCLZQQsAmPaBnJSOLqhn7+TOvsXEJsvDbow=; b=UReKCPNVxoiSjXzmtgbWjpRfyOxjHUmeFn+HdQi5phVgxiYj2gu1kNbJDMtKHoR7vI WJNvMDC/fJ0yBOFrzS1rycM1T/fizt1z7ENP7MkC8MCbC6k3X6rFWz4SIs5vlvc7qWEq 7M/iro/+i0sq9Rtx45qRWADamiYe7ys3AbBgU/LsFF1IrcDGZhMhBK9QcMb4sfasWJ/G r9r4Tb5M7I/oakAsySe4igRmo2lJoV2/9QqmdXdZXrruUpVA7AODvLRizp/VZQqm3swj 9pK4Opd+a3UAp2KurAUeCFJ7y+BxC/CIIqNbILZhe8sKaMU4oDMcSxQCnQJqACL+md3v okwA== X-Gm-Message-State: AOPr4FWFF3595RLerQi2z7BX+IG34MBLK3LadGhA7frjzuV59HNv+XY4zCo0wMcRs/4wsN/uVh5cums/UbTz0g== X-Received: by 10.159.37.170 with SMTP id 39mr6090557uaf.25.1463125919191; Fri, 13 May 2016 00:51:59 -0700 (PDT) Original-Received: by 10.31.214.131 with HTTP; Fri, 13 May 2016 00:51:59 -0700 (PDT) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:118192 Archived-At: --001a113d064aacdd960532b48c73 Content-Type: text/plain; charset=UTF-8 In some cases, the "heredoc" system of sh-mode triggers on things that aren't heredocs. Steps to repeat: Create a file, test.sh, with the following content: ========8<-------- # This is a normal comment echo "<>" # This is incorrectly highlighted as a heredoc comment. echo "This is also incorrectly highlighted as a heredoc comment" ========8<-------- emacs -Q test.sh Now, the two last lines are highlighted as a heredoc. -- Anders In GNU Emacs 25.0.93.1 (x86_64-w64-mingw32) of 2016-04-23 built on KAEL Windowing system distributor 'Microsoft Corp.', version 6.1.7601 Configured using: 'configure --prefix=/tmp/emacs --without-imagemagick 'CFLAGS=-O2 -fomit-frame-pointer -g0'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS Important settings: value of $LANG: SVE locale-coding-system: cp1252 Major mode: Shell-script Minor modes in effect: 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 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Setting up indent for shell type sh Indentation variables are now local. Indentation setup for shell type sh Mark set Quit Type C-x 1 to delete the help window. Load-path shadows: None found. Features: (shadow sort mail-extr cl-extra pp thingatpt emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils vc-dispatcher vc-svn sh-script smie executable time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win 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 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 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 w32notify dbusbind w32 multi-tty make-network-process emacs) Memory information: ((conses 16 96532 11635) (symbols 56 20246 0) (miscs 48 45 138) (strings 32 18893 3179) (string-bytes 1 500720) (vectors 16 12785) (vector-slots 8 443089 4303) (floats 8 161 32) (intervals 56 291 18) (buffers 976 14)) --001a113d064aacdd960532b48c73 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In some cases, the "heredoc" system of sh-m= ode triggers on things that aren't heredocs.

S= teps to repeat:

=C2=A0 =C2=A0 Create a file, test.= sh, with the following content:
=3D=3D=3D=3D=3D=3D=3D=3D8<----= ----
# This is a normal comment
echo "<<HELLO>&g= t;"
# This is incorrectly highlighted as a heredoc comment.
echo= "This is also incorrectly highlighted as a heredoc comment"
=3D=3D=3D=3D=3D=3D=3D=3D8<--------
=C2=A0 =C2= =A0 emacs -Q test.sh

Now, the two last lines are h= ighlighted as a heredoc.

=C2=A0 =C2=A0 -- Anders

In GNU Emacs 25.0.93.1 (x86_64-w64-mingw32)
=C2=A0of 2016-04-23 built on KAEL
Windowing system distributor= 'Microsoft Corp.', version 6.1.7601
Configured using:
=C2=A0'configure --prefix=3D/tmp/emacs --without-imagemagick &#= 39;CFLAGS=3D-O2
=C2=A0-fomit-frame-pointer -g0''

Configured features:
XPM JPEG TIFF GIF PNG RSVG = SOUND DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
=C2=A0 value of $LANG: = SVE
=C2=A0 locale-coding-system: cp1252

= Major mode: Shell-script

Minor modes in effect:
=C2=A0 sh-electric-here-document-mode: t
=C2=A0 tooltip-m= ode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 electric-inde= nt-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-m= ode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-= mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-loc= k-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-compo= sition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 au= to-compression-mode: t
=C2=A0 line-number-mode: t
=C2= =A0 transient-mark-mode: t

Recent messages:
<= div>For information about GNU Emacs and the GNU system, type C-h C-a.
=
Setting up indent for shell type sh
Indentation variables ar= e now local.
Indentation setup for shell type sh
Mark s= et
Quit
Type C-x 1 to delete the help window.

Load-path shadows:
None found.

Features:
(shadow sort mail-extr cl-extra pp thingatpt ema= csbug message dired
format-spec rfc822 mml mml-sec password-cache= epg epg-config gnus-util
mm-decode mm-bodies mm-encode mail-pars= e rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc204= 5 ietf-drums mm-util help-fns
help-mode easymenu cl-loaddefs pcas= e cl-lib mail-prsvr mail-utils
vc-dispatcher vc-svn sh-script smi= e executable time-date mule-util
tooltip eldoc electric uniquify = ediff-hook vc-hooks lisp-float-type
mwheel dos-w32 ls-lisp disp-t= able w32-win w32-vars term/common-win
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
frame cl-g= eneric cham georgian utf-8-lang misc-lang vietnamese tibetan
thai= tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
<= div>slovak czech european ethiopic indian cyrillic chinese charscript
=
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
<= div>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 w32notify dbusbind= w32
multi-tty make-network-process emacs)

Memory information:
((conses 16 96532 11635)
=C2=A0(= symbols 56 20246 0)
=C2=A0(miscs 48 45 138)
=C2=A0(stri= ngs 32 18893 3179)
=C2=A0(string-bytes 1 500720)
=C2=A0= (vectors 16 12785)
=C2=A0(vector-slots 8 443089 4303)
= =C2=A0(floats 8 161 32)
=C2=A0(intervals 56 291 18)
=C2= =A0(buffers 976 14))

--001a113d064aacdd960532b48c73--