all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: emacs-devel@gnu.org
Subject: [eddy@opera.com: perl-mode font-lock flaky around $' &c.]
Date: Thu, 16 Aug 2007 20:32:03 -0400	[thread overview]
Message-ID: <E1ILpkx-0002Zj-Nh@fencepost.gnu.org> (raw)

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 <eddy@opera.com>
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 <tab> b 
u <tab> <M-backspace> <M-backspace> r e p o <tab> r 
<tab> <return>

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 -------

             reply	other threads:[~2007-08-17  0:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17  0:32 Richard Stallman [this message]
2007-08-17  3:38 ` [eddy@opera.com: perl-mode font-lock flaky around $' &c.] Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1ILpkx-0002Zj-Nh@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.