aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-03-24 22:17:43 +0000
committerStefan Monnier2005-03-24 22:17:43 +0000
commitffc30f4fa15b023a72bec92df6a54a74a34c094a (patch)
tree9ae48f246139da2d763a0f319e949742984b6076
parent781da985a74078e9c9178d1fe03557de957e6333 (diff)
downloademacs-ffc30f4fa15b023a72bec92df6a54a74a34c094a.tar.gz
emacs-ffc30f4fa15b023a72bec92df6a54a74a34c094a.zip
find-file-hooks -> find-file-hook.
-rw-r--r--lisp/emulation/vi.el58
-rw-r--r--lisp/follow.el7
-rw-r--r--lisp/generic.el2
-rw-r--r--lisp/hi-lock.el8
-rw-r--r--lisp/hilit-chg.el20
5 files changed, 48 insertions, 47 deletions
diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el
index 4e17644e66a..70a52617431 100644
--- a/lisp/emulation/vi.el
+++ b/lisp/emulation/vi.el
@@ -1,7 +1,7 @@
1;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs 1;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs
2 2
3; This file is in the public domain because the authors distributed it 3;; This file is in the public domain because the authors distributed it
4; without a copyright notice before the US signed the Bern Convention. 4;; without a copyright notice before the US signed the Bern Convention.
5 5
6;; This file is part of GNU Emacs. 6;; This file is part of GNU Emacs.
7 7
@@ -11,32 +11,32 @@
11 11
12;;; Commentary: 12;;; Commentary:
13 13
14; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring) 14;; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring)
15; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu) 15;; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu)
16; Last revision: 01/07/87 Wed (for GNU Emacs 18.33) 16;; Last revision: 01/07/87 Wed (for GNU Emacs 18.33)
17 17
18; INSTALLATION PROCEDURE: 18;; INSTALLATION PROCEDURE:
19; 1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of 19;; 1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of
20; the single ESC used in real "vi", so I can access other ESC prefixed emacs 20;; the single ESC used in real "vi", so I can access other ESC prefixed emacs
21; commands while I'm in "vi"), say, by putting the following line in your 21;; commands while I'm in "vi"), say, by putting the following line in your
22; ".emacs" file: 22;; ".emacs" file:
23; (define-key global-map "\e\e" 'vi-mode) ;quick switch into vi-mode 23;; (define-key global-map "\e\e" 'vi-mode) ;quick switch into vi-mode
24; 2) If you wish you can define "find-file-hooks" to enter "vi" automatically 24;; 2) If you wish you can define "find-file-hook" to enter "vi" automatically
25; after a file is loaded into the buffer. For example, I defined it as: 25;; after a file is loaded into the buffer. For example, I defined it as:
26; (setq find-file-hooks (list 26;; (setq find-file-hook (list
27; (function (lambda () 27;; (function (lambda ()
28; (if (not (or (eq major-mode 'Info-mode) 28;; (if (not (or (eq major-mode 'Info-mode)
29; (eq major-mode 'vi-mode))) 29;; (eq major-mode 'vi-mode)))
30; (vi-mode)))))) 30;; (vi-mode))))))
31; 3) In your .emacs file you can define the command "vi-mode" to be "autoload" 31;; 3) In your .emacs file you can define the command "vi-mode" to be "autoload"
32; or you can execute the "load" command to load "vi" directly. 32;; or you can execute the "load" command to load "vi" directly.
33; 4) Read the comments for command "vi-mode" before you start using it. 33;; 4) Read the comments for command "vi-mode" before you start using it.
34; 34
35; COULD DO 35;; COULD DO
36; 1). A general 'define-operator' function to replace current hack 36;; 1). A general 'define-operator' function to replace current hack
37; 2). In operator handling, should allow other point moving Emacs commands 37;; 2). In operator handling, should allow other point moving Emacs commands
38; (such as ESC <, ESC >) to be used as arguments. 38;; (such as ESC <, ESC >) to be used as arguments.
39; 39
40;;; Code: 40;;; Code:
41 41
42(defvar vi-mode-old-major-mode) 42(defvar vi-mode-old-major-mode)
@@ -1487,5 +1487,5 @@ With ARG, inserts that many newlines."
1487 1487
1488(provide 'vi) 1488(provide 'vi)
1489 1489
1490;;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3 1490;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3
1491;;; vi.el ends here 1491;;; vi.el ends here
diff --git a/lisp/follow.el b/lisp/follow.el
index 06857fc49e9..a01b0e77eb2 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -1,6 +1,7 @@
1;;; follow.el --- synchronize windows showing the same buffer 1;;; follow.el --- synchronize windows showing the same buffer
2 2
3;; Copyright (C) 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1996, 1997, 1999, 2001, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Anders Lindgren <andersl@andersl.com> 6;; Author: Anders Lindgren <andersl@andersl.com>
6;; Maintainer: Anders Lindgren <andersl@andersl.com> 7;; Maintainer: Anders Lindgren <andersl@andersl.com>
@@ -708,7 +709,7 @@ Keys specific to Follow mode:
708;; This will start follow-mode whenever a new file is loaded, if 709;; This will start follow-mode whenever a new file is loaded, if
709;; the variable `follow-auto' is non-nil. 710;; the variable `follow-auto' is non-nil.
710 711
711(add-hook 'find-file-hooks 'follow-find-file-hook t) 712(add-hook 'find-file-hook 'follow-find-file-hook t)
712 713
713(defun follow-find-file-hook () 714(defun follow-find-file-hook ()
714 "Find-file hook for Follow Mode. See the variable `follow-auto'." 715 "Find-file hook for Follow Mode. See the variable `follow-auto'."
@@ -2347,5 +2348,5 @@ This prevents `mouse-drag-region' from messing things up."
2347;; | save it". -- Douglas Adams, "Last Chance to See" | 2348;; | save it". -- Douglas Adams, "Last Chance to See" |
2348;; \------------------------------------------------------------------------/ 2349;; \------------------------------------------------------------------------/
2349 2350
2350;;; arch-tag: 7b16bb1a-808c-4991-a8cc-66d3822936d0 2351;; arch-tag: 7b16bb1a-808c-4991-a8cc-66d3822936d0
2351;;; follow.el ends here 2352;;; follow.el ends here
diff --git a/lisp/generic.el b/lisp/generic.el
index ffd44d8762d..e20f73688c7 100644
--- a/lisp/generic.el
+++ b/lisp/generic.el
@@ -401,7 +401,7 @@ INI file. This hook is NOT installed by default."
401 (ini-generic-mode))))) 401 (ini-generic-mode)))))
402 402
403(and generic-use-find-file-hook 403(and generic-use-find-file-hook
404 (add-hook 'find-file-hooks 'generic-mode-find-file-hook)) 404 (add-hook 'find-file-hook 'generic-mode-find-file-hook))
405 405
406;;;###autoload 406;;;###autoload
407(defun generic-make-keywords-list (keywords-list face &optional prefix suffix) 407(defun generic-make-keywords-list (keywords-list face &optional prefix suffix)
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 81c7296760f..431087087f1 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -1,6 +1,6 @@
1;;; hi-lock.el --- minor mode for interactive automatic highlighting 1;;; hi-lock.el --- minor mode for interactive automatic highlighting
2 2
3;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc.
4 4
5;; Author: David M. Koppelman, koppel@ee.lsu.edu 5;; Author: David M. Koppelman, koppel@ee.lsu.edu
6;; Keywords: faces, minor-mode, matching, display 6;; Keywords: faces, minor-mode, matching, display
@@ -292,7 +292,7 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
292 (> (prefix-numeric-value arg) 0))) 292 (> (prefix-numeric-value arg) 0)))
293 ;; Turned on. 293 ;; Turned on.
294 (when (and (not hi-lock-mode-prev) hi-lock-mode) 294 (when (and (not hi-lock-mode-prev) hi-lock-mode)
295 (add-hook 'find-file-hooks 'hi-lock-find-file-hook) 295 (add-hook 'find-file-hook 'hi-lock-find-file-hook)
296 (add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook) 296 (add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook)
297 (when (eq nil font-lock-defaults) 297 (when (eq nil font-lock-defaults)
298 (setq font-lock-defaults '(nil))) 298 (setq font-lock-defaults '(nil)))
@@ -313,7 +313,7 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
313 hi-lock-file-patterns nil) 313 hi-lock-file-patterns nil)
314 (when font-lock-mode (hi-lock-refontify))))) 314 (when font-lock-mode (hi-lock-refontify)))))
315 (define-key-after menu-bar-edit-menu [hi-lock] nil) 315 (define-key-after menu-bar-edit-menu [hi-lock] nil)
316 (remove-hook 'find-file-hooks 'hi-lock-find-file-hook) 316 (remove-hook 'find-file-hook 'hi-lock-find-file-hook)
317 (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook)))) 317 (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook))))
318 318
319 319
@@ -568,5 +568,5 @@ Optional argument END is maximum excursion."
568 568
569(provide 'hi-lock) 569(provide 'hi-lock)
570 570
571;;; arch-tag: d2e8fd07-4cc9-4c6f-a200-1e729bc54066 571;; arch-tag: d2e8fd07-4cc9-4c6f-a200-1e729bc54066
572;;; hi-lock.el ends here 572;;; hi-lock.el ends here
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index f670079e7d7..8e84bbf68e2 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -993,12 +993,12 @@ changes are made, so \\[highlight-changes-next-change] and
993 993
994;; Global Highlight Changes mode is modeled after Global Font-lock mode. 994;; Global Highlight Changes mode is modeled after Global Font-lock mode.
995;; Three hooks are used to gain control. When Global Changes Mode is 995;; Three hooks are used to gain control. When Global Changes Mode is
996;; enabled, `find-file-hooks' and `change-major-mode-hook' are set. 996;; enabled, `find-file-hook' and `change-major-mode-hook' are set.
997;; `find-file-hooks' is called when visiting a file, the new mode is 997;; `find-file-hook' is called when visiting a file, the new mode is
998;; known at this time. 998;; known at this time.
999;; `change-major-mode-hook' is called when a buffer is changing mode. 999;; `change-major-mode-hook' is called when a buffer is changing mode.
1000;; This could be because of finding a file in which case 1000;; This could be because of finding a file in which case
1001;; `find-file-hooks' has already been called and has done its work. 1001;; `find-file-hook' has already been called and has done its work.
1002;; However, it also catches the case where a new mode is being set by 1002;; However, it also catches the case where a new mode is being set by
1003;; the user. However, it is called from `kill-all-variables' and at 1003;; the user. However, it is called from `kill-all-variables' and at
1004;; this time the mode is the old mode, which is not what we want. 1004;; this time the mode is the old mode, which is not what we want.
@@ -1080,18 +1080,18 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
1080 (setq global-highlight-changes t) 1080 (setq global-highlight-changes t)
1081 (message "Turning ON Global Highlight Changes mode in %s state" 1081 (message "Turning ON Global Highlight Changes mode in %s state"
1082 highlight-changes-global-initial-state) 1082 highlight-changes-global-initial-state)
1083 (add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook) 1083 ;; FIXME: Not sure what this was intended to do. --Stef
1084 (add-hook 'find-file-hooks 'hilit-chg-check-global) 1084 ;; (add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
1085 (add-hook 'find-file-hook 'hilit-chg-check-global)
1085 (if highlight-changes-global-changes-existing-buffers 1086 (if highlight-changes-global-changes-existing-buffers
1086 (hilit-chg-update-all-buffers 1087 (hilit-chg-update-all-buffers
1087 highlight-changes-global-initial-state))) 1088 highlight-changes-global-initial-state)))
1088 1089
1089 (message "Turning OFF global Highlight Changes mode") 1090 (message "Turning OFF global Highlight Changes mode")
1090 (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook) 1091 ;; FIXME: Not sure what this was intended to do. --Stef
1091 (remove-hook 'find-file-hooks 'hilit-chg-check-global) 1092 ;; (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
1092 (remove-hook 'post-command-hook 1093 (remove-hook 'post-command-hook 'hilit-chg-post-command-hook)
1093 'hilit-chg-post-command-hook) 1094 (remove-hook 'find-file-hook 'hilit-chg-check-global)
1094 (remove-hook 'find-file-hooks 'hilit-chg-check-global)
1095 (if highlight-changes-global-changes-existing-buffers 1095 (if highlight-changes-global-changes-existing-buffers
1096 (hilit-chg-update-all-buffers nil)))) 1096 (hilit-chg-update-all-buffers nil))))
1097 1097