]> git.eshelyaron.com Git - emacs.git/commitdiff
* progmodes/cperl-mode.el (cperl-mode): Don't assume
authorChong Yidong <cyd@stupidchicken.com>
Sun, 22 Oct 2006 17:28:56 +0000 (17:28 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 22 Oct 2006 17:28:56 +0000 (17:28 +0000)
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.

lisp/ChangeLog
lisp/progmodes/cperl-mode.el

index 1f6b56acda0cd8f6ade4f475def122005b35a376..25ed1f27bd97caebdbb59065eb257d5ba0c26324 100644 (file)
@@ -1,3 +1,10 @@
+2006-10-22  Chong Yidong  <cyd@stupidchicken.com>
+
+       * 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  <nickrob@snap.net.nz>
 
        * progmodes/gdb-ui.el (gdb-info-stack-custom): Don't try to give
index 3264e0e72f6ecc6d0a4e07f0891f4991a42b6ca6..f31bbdcc1629cb11ea39f74404354270ffa12b3c 100644 (file)
@@ -1835,7 +1835,7 @@ or as help on variables `cperl-tips', `cperl-problems',
   (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 @@ indentation and initial hashes.  Behaves usually outside of comment."
 
 (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.")