From unknown Tue Jun 24 17:27:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17174: 24.3; perl-mode highlight: unrecognized perl var $' starts a string Resent-From: "G.raud" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Apr 2014 15:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17174 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 17174@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.139645350315277 (code B ref -1); Wed, 02 Apr 2014 15:46:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Apr 2014 15:45:03 +0000 Received: from localhost ([127.0.0.1]:33106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVNLZ-0003y1-Lo for submit@debbugs.gnu.org; Wed, 02 Apr 2014 11:45:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51964) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVK40-0006jl-Sv for submit@debbugs.gnu.org; Wed, 02 Apr 2014 08:14:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVK3u-0000k1-JF for submit@debbugs.gnu.org; Wed, 02 Apr 2014 08:14:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVK3u-0000jx-HD for submit@debbugs.gnu.org; Wed, 02 Apr 2014 08:14:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVK3p-0006M8-5j for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 08:14:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVK3j-0000j1-P3 for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 08:14:29 -0400 Received: from mout.gmx.net ([212.227.17.21]:61899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVK3j-0000it-EC for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 08:14:23 -0400 Received: from gmx.com ([79.134.235.5]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0M1iGk-1XJ9YU3HVS-00tjhy for ; Wed, 02 Apr 2014 14:14:21 +0200 Date: Wed, 2 Apr 2014 14:14:11 +0200 From: "G.raud" Message-ID: <20140402121353.GA29773@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:F9qUylGX0UhEbFOpF8Z5AHPMxUUShkm20C6VKJuP8qIOUJJ0z2w ehMFOLAH0fmwYYhBtRAYoh0stkE/Adr8SplwUmjG3Bl5zN5X9wBeb8wuhasNBe5mmX9bK1B y0JWzCyWSxSXYIJeL+hZ7Jk5cUJcdHVVdhqsy58MuOLuSE05AnFINBTnorNUMU1SQamuPjw Jr1Da2AYCCI0S7bPB4ErQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Mailman-Approved-At: Wed, 02 Apr 2014 11:44:59 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.1 (----) The bug is an old one, found in Emacs 22, 23 and 24 in Debian. To test: $ cat <<"EOF" >test.pl #!/usr/bin/perl $_ = 'truc'; /ru/; print "$'\n"; # this is highlighted as expected print $'; # this starts a string that continues to the next line print "\n"; EOF $ emacs24 -Q test.pl The output of (report-bug-emacs) follows. --- In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.6) of 2013-12-22 on brahms, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11204000 Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LANG: de_DE.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Perl Minor modes in effect: tooltip-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 input: M-x r e p o r t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: Beginning of history; no preceding item user-error: End of history; no default available (New file) Mark set byte-code: End of buffer [2 times] Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils perl-mode ffap url-parse auth-source eieio byte-opt bytecomp byte-compile cconv gnus-util mm-util mail-prsvr password-cache url-vars time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) -- From unknown Tue Jun 24 17:27:10 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "G.raud" Subject: bug#17174: closed (Re: bug#17174: 24.3; perl-mode highlight: unrecognized perl var $' starts a string) Message-ID: References: <20140402121353.GA29773@gmx.com> X-Gnu-PR-Message: they-closed 17174 X-Gnu-PR-Package: emacs Reply-To: 17174@debbugs.gnu.org Date: Thu, 03 Apr 2014 00:43:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1396485784-19568-1" This is a multi-part message in MIME format... ------------=_1396485784-19568-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #17174: 24.3; perl-mode highlight: unrecognized perl var $' starts a string which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 17174@debbugs.gnu.org. --=20 17174: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17174 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1396485784-19568-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 17174-done) by debbugs.gnu.org; 3 Apr 2014 00:42:54 +0000 Received: from localhost ([127.0.0.1]:33487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVVk5-00055F-5n for submit@debbugs.gnu.org; Wed, 02 Apr 2014 20:42:53 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:53013) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVVk1-000555-Ee for 17174-done@debbugs.gnu.org; Wed, 02 Apr 2014 20:42:50 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s330gkpP012907; Wed, 2 Apr 2014 20:42:46 -0400 Received: by pastel.home (Postfix, from userid 20848) id 1945D602E2; Wed, 2 Apr 2014 20:42:46 -0400 (EDT) From: Stefan Monnier To: "G.raud" Subject: Re: bug#17174: 24.3; perl-mode highlight: unrecognized perl var $' starts a string Message-ID: References: <20140402121353.GA29773@gmx.com> Date: Wed, 02 Apr 2014 20:42:46 -0400 In-Reply-To: <20140402121353.GA29773@gmx.com> (G. raud's message of "Wed, 2 Apr 2014 14:14:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4900=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4900> : inlines <685> : streams <1150707> : uri <1718517> X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 17174-done Cc: 17174-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -1.9 (-) > $ cat <<"EOF" >test.pl > #!/usr/bin/perl > $_ = 'truc'; /ru/; > print "$'\n"; # this is highlighted as expected > print $'; # this starts a string that continues to the next line > print "\n"; > EOF > $ emacs24 -Q test.pl Thanks for the clear test case. I installed the patch below in emacs-24, which should fix it. Stefan --- lisp/progmodes/perl-mode.el 2014-04-02 19:50:05 +0000 +++ lisp/progmodes/perl-mode.el 2014-04-03 00:37:11 +0000 @@ -250,7 +250,11 @@ ;; Catch ${ so that ${var} doesn't screw up indentation. ;; This also catches $' to handle 'foo$', although it should really ;; check that it occurs inside a '..' string. - ("\\(\\$\\)[{']" (1 ". p")) + ("\\(\\$\\)[{']" (1 (unless (and (eq ?\' (char-after (match-end 1))) + (save-excursion + (not (nth 3 (syntax-ppss + (match-beginning 0)))))) + (string-to-syntax ". p")))) ;; Handle funny names like $DB'stop. ("\\$ ?{?^?[_[:alpha:]][_[:alnum:]]*\\('\\)[_[:alpha:]]" (1 "_")) ;; format statements ------------=_1396485784-19568-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Apr 2014 15:45:03 +0000 Received: from localhost ([127.0.0.1]:33106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVNLZ-0003y1-Lo for submit@debbugs.gnu.org; Wed, 02 Apr 2014 11:45:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51964) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVK40-0006jl-Sv for submit@debbugs.gnu.org; Wed, 02 Apr 2014 08:14:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVK3u-0000k1-JF for submit@debbugs.gnu.org; Wed, 02 Apr 2014 08:14:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVK3u-0000jx-HD for submit@debbugs.gnu.org; Wed, 02 Apr 2014 08:14:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVK3p-0006M8-5j for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 08:14:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVK3j-0000j1-P3 for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 08:14:29 -0400 Received: from mout.gmx.net ([212.227.17.21]:61899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVK3j-0000it-EC for bug-gnu-emacs@gnu.org; Wed, 02 Apr 2014 08:14:23 -0400 Received: from gmx.com ([79.134.235.5]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0M1iGk-1XJ9YU3HVS-00tjhy for ; Wed, 02 Apr 2014 14:14:21 +0200 Date: Wed, 2 Apr 2014 14:14:11 +0200 From: "G.raud" To: bug-gnu-emacs@gnu.org Subject: 24.3; perl-mode highlight: unrecognized perl var $' starts a string Message-ID: <20140402121353.GA29773@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:F9qUylGX0UhEbFOpF8Z5AHPMxUUShkm20C6VKJuP8qIOUJJ0z2w ehMFOLAH0fmwYYhBtRAYoh0stkE/Adr8SplwUmjG3Bl5zN5X9wBeb8wuhasNBe5mmX9bK1B y0JWzCyWSxSXYIJeL+hZ7Jk5cUJcdHVVdhqsy58MuOLuSE05AnFINBTnorNUMU1SQamuPjw Jr1Da2AYCCI0S7bPB4ErQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 02 Apr 2014 11:44:59 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.1 (----) The bug is an old one, found in Emacs 22, 23 and 24 in Debian. To test: $ cat <<"EOF" >test.pl #!/usr/bin/perl $_ = 'truc'; /ru/; print "$'\n"; # this is highlighted as expected print $'; # this starts a string that continues to the next line print "\n"; EOF $ emacs24 -Q test.pl The output of (report-bug-emacs) follows. --- In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.6) of 2013-12-22 on brahms, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11204000 Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LANG: de_DE.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Perl Minor modes in effect: tooltip-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 input: M-x r e p o r t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: Beginning of history; no preceding item user-error: End of history; no default available (New file) Mark set byte-code: End of buffer [2 times] Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils perl-mode ffap url-parse auth-source eieio byte-opt bytecomp byte-compile cconv gnus-util mm-util mail-prsvr password-cache url-vars time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) -- ------------=_1396485784-19568-1--