emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/find-file.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/find-file.el
Date: Mon, 09 Sep 2002 18:45:09 -0400

Index: emacs/lisp/find-file.el
diff -c emacs/lisp/find-file.el:1.18 emacs/lisp/find-file.el:1.19
*** emacs/lisp/find-file.el:1.18        Fri Apr 26 10:40:21 2002
--- emacs/lisp/find-file.el     Mon Sep  9 18:45:09 2002
***************
*** 101,113 ****
  ;;
  ;; THERE ARE FIVE AVAILABLE HOOKS, called in this order if non-nil:
  ;;
! ;; - ff-pre-find-hooks     - called before the search for the other file 
starts
! ;; - ff-not-found-hooks    - called when the other file could not be found
! ;; - ff-pre-load-hooks     - called just before the other file is 'loaded'
! ;; - ff-file-created-hooks - called when the other file is created
! ;; - ff-post-load-hooks    - called just after the other file is 'loaded'
  ;;
! ;; The *load-hooks allow you to place point where you want it in the other
  ;; file.
  
  ;; CREDITS:
--- 101,113 ----
  ;;
  ;; THERE ARE FIVE AVAILABLE HOOKS, called in this order if non-nil:
  ;;
! ;; - ff-pre-find-hook     - called before the search for the other file starts
! ;; - ff-not-found-hook    - called when the other file could not be found
! ;; - ff-pre-load-hook     - called just before the other file is 'loaded'
! ;; - ff-file-created-hook - called when the other file is created
! ;; - ff-post-load-hook    - called just after the other file is 'loaded'
  ;;
! ;; The *load-hook allow you to place point where you want it in the other
  ;; file.
  
  ;; CREDITS:
***************
*** 130,156 ****
    :link '(emacs-commentary-link "find-file")
    :group 'find-file)
  
! (defcustom ff-pre-find-hooks nil
    "*List of functions to be called before the search for the file starts."
    :type 'hook
    :group 'ff)
  
! (defcustom ff-pre-load-hooks nil
    "*List of functions to be called before the other file is loaded."
    :type 'hook
    :group 'ff)
  
! (defcustom ff-post-load-hooks nil
    "*List of functions to be called after the other file is loaded."
    :type 'hook
    :group 'ff)
  
! (defcustom ff-not-found-hooks nil
    "*List of functions to be called if the other file could not be found."
    :type 'hook
    :group 'ff)
  
! (defcustom ff-file-created-hooks nil
    "*List of functions to be called if the other file needs to be created."
    :type 'hook
    :group 'ff)
--- 130,156 ----
    :link '(emacs-commentary-link "find-file")
    :group 'find-file)
  
! (defcustom ff-pre-find-hook nil
    "*List of functions to be called before the search for the file starts."
    :type 'hook
    :group 'ff)
  
! (defcustom ff-pre-load-hook nil
    "*List of functions to be called before the other file is loaded."
    :type 'hook
    :group 'ff)
  
! (defcustom ff-post-load-hook nil
    "*List of functions to be called after the other file is loaded."
    :type 'hook
    :group 'ff)
  
! (defcustom ff-not-found-hook nil
    "*List of functions to be called if the other file could not be found."
    :type 'hook
    :group 'ff)
  
! (defcustom ff-file-created-hook nil
    "*List of functions to be called if the other file needs to be created."
    :type 'hook
    :group 'ff)
***************
*** 284,294 ****
  ;; No user definable variables beyond this point!
  ;; ==============================================
  
! (make-variable-buffer-local 'ff-pre-find-hooks)
! (make-variable-buffer-local 'ff-pre-load-hooks)
! (make-variable-buffer-local 'ff-post-load-hooks)
! (make-variable-buffer-local 'ff-not-found-hooks)
! (make-variable-buffer-local 'ff-file-created-hooks)
  (make-variable-buffer-local 'ff-case-fold-search)
  (make-variable-buffer-local 'ff-always-in-other-window)
  (make-variable-buffer-local 'ff-ignore-include)
--- 284,294 ----
  ;; No user definable variables beyond this point!
  ;; ==============================================
  
! (make-variable-buffer-local 'ff-pre-find-hook)
! (make-variable-buffer-local 'ff-pre-load-hook)
! (make-variable-buffer-local 'ff-post-load-hook)
! (make-variable-buffer-local 'ff-not-found-hook)
! (make-variable-buffer-local 'ff-file-created-hook)
  (make-variable-buffer-local 'ff-case-fold-search)
  (make-variable-buffer-local 'ff-always-in-other-window)
  (make-variable-buffer-local 'ff-ignore-include)
***************
*** 350,368 ****
     List of directories searched through with each extension specified in
     `ff-other-file-alist' that matches this file's extension.
  
!  - `ff-pre-find-hooks'
     List of functions to be called before the search for the file starts.
  
!  - `ff-pre-load-hooks'
     List of functions to be called before the other file is loaded.
  
!  - `ff-post-load-hooks'
     List of functions to be called after the other file is loaded.
  
!  - `ff-not-found-hooks'
     List of functions to be called if the other file could not be found.
  
!  - `ff-file-created-hooks'
     List of functions to be called if the other file has been created."
    (interactive "P")
    (let ((ignore ff-ignore-include))
--- 350,368 ----
     List of directories searched through with each extension specified in
     `ff-other-file-alist' that matches this file's extension.
  
!  - `ff-pre-find-hook'
     List of functions to be called before the search for the file starts.
  
!  - `ff-pre-load-hook'
     List of functions to be called before the other file is loaded.
  
!  - `ff-post-load-hook'
     List of functions to be called after the other file is loaded.
  
!  - `ff-not-found-hook'
     List of functions to be called if the other file could not be found.
  
!  - `ff-file-created-hook'
     List of functions to be called if the other file has been created."
    (interactive "P")
    (let ((ignore ff-ignore-include))
***************
*** 394,401 ****
          dirs            ;; local value of ff-search-directories
          no-match)       ;; whether we know about this kind of file
  
!     (if ff-pre-find-hooks
!         (run-hooks 'ff-pre-find-hooks))
  
      (message "Working...")
  
--- 394,400 ----
          dirs            ;; local value of ff-search-directories
          no-match)       ;; whether we know about this kind of file
  
!     (run-hooks 'ff-pre-find-hook 'ff-pre-find-hooks)
  
      (message "Working...")
  
***************
*** 486,493 ****
  
         ((not found)                ;; could not find the other file
  
!         (if ff-not-found-hooks     ;; run the hooks
!             (run-hooks 'ff-not-found-hooks))
  
          (cond
           (ff-always-try-to-create  ;; try to create the file
--- 485,491 ----
  
         ((not found)                ;; could not find the other file
  
!       (run-hooks 'ff-not-found-hook 'ff-not-found-hooks)
  
          (cond
           (ff-always-try-to-create  ;; try to create the file
***************
*** 823,842 ****
  F1 and F2 are typically `find-file' / `find-file-other-window'
  or `switch-to-buffer' / `switch-to-buffer-other-window' function pairs.
  
! If optional NEW-FILE is t, then a special hook (`ff-file-created-hooks') is
! called before `ff-post-load-hooks'."
!   (if ff-pre-load-hooks
!       (run-hooks 'ff-pre-load-hooks))
    (if (or
         (and in-other-window (not ff-always-in-other-window))
         (and (not in-other-window) ff-always-in-other-window))
        (funcall f2 file)
      (funcall f1 file))
    (if new-file
!       (if ff-file-created-hooks
!           (run-hooks 'ff-file-created-hooks)))
!   (if ff-post-load-hooks
!       (run-hooks 'ff-post-load-hooks)))
  
  (defun ff-find-file (file &optional in-other-window new-file)
    "Like `find-file', but may show the file in another window."
--- 821,837 ----
  F1 and F2 are typically `find-file' / `find-file-other-window'
  or `switch-to-buffer' / `switch-to-buffer-other-window' function pairs.
  
! If optional NEW-FILE is t, then a special hook (`ff-file-created-hook') is
! called before `ff-post-load-hook'."
!   (run-hooks 'ff-pre-load-hook 'ff-pre-load-hooks)
    (if (or
         (and in-other-window (not ff-always-in-other-window))
         (and (not in-other-window) ff-always-in-other-window))
        (funcall f2 file)
      (funcall f1 file))
    (if new-file
!       (run-hooks 'ff-file-created-hook 'ff-file-created-hooks))
!   (run-hooks 'ff-post-load-hook 'ff-post-load-hooks))
  
  (defun ff-find-file (file &optional in-other-window new-file)
    "Like `find-file', but may show the file in another window."
***************
*** 947,953 ****
  
  ;(eval-when-compile (require 'ada-mode))
  
! ;; bind with (setq ff-pre-load-hooks 'ff-which-function-are-we-in)
  ;;
  (defun ff-which-function-are-we-in ()
    "Return the name of the function whose definition/declaration point is in.
--- 942,948 ----
  
  ;(eval-when-compile (require 'ada-mode))
  
! ;; bind with (setq ff-pre-load-hook 'ff-which-function-are-we-in)
  ;;
  (defun ff-which-function-are-we-in ()
    "Return the name of the function whose definition/declaration point is in.
***************
*** 965,971 ****
                                                     (match-end 0)))
          ))))
  
! ;; bind with (setq ff-post-load-hooks 'ff-set-point-accordingly)
  ;;
  (defun ff-set-point-accordingly ()
    "Find the function specified in `ff-function-name'.
--- 960,966 ----
                                                     (match-end 0)))
          ))))
  
! ;; bind with (setq ff-post-load-hook 'ff-set-point-accordingly)
  ;;
  (defun ff-set-point-accordingly ()
    "Find the function specified in `ff-function-name'.




reply via email to

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