# HG changeset patch # User Kim F. Storm # Date 1114369753 0 # Node ID 083f920d9c86571e4854f6e639a0c82c5a096934 # Parent af1e99c64e7158f82ffc1a596674da33b15c91d9 (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 -r af1e99c64e71 -r 083f920d9c86 lisp/ido.el --- a/lisp/ido.el Sun Apr 24 19:08:56 2005 +0000 +++ b/lisp/ido.el Sun Apr 24 19:09:13 2005 +0000 @@ -1346,12 +1346,21 @@ (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