(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