diff options
| author | Stefan Monnier | 2017-04-26 10:03:17 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2017-04-26 10:03:17 -0400 |
| commit | 2d93d0d5bbe597972a715f7a02ddd039dc17da93 (patch) | |
| tree | adf04e5fccad395491cebb5f5ecdf485afd4fb8a | |
| parent | 7a4851e11b3bbc0fbfc7ea021b69374ab23eb882 (diff) | |
| download | emacs-2d93d0d5bbe597972a715f7a02ddd039dc17da93.tar.gz emacs-2d93d0d5bbe597972a715f7a02ddd039dc17da93.zip | |
* lisp/ido.el (ido-everywhere): Use add-function.
| -rw-r--r-- | lisp/ido.el | 16 |
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, | |||
| 1582 | enable the mode if ARG is omitted or nil." | 1582 | enable the mode if ARG is omitted or nil." |
| 1583 | :global t | 1583 | :global t |
| 1584 | :group 'ido | 1584 | :group 'ido |
| 1585 | (when (get 'ido-everywhere 'file) | 1585 | (remove-function read-file-name-function #'ido-read-file-name) |
| 1586 | (setq read-file-name-function (car (get 'ido-everywhere 'file))) | 1586 | (remove-function read-buffer-function #'ido-read-buffer) |
| 1587 | (put 'ido-everywhere 'file nil)) | ||
| 1588 | (when (get 'ido-everywhere 'buffer) | ||
| 1589 | (setq read-buffer-function (car (get 'ido-everywhere 'buffer))) | ||
| 1590 | (put 'ido-everywhere 'buffer nil)) | ||
| 1591 | (when ido-everywhere | 1587 | (when ido-everywhere |
| 1592 | (when (memq ido-mode '(both file)) | 1588 | (add-function :override read-file-name-function #'ido-read-file-name) |
| 1593 | (put 'ido-everywhere 'file (cons read-file-name-function nil)) | 1589 | (add-function :override read-buffer-function #'ido-read-buffer))) |
| 1594 | (setq read-file-name-function #'ido-read-file-name)) | ||
| 1595 | (when (memq ido-mode '(both buffer)) | ||
| 1596 | (put 'ido-everywhere 'buffer (cons read-buffer-function nil)) | ||
| 1597 | (setq read-buffer-function #'ido-read-buffer)))) | ||
| 1598 | 1590 | ||
| 1599 | (defvar ido-minor-mode-map-entry nil) | 1591 | (defvar ido-minor-mode-map-entry nil) |
| 1600 | 1592 | ||