summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2017-04-26 10:03:17 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2017-04-26 10:03:17 -0400
commit2d93d0d5bbe597972a715f7a02ddd039dc17da93 (patch)
treeadf04e5fccad395491cebb5f5ecdf485afd4fb8a
parent7a4851e11b3bbc0fbfc7ea021b69374ab23eb882 (diff)
downloademacs-2d93d0d5bbe597972a715f7a02ddd039dc17da93.tar.gz
* lisp/ido.el (ido-everywhere): Use add-function.
-rw-r--r--lisp/ido.el16
1 files changed, 4 insertions, 12 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index 318f2fe082a..1393d3b7107 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1582,19 +1582,11 @@ positive, and disable it otherwise. If called from Lisp,
enable the mode if ARG is omitted or nil."
:global t
:group 'ido
- (when (get 'ido-everywhere 'file)
- (setq read-file-name-function (car (get 'ido-everywhere 'file)))
- (put 'ido-everywhere 'file nil))
- (when (get 'ido-everywhere 'buffer)
- (setq read-buffer-function (car (get 'ido-everywhere 'buffer)))
- (put 'ido-everywhere 'buffer nil))
+ (remove-function read-file-name-function #'ido-read-file-name)
+ (remove-function read-buffer-function #'ido-read-buffer)
(when ido-everywhere
- (when (memq ido-mode '(both file))
- (put 'ido-everywhere 'file (cons read-file-name-function nil))
- (setq read-file-name-function #'ido-read-file-name))
- (when (memq ido-mode '(both buffer))
- (put 'ido-everywhere 'buffer (cons read-buffer-function nil))
- (setq read-buffer-function #'ido-read-buffer))))
+ (add-function :override read-file-name-function #'ido-read-file-name)
+ (add-function :override read-buffer-function #'ido-read-buffer)))
(defvar ido-minor-mode-map-entry nil)