From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [eddy@opera.com: perl-mode font-lock flaky around $' &c.] Date: Thu, 16 Aug 2007 20:32:03 -0400 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1187310548 26054 80.91.229.12 (17 Aug 2007 00:29:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Aug 2007 00:29:08 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 17 02:29:06 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ILpi6-0006hy-6H for ged-emacs-devel@m.gmane.org; Fri, 17 Aug 2007 02:29:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILpi5-00040B-8n for ged-emacs-devel@m.gmane.org; Thu, 16 Aug 2007 20:29:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ILphO-0003fu-FN for emacs-devel@gnu.org; Thu, 16 Aug 2007 20:28:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ILphN-0003fN-Gl for emacs-devel@gnu.org; Thu, 16 Aug 2007 20:28:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILphN-0003fC-4p for emacs-devel@gnu.org; Thu, 16 Aug 2007 20:28:21 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ILphM-0003JC-Tm for emacs-devel@gnu.org; Thu, 16 Aug 2007 20:28:21 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1ILpkx-0002Zj-Nh; Thu, 16 Aug 2007 20:32:03 -0400 X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:76654 Archived-At: Would someone please try to DTRT with this? It could be that other recent changes in perl-mode have made some cases worse. ------- Start of forwarded message ------- X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=failed version=3.1.0 To: bug-gnu-emacs@gnu.org From: Edward Welbourne Date: Thu, 16 Aug 2007 11:32:55 +0200 Subject: perl-mode font-lock flaky around $' &c. Reply-To: eddy@opera.com Put the following (complete with its tabs) into a buffer in perl-mode, with font-lock mode active. (tab-width 4 is recommended, but incidental). for ( $arg ) { /^-([bcdghLpuv]+)$/ && do { $short = $1; last; }; /^--usage/ && do { $self->report(0, &usage()); return 0; }; /^--help/ && do { $self->report(0, &help()); return 0; }; /^--config=/ && do { $config = $'; last; }; /^--config$/ && do { $short = 'c'; last; }; /^--unstripped$/&& do { $self->{debug} = 1; last; }; /^--version=/ && do { $self->{version} = $'; last; }; /^--version$/ && do { $short = 'v'; last; }; /^--build=/ && do { $self->{build} = $'; last; }; /^--build$/ && do { $short = 'b'; last; }; /^--manifest=/ && do { $self->{manifest} = $'; last; }; /^--manifest$/ && do { $short = 'm'; last; }; /^--date=/ && do { $self->{date} = $'; last; }; /^--date/ && do { $short = 'd'; last; }; /^--lang(uage)?s?=/ && do { push @{$self->{langs}}, split(/,/, $'); last; }; /^--lang(uage)?s?$/ && do { $short = 'L'; last; }; /^--all-clean/ && do { $self->{cleanly} = 1; last; }; /^--no-clean/ && do { $self->{cleanly} = -1; last; }; /^--ok-clean/ && do { $self->{cleanly} = 0; last; }; /^--debug=/ && do { $self->{dbglvl} = $'; last; }; /^--debug$/ && do { $short = 'g'; last; }; /^--verbose=/ && do { $self->{verbose} = $'; last; }; /^--verbose$/ && do { $short = 'p'; last; }; /^-/ && do { die &usage("Unrecognized command-line flag: $arg"); }; if (!defined($config)) { $config = $arg; } elsif (!defined($self->{version})) { $self->{version} = $arg; } elsif (!defined($self->{build})) { $self->{build} = $arg; } elsif (!defined($self->{date})) { $self->{date} = $arg; } else { die &usage("Stray or unrecognized cruft at end of command-line: $arg"); } } Notice, first, that $' confuses the syntax highlighting. Next, delete some of the tab characters used for spacing. Notice that syntax colouring changes. I used to be able to quite sensibly deal with $' (and other $X where X would, without a preceding $, complicate font-lock or sexp-recognition) by putting an end-of-line comment like #')} which would suffice to un-confuse everything. This no longer seems to work :-( My attempts at it prove highly volatile; seemingly innocuous changes elsewhere in the file (e.g. hspace changes, as above) can change how everything is displayed. I can make no sense of it. In GNU Emacs 22.1.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2007-07-07 on raven, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10300000 configured using `configure '--build=i486-linux-gnu' '--host=i486-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/emacs22:/etc/emacs:/usr/local/share/emacs/22.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.1/leim' '--with-x=yes' '--with-x-toolkit=athena' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.ISO-8859-15 locale-coding-system: iso-8859-15 default-enable-multibyte-characters: t Major mode: Perl Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t Recent input: C-x C-s C-p C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-p C-d C-/ C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-d C-d C-d C-n C-M-b C-n C-n C-f C-f C-f C-f C-f C-f C-d C-n C-d C-n C-n C-n C-n C-n C-n C-d C-n C-d C-n C-n C-n C-d C-n C-d C-n C-n C-n C-n C-n C-n C-d C-n C-d C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-n C-l C-d C-/ C-p C-d C-/ C-x o C-x C-s M-x e m a b u r e p o r Recent messages: forward-sexp: Scan error: "Unbalanced parentheses", 1028, 2730 Mark saved where search started [5 times] Wrote /disk/home/eddy/work/mine/toys/trial Auto-saving...done Undo! [39 times] Redo! Undo! [66 times] Wrote /disk/home/eddy/work/desk/ubs/platforms/unix/package/lib/Request.pm Making completion list... Loading emacsbug...done _______________________________________________ bug-gnu-emacs mailing list bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs ------- End of forwarded message -------