changeset 60902:7160fe3a7ef1

find-file-hooks -> find-file-hook.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 24 Mar 2005 22:17:43 +0000
parents 40ec34686eeb
children 29db3b79c3fa
files lisp/emulation/vi.el lisp/follow.el lisp/generic.el lisp/hi-lock.el lisp/hilit-chg.el
diffstat 5 files changed, 47 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emulation/vi.el	Thu Mar 24 22:07:08 2005 +0000
+++ b/lisp/emulation/vi.el	Thu Mar 24 22:17:43 2005 +0000
@@ -1,7 +1,7 @@
 ;;; vi.el --- major mode for emulating "vi" editor under GNU Emacs
 
-; This file is in the public domain because the authors distributed it
-; without a copyright notice before the US signed the Bern Convention.
+;; This file is in the public domain because the authors distributed it
+;; without a copyright notice before the US signed the Bern Convention.
 
 ;; This file is part of GNU Emacs.
 
@@ -11,32 +11,32 @@
 
 ;;; Commentary:
 
-; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring)
-; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu)
-; Last revision: 01/07/87 Wed (for GNU Emacs 18.33)
+;; Originally written by : seismo!wucs!nz@rsch.wisc.edu (Neal Ziring)
+;; Extensively redesigned and rewritten by wu@crys.wisc.edu (Felix S.T. Wu)
+;; Last revision: 01/07/87 Wed (for GNU Emacs 18.33)
 
-; INSTALLATION PROCEDURE:
-; 1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of
-;    the single ESC used in real "vi", so I can access other ESC prefixed emacs
-;    commands while I'm in "vi"), say, by putting the following line in your
-;    ".emacs" file:
-;    (define-key global-map "\e\e" 'vi-mode) ;quick switch into vi-mode
-; 2) If you wish you can define "find-file-hooks" to enter "vi" automatically
-;    after a file is loaded into the buffer. For example, I defined it as:
-;    (setq find-file-hooks (list
-;                            (function (lambda ()
-;                                (if (not (or (eq major-mode 'Info-mode)
-;	                                      (eq major-mode 'vi-mode)))
-;                                    (vi-mode))))))
-; 3) In your .emacs file you can define the command "vi-mode" to be "autoload"
-;    or you can execute the "load" command to load "vi" directly.
-; 4) Read the comments for command "vi-mode" before you start using it.
-;
-; COULD DO
-; 1). A general 'define-operator' function to replace current hack
-; 2). In operator handling, should allow other point moving Emacs commands
-;     (such as ESC <, ESC >) to be used as arguments.
-;
+;; INSTALLATION PROCEDURE:
+;; 1) Add a global key binding for command "vi-mode" (I use ESC ESC instead of
+;;    the single ESC used in real "vi", so I can access other ESC prefixed emacs
+;;    commands while I'm in "vi"), say, by putting the following line in your
+;;    ".emacs" file:
+;;    (define-key global-map "\e\e" 'vi-mode) ;quick switch into vi-mode
+;; 2) If you wish you can define "find-file-hook" to enter "vi" automatically
+;;    after a file is loaded into the buffer. For example, I defined it as:
+;;    (setq find-file-hook (list
+;;                           (function (lambda ()
+;;                               (if (not (or (eq major-mode 'Info-mode)
+;; 	                                     (eq major-mode 'vi-mode)))
+;;                                   (vi-mode))))))
+;; 3) In your .emacs file you can define the command "vi-mode" to be "autoload"
+;;    or you can execute the "load" command to load "vi" directly.
+;; 4) Read the comments for command "vi-mode" before you start using it.
+
+;; COULD DO
+;; 1). A general 'define-operator' function to replace current hack
+;; 2). In operator handling, should allow other point moving Emacs commands
+;;     (such as ESC <, ESC >) to be used as arguments.
+
 ;;; Code:
 
 (defvar vi-mode-old-major-mode)
@@ -1487,5 +1487,5 @@
 
 (provide 'vi)
 
-;;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3
+;; arch-tag: ac9bdac3-8acb-4ddd-bdae-c6dd873153b3
 ;;; vi.el ends here
--- a/lisp/follow.el	Thu Mar 24 22:07:08 2005 +0000
+++ b/lisp/follow.el	Thu Mar 24 22:17:43 2005 +0000
@@ -1,6 +1,7 @@
 ;;; follow.el --- synchronize windows showing the same buffer
 
-;; Copyright (C) 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 1999, 2001, 2005
+;;           Free Software Foundation, Inc.
 
 ;; Author: Anders Lindgren <andersl@andersl.com>
 ;; Maintainer: Anders Lindgren <andersl@andersl.com>
@@ -708,7 +709,7 @@
 ;; This will start follow-mode whenever a new file is loaded, if
 ;; the variable `follow-auto' is non-nil.
 
-(add-hook 'find-file-hooks 'follow-find-file-hook t)
+(add-hook 'find-file-hook 'follow-find-file-hook t)
 
 (defun follow-find-file-hook ()
   "Find-file hook for Follow Mode.  See the variable `follow-auto'."
@@ -2347,5 +2348,5 @@
 ;; | save it".             -- Douglas Adams, "Last Chance to See"           |
 ;; \------------------------------------------------------------------------/
 
-;;; arch-tag: 7b16bb1a-808c-4991-a8cc-66d3822936d0
+;; arch-tag: 7b16bb1a-808c-4991-a8cc-66d3822936d0
 ;;; follow.el ends here
--- a/lisp/generic.el	Thu Mar 24 22:07:08 2005 +0000
+++ b/lisp/generic.el	Thu Mar 24 22:17:43 2005 +0000
@@ -401,7 +401,7 @@
 	      (ini-generic-mode)))))
 
 (and generic-use-find-file-hook
-    (add-hook 'find-file-hooks 'generic-mode-find-file-hook))
+    (add-hook 'find-file-hook 'generic-mode-find-file-hook))
 
 ;;;###autoload
 (defun generic-make-keywords-list (keywords-list face &optional prefix suffix)
--- a/lisp/hi-lock.el	Thu Mar 24 22:07:08 2005 +0000
+++ b/lisp/hi-lock.el	Thu Mar 24 22:17:43 2005 +0000
@@ -1,6 +1,6 @@
 ;;; hi-lock.el --- minor mode for interactive automatic highlighting
 
-;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2005  Free Software Foundation, Inc.
 
 ;; Author: David M. Koppelman, koppel@ee.lsu.edu
 ;; Keywords: faces, minor-mode, matching, display
@@ -292,7 +292,7 @@
             (> (prefix-numeric-value arg) 0)))
     ;; Turned on.
     (when (and (not hi-lock-mode-prev) hi-lock-mode)
-      (add-hook 'find-file-hooks 'hi-lock-find-file-hook)
+      (add-hook 'find-file-hook 'hi-lock-find-file-hook)
       (add-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook)
       (when (eq nil font-lock-defaults)
 	(setq font-lock-defaults '(nil)))
@@ -313,7 +313,7 @@
                   hi-lock-file-patterns nil)
             (when font-lock-mode (hi-lock-refontify)))))
       (define-key-after menu-bar-edit-menu [hi-lock] nil)
-      (remove-hook 'find-file-hooks 'hi-lock-find-file-hook)
+      (remove-hook 'find-file-hook 'hi-lock-find-file-hook)
       (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook))))
 
 
@@ -568,5 +568,5 @@
 
 (provide 'hi-lock)
 
-;;; arch-tag: d2e8fd07-4cc9-4c6f-a200-1e729bc54066
+;; arch-tag: d2e8fd07-4cc9-4c6f-a200-1e729bc54066
 ;;; hi-lock.el ends here
--- a/lisp/hilit-chg.el	Thu Mar 24 22:07:08 2005 +0000
+++ b/lisp/hilit-chg.el	Thu Mar 24 22:17:43 2005 +0000
@@ -993,12 +993,12 @@
 
 ;; Global Highlight Changes mode is modeled after Global Font-lock mode.
 ;; Three hooks are used to gain control.  When Global Changes Mode is
-;; enabled, `find-file-hooks' and `change-major-mode-hook' are set.
-;; `find-file-hooks' is called when visiting a file, the new mode is
+;; enabled, `find-file-hook' and `change-major-mode-hook' are set.
+;; `find-file-hook' is called when visiting a file, the new mode is
 ;; known at this time.
 ;; `change-major-mode-hook' is called when a buffer is changing mode.
 ;; This could be because of finding a file in which case
-;; `find-file-hooks' has already been called and has done its work.
+;; `find-file-hook' has already been called and has done its work.
 ;; However, it also catches the case where a new mode is being set by
 ;; the user.  However, it is called from `kill-all-variables' and at
 ;; this time the mode is the old mode, which is not what we want.
@@ -1080,18 +1080,18 @@
 	(setq global-highlight-changes t)
 	(message "Turning ON Global Highlight Changes mode in %s state"
 		 highlight-changes-global-initial-state)
-	(add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
-	(add-hook 'find-file-hooks 'hilit-chg-check-global)
+	;; FIXME: Not sure what this was intended to do.  --Stef
+	;; (add-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
+	(add-hook 'find-file-hook 'hilit-chg-check-global)
 	(if highlight-changes-global-changes-existing-buffers
 	    (hilit-chg-update-all-buffers
 	     highlight-changes-global-initial-state)))
 
     (message "Turning OFF global Highlight Changes mode")
-    (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
-    (remove-hook 'find-file-hooks 'hilit-chg-check-global)
-    (remove-hook 'post-command-hook
-		 'hilit-chg-post-command-hook)
-    (remove-hook 'find-file-hooks 'hilit-chg-check-global)
+    ;; FIXME: Not sure what this was intended to do.  --Stef
+    ;; (remove-hook 'hilit-chg-major-mode-hook 'hilit-chg-major-mode-hook)
+    (remove-hook 'post-command-hook 'hilit-chg-post-command-hook)
+    (remove-hook 'find-file-hook 'hilit-chg-check-global)
     (if highlight-changes-global-changes-existing-buffers
 	(hilit-chg-update-all-buffers nil))))