[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e6fff09 54/60: Don't choose ido prompting based on Emacs v
From: |
João Távora |
Subject: |
[elpa] master e6fff09 54/60: Don't choose ido prompting based on Emacs version |
Date: |
Thu, 21 Jan 2016 22:36:07 +0000 |
branch: master
commit e6fff091f2c179fa4b48514d1b3dcab9fb8fee18
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
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.
---
yasnippet.el | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index b74cc10..2a28010 100644
--- a/yasnippet.el
+++ b/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)
- [elpa] master 17fe790 51/60: Fix #515; only clear field on self-insert, (continued)
- [elpa] master 17fe790 51/60: Fix #515; only clear field on self-insert, João Távora, 2016/01/21
- [elpa] master 67a45a6 48/60: * README.mdown: Add link to textmate-to-yas.el., João Távora, 2016/01/21
- [elpa] master c80fbf2 49/60: Cleanup yas--on-field-overlay-modification, João Távora, 2016/01/21
- [elpa] master 444c882 47/60: * README.mdown: update melpa URL., João Távora, 2016/01/21
- [elpa] master 61261c9 53/60: Fix #576; don't override yas-prompt-functions, João Távora, 2016/01/21
- [elpa] master a2c5292 55/60: Bless Noam Postavsky as the new official maintainer, João Távora, 2016/01/21
- [elpa] master cd05da6 36/60: Activate extra and major modes first, João Távora, 2016/01/21
- [elpa] master 3cd64b7 45/60: yasnippet.el (yas--called-interactively-p): Remove., João Távora, 2016/01/21
- [elpa] master 140c415 52/60: Respect y-b-l-cond from binding triggered snippets, João Távora, 2016/01/21
- [elpa] master 71f0142 50/60: Improve test simulatulation of self-insert, João Távora, 2016/01/21
- [elpa] master e6fff09 54/60: Don't choose ido prompting based on Emacs version,
João Távora <=
- [elpa] master af90528 56/60: Fix debugging code for newer Emacsen, João Távora, 2016/01/21
- [elpa] master 100d8d1 57/60: Fix bug reporting examples., João Távora, 2016/01/21
- [elpa] master 46256db 58/60: Fix #648; create ~/.emacs.d/snippets automatically, João Távora, 2016/01/21
- [elpa] master 1a98c38 59/60: Fix silly mistake in previous commit, João Távora, 2016/01/21
- [elpa] master 5817fe1 60/60: Update packages/yasnippet by subtree-merging from its external upstream, João Távora, 2016/01/21