emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/textmodes/conf-mode.el,v


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/conf-mode.el,v
Date: Sun, 10 Sep 2006 00:30:47 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       06/09/10 00:30:46

Index: conf-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/textmodes/conf-mode.el,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- conf-mode.el        9 Sep 2006 23:20:39 -0000       1.15
+++ conf-mode.el        10 Sep 2006 00:30:46 -0000      1.16
@@ -470,15 +470,19 @@
   (conf-mode-initialize "#" 'conf-space-font-lock-keywords)
   (make-local-variable 'conf-assignment-sign)
   (setq conf-assignment-sign nil)
-  (cond (current-prefix-arg
+  (make-local-variable 'conf-space-keywords)
         (make-local-variable 'conf-space-keywords-override)
+  (setq conf-space-keywords-override nil)
+  (cond (current-prefix-arg
         ;; By setting conf-space-keywords-override
-        ;; we arrange for the hook function below
+        ;; we arrange for conf-space-mode-internal
         ;; to override any value of conf-space-keywords
         ;; specified in a local variables list.
          (setq conf-space-keywords-override
               (if (> (prefix-numeric-value current-prefix-arg) 0)
                   (read-string "Regexp to match keywords: "))))
+       ;; If this is already set, don't replace it with the default.
+       (conf-space-keywords)
         (buffer-file-name
         ;; By setting conf-space-keywords directly, 
         ;; we let a value in the local variables list take precedence.
@@ -486,9 +490,13 @@
          (setq conf-space-keywords
               (assoc-default buffer-file-name conf-space-keywords-alist
                              'string-match))))
-  ;; This is stuff to be done after parsing the local variables, once
-  ;; any local variable spec fo rconf-space-keywords is already in  effect.
-  (push (lambda ()
+  (conf-space-mode-internal)
+  ;; In case the local variables list specifies conf-space-keywords,
+  ;; recompute other things from that afterward.
+  (push 'conf-space-mode-internal
+       hack-local-variables-hook))
+
+(defun conf-space-mode-internal ()
          (when conf-space-keywords-override
            (setq conf-space-keywords
                  conf-space-keywords-override))
@@ -497,6 +505,12 @@
                (if conf-space-keywords
                    (concat "\\(?:" conf-space-keywords "\\)[ \t]+.+?\\([ 
\t]+\\|$\\)")
                  ".+?\\([ \t]+\\|$\\)"))
+  ;; If Font Lock is already enabled, reenable it with new
+  ;; conf-assignment-regexp.
+  (when (and font-lock-mode
+            (boundp 'font-lock-keywords)) ;see `normal-mode'
+    (font-lock-add-keywords nil nil)
+    (font-lock-mode 1))
          (setq imenu-generic-expression
                `(,@(cdr imenu-generic-expression)
                  ("Parameters"
@@ -505,7 +519,6 @@
                                "\\)[ \t]+\\([^ \t\n]+\\)\\(?:[ \t]\\|$\\)")
                      "^[ \t]*\\([^ \t\n[]+\\)\\(?:[ \t]\\|$\\)")
                   1))))
-       hack-local-variables-hook))
 
 ;;;###autoload
 (define-derived-mode conf-colon-mode conf-unix-mode "Conf[Colon]"




reply via email to

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