From: Kim F. Storm Date: Sun, 24 Apr 2005 19:09:13 +0000 (+0000) Subject: (ido-everywhere): Save and restore old read-buffer-function X-Git-Tag: ttn-vms-21-2-B4~768 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb7216f7ebd4545642e819c1d655e72a3cc85444;p=emacs.git (ido-everywhere): Save and restore old read-buffer-function and read-file-name-function values. Don't overwrite existing non-nil values if ido-mode is enabled without ido-everywhere. --- diff --git a/lisp/ido.el b/lisp/ido.el index 4409c3653c9..1c95676db0a 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1346,12 +1346,21 @@ This function also adds a hook to the minibuffer." (setq ido-everywhere (if arg (> (prefix-numeric-value arg) 0) (not ido-everywhere))) - (setq read-file-name-function - (and ido-everywhere (memq ido-mode '(both file)) - 'ido-read-file-name)) - (setq read-buffer-function - (and ido-everywhere (memq ido-mode '(both buffer)) - 'ido-read-buffer))) + (when (get 'ido-everywhere 'file) + (setq read-file-name-function (get 'ido-everywhere 'file)) + (put 'ido-everywhere 'file nil)) + (when (get 'ido-everywhere 'buffer) + (setq read-buffer-function (get 'ido-everywhere 'buffer)) + (put 'ido-everywhere 'buffer nil)) + (when ido-everywhere + (when (memq ido-mode '(both file)) + (unless (get 'ido-everywhere 'file) + (put 'ido-everywhere 'file read-file-name-function)) + (setq read-file-name-function 'ido-read-file-name)) + (when (memq ido-mode '(both buffer)) + (unless (get 'ido-everywhere 'buffer) + (put 'ido-everywhere 'buffer read-buffer-function)) + (setq read-buffer-function 'ido-read-buffer)))) ;;; IDO KEYMAP