emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/lisp/ido.el
Date: Fri, 08 Jul 2005 05:44:47 -0400

Index: emacs/lisp/ido.el
diff -c emacs/lisp/ido.el:1.64 emacs/lisp/ido.el:1.65
*** emacs/lisp/ido.el:1.64      Mon Jul  4 23:08:54 2005
--- emacs/lisp/ido.el   Fri Jul  8 09:44:47 2005
***************
*** 881,886 ****
--- 881,892 ----
    :type '(repeat symbol)
    :group 'ido)
  
+ (defcustom ido-before-fallback-functions '()
+   "List of functions to call before calling a fallback command.
+ The fallback command is passed as an argument to the functions."
+   :type 'hook
+   :group 'ido)
+ 
  ;;; Internal Variables
  
  ;; Persistent variables
***************
*** 1918,1924 ****
  (defun ido-buffer-internal (method &optional fallback prompt default initial 
switch-cmd)
    ;; Internal function for ido-switch-buffer and friends
    (if (not ido-mode)
!       (call-interactively (or fallback 'switch-to-buffer))
      (let* ((ido-context-switch-command switch-cmd)
           (ido-current-directory nil)
           (ido-directory-nonreadable nil)
--- 1924,1933 ----
  (defun ido-buffer-internal (method &optional fallback prompt default initial 
switch-cmd)
    ;; Internal function for ido-switch-buffer and friends
    (if (not ido-mode)
!       (progn
!       (run-hook-with-args 'ido-before-fallback-functions
!                           (or fallback 'switch-to-buffer))
!       (call-interactively (or fallback 'switch-to-buffer)))
      (let* ((ido-context-switch-command switch-cmd)
           (ido-current-directory nil)
           (ido-directory-nonreadable nil)
***************
*** 1937,1942 ****
--- 1946,1953 ----
  
         ((eq ido-exit 'fallback)
        (let ((read-buffer-function nil))
+         (run-hook-with-args 'ido-before-fallback-functions
+                             (or fallback 'switch-to-buffer))
          (call-interactively (or fallback 'switch-to-buffer))))
  
         ;; Check buf is non-nil.
***************
*** 2068,2073 ****
--- 2079,2086 ----
        ;; we don't want to change directory of current buffer.
        (let ((default-directory ido-current-directory)
              (read-file-name-function nil))
+         (run-hook-with-args 'ido-before-fallback-functions
+                             (or fallback 'find-file))
          (call-interactively (or fallback 'find-file))))
  
         ((eq ido-exit 'switch-to-buffer)
***************
*** 2134,2139 ****
--- 2147,2153 ----
        (setq filename (concat ido-current-directory filename))
        (ido-record-command fallback filename)
        (ido-record-work-directory)
+       (run-hook-with-args 'ido-before-fallback-functions fallback)
        (funcall fallback filename))
  
         ((eq method 'insert)
***************
*** 4210,4215 ****
--- 4224,4230 ----
         (buf (ido-read-internal 'buffer prompt 'ido-buffer-history default 
require-match)))
      (if (eq ido-exit 'fallback)
        (let ((read-buffer-function nil))
+         (run-hook-with-args 'ido-before-fallback-functions 'read-buffer)
          (read-buffer prompt default require-match))
        buf)))
  
***************
*** 4256,4261 ****
--- 4271,4277 ----
        (setq filename 'fallback)))
      (if (eq filename 'fallback)
        (let ((read-file-name-function nil))
+         (run-hook-with-args 'ido-before-fallback-functions 'read-file-name)
          (read-file-name prompt dir default-filename mustmatch initial 
predicate))
        filename)))
  




reply via email to

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