Commit 2d93d0d5 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/ido.el (ido-everywhere): Use add-function.

parent 7a4851e1
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment