aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-10-27 19:51:13 +0000
committerStefan Monnier2004-10-27 19:51:13 +0000
commit474b9dcd578320bbeb908f8fccfb094c9c4709c1 (patch)
tree702cdaffdffa10f0843665515afc67a7446bfb4d
parent563631fe72158728b9ce7f2bbbcd73f2e6574369 (diff)
downloademacs-474b9dcd578320bbeb908f8fccfb094c9c4709c1.tar.gz
emacs-474b9dcd578320bbeb908f8fccfb094c9c4709c1.zip
(hilit-mode): New function.
Move all the toplevel side-effecting stuff into it, so that loading hilit19 doesn't mess everything up any more.
-rw-r--r--lisp/obsolete/hilit19.el96
1 files changed, 54 insertions, 42 deletions
diff --git a/lisp/obsolete/hilit19.el b/lisp/obsolete/hilit19.el
index 4d8af4b5a2b..b1aef20f5dd 100644
--- a/lisp/obsolete/hilit19.el
+++ b/lisp/obsolete/hilit19.el
@@ -1,6 +1,6 @@
1;;; hilit19.el --- customizable highlighting for Emacs 19 1;;; hilit19.el --- customizable highlighting for Emacs 19
2 2
3;; Copyright (c) 1993, 1994, 2001 Free Software Foundation, Inc. 3;; Copyright (c) 1993, 1994, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Jonathan Stigelman <stig@hackvan.com> 5;; Author: Jonathan Stigelman <stig@hackvan.com>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -397,8 +397,6 @@ See the hilit-lookup-face-create documentation for valid face names.")
397If hilit19 is dumped into emacs at your site, you may have to set this in 397If hilit19 is dumped into emacs at your site, you may have to set this in
398your init file.") 398your init file.")
399 399
400(eval-when-compile (setq byte-optimize t))
401
402;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
403;; Use this to report bugs: 401;; Use this to report bugs:
404 402
@@ -945,47 +943,61 @@ the entire buffer is forced."
945;; Initialization. 943;; Initialization.
946;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 944;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
947 945
948(and (not hilit-inhibit-rebinding) 946(define-minor-mode hilit-mode
949 (progn 947 "Obsolete minor mode. Use `global-font-lock-mode' instead."
950 (substitute-key-definition 'yank 'hilit-yank 948 :global t
951 (current-global-map)) 949
952 (substitute-key-definition 'yank-pop 'hilit-yank-pop 950 (unless (and hilit-inhibit-rebinding hilit-mode)
953 (current-global-map)) 951 (substitute-key-definition
954 (substitute-key-definition 'recenter 'hilit-recenter 952 (if hilit-mode 'yank 'hilit-yank)
955 (current-global-map)))) 953 (if hilit-mode 'hilit-yank 'yank)
956 954 (current-global-map))
957(global-set-key [?\C-\S-l] 'hilit-repaint-command) 955 (substitute-key-definition
958 956 (if hilit-mode 'yank-pop 'hilit-yank-pop)
959(add-hook 'find-file-hook 'hilit-find-file-hook t) 957 (if hilit-mode 'hilit-yank-pop 'yank-pop)
958 (current-global-map))
959 (substitute-key-definition
960 (if hilit-mode 'recenter 'hilit-recenter)
961 (if hilit-mode 'hilit-recenter 'recenter)
962 (current-global-map)))
963
964 (if hilit-mode
965 (global-set-key [?\C-\S-l] 'hilit-repaint-command)
966 (global-unset-key [?\C-\S-l]))
967
968 (if hilit-mode
969 (add-hook 'find-file-hook 'hilit-find-file-hook t)
970 (remove-hook 'find-file-hook 'hilit-find-file-hook t))
971
972 (unless (and hilit-inhibit-hooks hilit-mode)
973 (condition-case c
974 (progn
975
976 ;; BUFFER highlights...
977 (mapcar (lambda (hook)
978 (if hilit-mode
979 (add-hook hook 'hilit-rehighlight-buffer-quietly)
980 (remove-hook hook 'hilit-rehighlight-buffer-quietly)))
981 '(
982 Info-selection-hook
983
984 ;; runs too early vm-summary-mode-hooks
985 vm-summary-pointer-hook
986 vm-preview-message-hook
987 vm-show-message-hook
988
989 rmail-show-message-hook
990 mail-setup-hook
991 mh-show-mode-hook
992
993 dired-after-readin-hook
994 ))
995 )
996 (error (message "Error loading highlight hooks: %s" c)
997 (ding) (sit-for 1)))))
960 998
961(eval-when-compile (require 'gnus)) ; no compilation gripes 999(eval-when-compile (require 'gnus)) ; no compilation gripes
962 1000
963(and (not hilit-inhibit-hooks)
964 (condition-case c
965 (progn
966
967 ;; BUFFER highlights...
968 (mapcar (function
969 (lambda (hook)
970 (add-hook hook 'hilit-rehighlight-buffer-quietly)))
971 '(
972 Info-selection-hook
973
974;; runs too early vm-summary-mode-hooks
975 vm-summary-pointer-hook
976 vm-preview-message-hook
977 vm-show-message-hook
978
979 rmail-show-message-hook
980 mail-setup-hook
981 mh-show-mode-hook
982
983 dired-after-readin-hook
984 ))
985 )
986 (error (message "Error loading highlight hooks: %s" c)
987 (ding) (sit-for 1))))
988
989;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1001;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
990;; Default patterns for various modes. 1002;; Default patterns for various modes.
991;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1003;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1510,5 +1522,5 @@ number of backslashes."
1510 1522
1511(provide 'hilit19) 1523(provide 'hilit19)
1512 1524
1513;;; arch-tag: db99739a-4837-41ee-ad02-3baced8ae71d 1525;; arch-tag: db99739a-4837-41ee-ad02-3baced8ae71d
1514;;; hilit19.el ends here 1526;;; hilit19.el ends here