aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-04-23 01:34:54 +0000
committerChong Yidong2009-04-23 01:34:54 +0000
commit474749510e6da2f8250dd599f20bdc38c153f344 (patch)
tree6e5b5f1355584b0494de67691e0956b893f3fde1
parent493dcf2c9b64d5eb8ef8e218cf1da65ab5f21e92 (diff)
downloademacs-474749510e6da2f8250dd599f20bdc38c153f344.tar.gz
emacs-474749510e6da2f8250dd599f20bdc38c153f344.zip
* hi-lock.el (hi-lock--inhibit-font-lock-hook): New var.
(hi-lock-set-pattern, hi-lock-font-lock-hook): Use it (Bug#3068).
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/hi-lock.el22
-rw-r--r--lisp/startup.el8
3 files changed, 28 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 614615f8143..e26549f32cb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12009-04-23 Chong Yidong <cyd@stupidchicken.com>
2
3 * hi-lock.el (hi-lock--inhibit-font-lock-hook): New var.
4 (hi-lock-set-pattern, hi-lock-font-lock-hook): Use it (Bug#3068).
5
12009-04-21 Martin Rudalics <rudalics@gmx.at> 62009-04-21 Martin Rudalics <rudalics@gmx.at>
2 7
3 * diff-mode.el (diff-find-source-location): Don't call 8 * diff-mode.el (diff-find-source-location): Don't call
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 3bc8c8b1abd..672f399d9a1 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -564,9 +564,18 @@ not suitable."
564 'face-name-history 564 'face-name-history
565 (cdr hi-lock-face-defaults)))) 565 (cdr hi-lock-face-defaults))))
566 566
567(defvar hi-lock--inhibit-font-lock-hook nil
568 "Inhibit the action of `hi-lock-font-lock-hook'.
569This is used by `hi-lock-set-pattern'.")
570
567(defun hi-lock-set-pattern (regexp face) 571(defun hi-lock-set-pattern (regexp face)
568 "Highlight REGEXP with face FACE." 572 "Highlight REGEXP with face FACE."
569 (let ((pattern (list regexp (list 0 (list 'quote face) t)))) 573 (let ((pattern (list regexp (list 0 (list 'quote face) t)))
574 ;; The call to `font-lock-add-keywords' below might disable
575 ;; and re-enable font-lock mode. If so, we don't want
576 ;; `hi-lock-font-lock-hook' to run. This can be removed once
577 ;; Bug#635 is fixed. -- cyd
578 (hi-lock--inhibit-font-lock-hook t))
570 (unless (member pattern hi-lock-interactive-patterns) 579 (unless (member pattern hi-lock-interactive-patterns)
571 (font-lock-add-keywords nil (list pattern) t) 580 (font-lock-add-keywords nil (list pattern) t)
572 (push pattern hi-lock-interactive-patterns) 581 (push pattern hi-lock-interactive-patterns)
@@ -632,11 +641,12 @@ not suitable."
632 641
633(defun hi-lock-font-lock-hook () 642(defun hi-lock-font-lock-hook ()
634 "Add hi-lock patterns to font-lock's." 643 "Add hi-lock patterns to font-lock's."
635 (if font-lock-mode 644 (unless hi-lock--inhibit-font-lock-hook
636 (progn 645 (if font-lock-mode
637 (font-lock-add-keywords nil hi-lock-file-patterns t) 646 (progn
638 (font-lock-add-keywords nil hi-lock-interactive-patterns t)) 647 (font-lock-add-keywords nil hi-lock-file-patterns t)
639 (hi-lock-mode -1))) 648 (font-lock-add-keywords nil hi-lock-interactive-patterns t))
649 (hi-lock-mode -1))))
640 650
641(defvar hi-lock-string-serialize-hash 651(defvar hi-lock-string-serialize-hash
642 (make-hash-table :test 'equal) 652 (make-hash-table :test 'equal)
diff --git a/lisp/startup.el b/lisp/startup.el
index 7a1f9dc392d..e2929e08b83 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -499,7 +499,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
499 (delete (concat "PWD=" pwd) 499 (delete (concat "PWD=" pwd)
500 process-environment))))) 500 process-environment)))))
501 (setq default-directory (abbreviate-file-name default-directory)) 501 (setq default-directory (abbreviate-file-name default-directory))
502 (let ((menubar-bindings-done nil)) 502 (let ((menubar-bindings-done nil)
503 (old-face-font-rescale-alist face-font-rescale-alist))
503 (unwind-protect 504 (unwind-protect
504 (command-line) 505 (command-line)
505 ;; Do this again, in case .emacs defined more abbreviations. 506 ;; Do this again, in case .emacs defined more abbreviations.
@@ -540,6 +541,11 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
540 (not (and initial-window-system 541 (not (and initial-window-system
541 (not noninteractive) 542 (not noninteractive)
542 (not (eq initial-window-system 'pc))))) 543 (not (eq initial-window-system 'pc)))))
544 ;; If face-font-rescale-alist has changed, reload the
545 ;; default font.
546 (unless (eq face-font-rescale-alist
547 old-face-font-rescale-alist)
548 (set-face-attribute 'default nil :font (font-spec)))
543 ;; Modify the initial frame based on what .emacs puts into 549 ;; Modify the initial frame based on what .emacs puts into
544 ;; ...-frame-alist. 550 ;; ...-frame-alist.
545 (if (fboundp 'frame-notice-user-settings) 551 (if (fboundp 'frame-notice-user-settings)