bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cperl-mode does not highlight function names properly


From: Mark Plaksin
Subject: Re: Cperl-mode does not highlight function names properly
Date: Sun, 27 Feb 2005 11:10:06 -0500
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Speaking of perl-mode, Richard told me that this mode is obsolete
>> and shall be deprecated. What's his status? (we have a bunch of
>> bug reports in the Debian BTS about it).
>
> Huh?  It's the default perl-mode, and it's the one I've been using (and
> improving) for the last few years.  Try it (in its Emacs-CVS version) and
> pass on the bug-reports.

How about stealing/modifying the following from cperl-mode so
outline-minor-mode works in perl-mode?

(defvar cperl-outline-regexp
  (concat cperl-imenu--function-name-regexp-perl "\\|" "\\`"))
(make-local-variable 'outline-regexp)
(setq outline-regexp cperl-outline-regexp)
(make-local-variable 'outline-level)
(setq outline-level 'cperl-outline-level)
;; Suggested by Mark A. Hershberger
(defun cperl-outline-level ()
  (looking-at outline-regexp)
  (cond ((not (match-beginning 1)) 0)   ; beginning-of-file
        ((match-beginning 2)
         (if (eq (char-after (match-beginning 2)) ?p)
             0                          ; package
           1))                          ; sub
        ((match-beginning 5)
         (if (eq (char-after (match-beginning 5)) ?1)
             1                          ; head1
           2))                          ; head2
        (t 3)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]