mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Don't choose ido prompting based on Emacs version
* yasnippet.el (yas-ido-prompt): Unconditionally use ido prompting, explicitly requireing ido. (yas-maybe-ido-prompt): New function, call `yas-ido-prompt' if `ido-mode' is enabled. (yas-prompt-functions): Replace `yas-ido-prompt' with `yas-maybe-ido-prompt' in the default value.
This commit is contained in:
parent
61261c9bb4
commit
e6fff091f2
12
yasnippet.el
12
yasnippet.el
@ -216,7 +216,7 @@ If nil, don't use any snippet."
|
||||
(defcustom yas-prompt-functions '(yas-x-prompt
|
||||
yas-dropdown-prompt
|
||||
yas-completing-prompt
|
||||
yas-ido-prompt
|
||||
yas-maybe-ido-prompt
|
||||
yas-no-prompt)
|
||||
"Functions to prompt for keys, templates, etc interactively.
|
||||
|
||||
@ -1585,11 +1585,13 @@ Optional PROMPT sets the prompt to use."
|
||||
(if display-fn (mapcar display-fn choices) choices)))))
|
||||
(keyboard-quit))))
|
||||
|
||||
(defun yas-maybe-ido-prompt (prompt choices &optional display-fn)
|
||||
(when (bound-and-true-p ido-mode)
|
||||
(yas-ido-prompt prompt choices display-fn)))
|
||||
|
||||
(defun yas-ido-prompt (prompt choices &optional display-fn)
|
||||
(when (and (fboundp 'ido-completing-read)
|
||||
(or (>= emacs-major-version 24)
|
||||
ido-mode))
|
||||
(yas-completing-prompt prompt choices display-fn #'ido-completing-read)))
|
||||
(require 'ido)
|
||||
(yas-completing-prompt prompt choices display-fn #'ido-completing-read))
|
||||
|
||||
(defun yas-dropdown-prompt (_prompt choices &optional display-fn)
|
||||
(when (fboundp 'dropdown-list)
|
||||
|
Loading…
x
Reference in New Issue
Block a user