unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Ilya Zakharevich <cperl@ilyaz.org>, emacs-devel@gnu.org
Subject: Re: CPerl-mode bug [Re: Relation with package authors (CPerl-mode follow-ups)]
Date: Wed, 29 Jun 2005 04:00:23 -0400	[thread overview]
Message-ID: <87mzp9bnrm.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <877jgrj22g.fsf_-_@marant.org> (J?r?me Marant's message of "Sat, 18 Jun 2005 14:12:55 +0200")

[ Hi Ilya, I've installed another minor patch in Emacs's CVS repository.
  It's not needed for your version of cperl-mode, but you might still be
  interested. ]

> After trying to reproduce all cperl-mode bugs from the Debian BTS,
> it seems that most of them have been fixed in the CVS trunk, but
> one which is a regression from the original CPerl-mode from
> Ilya.

> Could you please take care of this?

[...]

> subroutine names which contain built in keywords/function-names
> delimited by _ characters get highlighted incorrectly:

> For example, in emacs20-el:

> sub foo_print_desc ()
> {

> }

> 'foo_print_desc' gets highlighted in font-lock-function-name-face

So the bug is indeed absent from Ilya's cperl-mode and it is triggered by
the fact that Emacs's cperl-mode.el does not give _ word syntax.

To make up for it, the normal answer is to set font-lock-defaults so that _
does have word syntax during font-locking (but not while editing).

To get it to work I had to remove an apparently spurious set-syntax-table in
cperl-find-pods-heres.

See the patch below which seems to fix it,


        Stefan


--- cperl-mode.el	20 jun 2005 09:35:15 -0400	1.70
+++ cperl-mode.el	29 jun 2005 03:53:37 -0400	
@@ -1516,7 +1516,8 @@
 	 (t
 	  '((cperl-load-font-lock-keywords
 	     cperl-load-font-lock-keywords-1
-	     cperl-load-font-lock-keywords-2)))))
+	     cperl-load-font-lock-keywords-2)
+            nil nil ((?_ . "w"))))))
   (make-local-variable 'cperl-syntax-state)
   (if cperl-use-syntax-table-text-property
       (progn
@@ -3840,7 +3841,11 @@
       (and (buffer-modified-p)
 	   (not modified)
 	   (set-buffer-modified-p nil))
-      (set-syntax-table cperl-mode-syntax-table))
+      ;; I do not understand what this is doing here.  It breaks font-locking
+      ;; because it resets the syntax-table from font-lock-syntax-table to
+      ;; cperl-mode-syntax-table.
+      ;; (set-syntax-table cperl-mode-syntax-table)
+      )
     (car err-l)))
 
 (defun cperl-backward-to-noncomment (lim)

  reply	other threads:[~2005-06-29  8:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-04  7:14 Relation with package authors (CPerl-mode follow-ups) Jérôme Marant
2005-05-05 14:08 ` Stefan Monnier
2005-05-10 20:42   ` Jérôme Marant
2005-05-10 21:28     ` Stefan Monnier
2005-05-12  8:29       ` Richard Stallman
2005-06-18 12:12       ` CPerl-mode bug [Re: Relation with package authors (CPerl-mode follow-ups)] Jérôme Marant
2005-06-29  8:00         ` Stefan Monnier [this message]
2005-06-29 13:37           ` Jérôme Marant
2005-06-30  4:34           ` Ilya Zakharevich
2005-06-30  5:26             ` Miles Bader
2005-06-30  5:33               ` Ilya Zakharevich
2005-06-30  6:16                 ` Miles Bader
2005-06-30  7:04                   ` Ilya Zakharevich
2005-06-30  7:17                     ` Miles Bader
2005-06-30 18:32                       ` Ilya Zakharevich
2005-07-01  1:20                         ` Miles Bader
2005-07-01  4:57                           ` Stefan Monnier
2005-07-01  5:05                             ` Miles Bader
2005-07-01 15:04                               ` Stefan Monnier
2005-07-01 23:06                           ` Ilya Zakharevich
2005-07-02  1:08                             ` Miles Bader
2005-07-03 20:05                               ` Ilya Zakharevich
2005-07-03 15:49                             ` Richard M. Stallman
2005-07-01  4:03                         ` Richard M. Stallman
2005-06-30 21:28                 ` Richard M. Stallman
2005-06-30 18:01             ` Stefan Monnier
2005-06-30 18:35               ` Ilya Zakharevich
2005-06-30 19:32                 ` Stefan Monnier
2005-05-05 19:46 ` Relation with package authors (CPerl-mode follow-ups) Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87mzp9bnrm.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=cperl@ilyaz.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).