emacs-devel
[Top][All Lists]
Advanced

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

Re: cperl + isearch + font-lock-multiline sometimes very slow


From: Stefan Monnier
Subject: Re: cperl + isearch + font-lock-multiline sometimes very slow
Date: Mon, 23 Oct 2006 16:25:15 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Chong> I managed to reproduce the bug, and figured out the problem.
Chong> If ps-print is already loaded, cperl-init-faces is called when

Indeed, the relevant code is quoted below, IIUC.

> Odd dependency.  Just out of curiosity (if it isn't too complicated), what
> was the reason?

You'd have to ask Ilya Zakharevich <address@hidden>, I believe.
I suspect it's due to hysterical raisins, mostly linked to the act that
face-initialization has changed significantly between Emacs-19 and now
(compounded by the usual not-so-subtle differences with XEmacs, plus
fact that XEmacs's own changes in the same time frame).
If you don't care about backward compatibility, this can surely be
considerably simplified.


        Stefan


(defun cperl-windowed-init ()
  "Initialization under windowed version."
  (if (or (featurep 'ps-print) cperl-faces-init)
      ;; Need to init anyway:
      (or cperl-faces-init (cperl-init-faces))
    (add-hook 'font-lock-mode-hook
              (function
               (lambda ()
                 (if (memq major-mode '(perl-mode cperl-mode))
                     (progn
                       (or cperl-faces-init (cperl-init-faces)))))))
    (if (fboundp 'eval-after-load)
        (eval-after-load
            "ps-print"
          '(or cperl-faces-init (cperl-init-faces))))))

[...]

(if (cperl-enable-font-lock) (cperl-windowed-init))




reply via email to

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