# HG changeset patch # User Chong Yidong # Date 1161538136 0 # Node ID 0c01ec806f3e8307924c92a5c7b12353e39bdac0 # Parent 8ac53fe6c9dca069b5d478eea19fa3532d2902b5 * progmodes/cperl-mode.el (cperl-mode): Don't assume font-lock-multiline is auto-local (it's not). (cperl-windowed-init): Ensure that cperl-font-lock-multiline is initialized before calling cperl-init-faces. diff -r 8ac53fe6c9dc -r 0c01ec806f3e lisp/ChangeLog --- a/lisp/ChangeLog Sun Oct 22 14:04:02 2006 +0000 +++ b/lisp/ChangeLog Sun Oct 22 17:28:56 2006 +0000 @@ -1,3 +1,10 @@ +2006-10-22 Chong Yidong + + * progmodes/cperl-mode.el (cperl-mode): Don't assume + font-lock-multiline is auto-local (it's not). + (cperl-windowed-init): Ensure that cperl-font-lock-multiline is + initialized before calling cperl-init-faces. + 2006-10-22 Nick Roberts * progmodes/gdb-ui.el (gdb-info-stack-custom): Don't try to give diff -r 8ac53fe6c9dc -r 0c01ec806f3e lisp/progmodes/cperl-mode.el --- a/lisp/progmodes/cperl-mode.el Sun Oct 22 14:04:02 2006 +0000 +++ b/lisp/progmodes/cperl-mode.el Sun Oct 22 17:28:56 2006 +0000 @@ -1835,7 +1835,7 @@ (if (boundp 'font-lock-multiline) ; Newer font-lock; use its facilities (progn (setq cperl-font-lock-multiline t) ; Not localized... - (set 'font-lock-multiline t)) ; not present with old Emacs; auto-local + (set (make-local-variable 'font-lock-multiline) t)) (make-local-variable 'font-lock-fontify-region-function) (set 'font-lock-fontify-region-function ; not present with old Emacs 'cperl-font-lock-fontify-region-function)) @@ -5708,19 +5708,22 @@ (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)))))) + (cond ((featurep 'ps-print) + (unless cperl-faces-init + (if (boundp 'font-lock-multiline) + (setq cperl-font-lock-multiline t)) + (cperl-init-faces))) + ((not cperl-faces-init) + (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))))))) (defvar cperl-font-lock-keywords-1 nil "Additional expressions to highlight in Perl mode. Minimal set.")