summaryrefslogtreecommitdiff
path: root/lisp/ido.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2015-03-16 14:49:01 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2015-03-16 14:49:01 -0400
commitf925fc93bac41d7622d1af927e33b0e738ff55b0 (patch)
treee8635662256290a1662a299b66e32f6301535200 /lisp/ido.el
parent43a847c02c3eb848cd0d55a4722bfe7f39b1112f (diff)
downloademacs-f925fc93bac41d7622d1af927e33b0e738ff55b0.tar.gz
Add `predicate' arg to `read-buffer' and use it for erc-iswitchb
Fixes: debbugs:20116 * src/minibuf.c (Fread_buffer): Add `predicate' argument. * src/callint.c (Fcall_interactively): Adjust calls accordingly. * lisp/erc/erc.el (erc-switch-to-buffer): Rename from erc-iswitchb and rewrite using read-buffer. (erc--buffer-p): New function, extracted from erc-buffer-filter. (erc-buffer-filter): Use it. (erc-with-all-buffers-of-server): Silence compile warning if the return value is unused. (erc-is-valid-nick-p, erc-common-server-suffixes, erc-get-arglist) (erc-command-name, erc-popup-input-buffer): Use \` and \' to match beg/end of string. * lisp/obsolete/iswitchb.el (iswitchb-read-buffer): Add `predicate' arg. * lisp/isearchb.el (isearchb-iswitchb): Adjust accordingly. * lisp/ido.el (ido-read-buffer): Add `predicate' argument. * lisp/misearch.el (unload-function-defs-list): Declare before use.
Diffstat (limited to 'lisp/ido.el')
-rw-r--r--lisp/ido.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index 563f406aeb6..60a59d6e99d 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1590,10 +1590,10 @@ enable the mode if ARG is omitted or nil."
(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))
+ (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))))
+ (setq read-buffer-function #'ido-read-buffer))))
(defvar ido-minor-mode-map-entry nil)
@@ -4782,7 +4782,7 @@ Modified from `icomplete-completions'."
(put 'dired-do-rename 'ido 'ignore)
;;;###autoload
-(defun ido-read-buffer (prompt &optional default require-match)
+(defun ido-read-buffer (prompt &optional default require-match predicate)
"Ido replacement for the built-in `read-buffer'.
Return the name of a buffer selected.
PROMPT is the prompt to give to the user. DEFAULT if given is the default
@@ -4796,7 +4796,7 @@ If REQUIRE-MATCH is non-nil, an existing buffer must be selected."
(if (eq ido-exit 'fallback)
(let ((read-buffer-function nil))
(run-hook-with-args 'ido-before-fallback-functions 'read-buffer)
- (read-buffer prompt default require-match))
+ (read-buffer prompt default require-match predicate))
buf)))
;;;###autoload