From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Edward Welbourne Newsgroups: gmane.emacs.bugs Subject: perl-mode font-lock flaky around $' &c. Date: Thu, 16 Aug 2007 11:32:55 +0200 Message-ID: Reply-To: eddy@opera.com NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1187256992 10096 80.91.229.12 (16 Aug 2007 09:36:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Aug 2007 09:36:32 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 16 11:36:30 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ILbmF-0003VU-A7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Aug 2007 11:36:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILbmE-0001Gu-Na for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Aug 2007 05:36:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ILbjO-0000Jr-Pd for bug-gnu-emacs@gnu.org; Thu, 16 Aug 2007 05:33:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ILbjM-0000Jd-Md for bug-gnu-emacs@gnu.org; Thu, 16 Aug 2007 05:33:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILbjM-0000Ja-3O for bug-gnu-emacs@gnu.org; Thu, 16 Aug 2007 05:33:28 -0400 Original-Received: from sam.opera.com ([213.236.208.81]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ILbjL-0006yk-Is for bug-gnu-emacs@gnu.org; Thu, 16 Aug 2007 05:33:27 -0400 Original-Received: from whorl (pat-tdc.opera.com [213.236.208.22]) by sam.opera.com (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id l7G9XElO013744 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 16 Aug 2007 09:33:19 GMT Original-Received: from eddy by whorl with local (Exim 4.67) (envelope-from ) id 1ILbip-0008Gt-QY for bug-gnu-emacs@gnu.org; Thu, 16 Aug 2007 11:32:55 +0200 X-Virus-Scanned: ClamAV 0.91.1/3966/Thu Aug 16 00:48:06 2007 on sam.opera.com X-Virus-Status: Clean X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16368 Archived-At: 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