[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 43a501a 103/177: remove yas--x-pretty-prompt-templates
From: |
João Távora |
Subject: |
[elpa] master 43a501a 103/177: remove yas--x-pretty-prompt-templates |
Date: |
Sat, 28 Mar 2015 15:41:14 +0000 |
branch: master
commit 43a501aa567d5507e9797c30ab7dc98a13565d4e
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
remove yas--x-pretty-prompt-templates
---
yasnippet.el | 51 +++++++--------------------------------------------
1 files changed, 7 insertions(+), 44 deletions(-)
diff --git a/yasnippet.el b/yasnippet.el
index 62a1d8f..1a87e39 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -1489,10 +1489,6 @@ Here's a list of currently recognized directives:
;;; Popping up for keys and templates
-(defvar yas--x-pretty-prompt-templates nil
- "If non-nil, attempt to prompt for templates like TextMate.")
-
-
(defun yas--prompt-for-template (templates &optional prompt)
"Interactively choose a template from the list TEMPLATES.
@@ -1504,13 +1500,11 @@ Optional PROMPT sets the prompt to use."
(sort templates #'(lambda (t1 t2)
(< (length (yas--template-name t1))
(length (yas--template-name t2))))))
- (if yas--x-pretty-prompt-templates
- (yas--x-pretty-prompt-templates "Choose a snippet" templates)
- (some #'(lambda (fn)
- (funcall fn (or prompt "Choose a snippet: ")
- templates
- #'yas--template-name))
- yas-prompt-functions))))
+ (some #'(lambda (fn)
+ (funcall fn (or prompt "Choose a snippet: ")
+ templates
+ #'yas--template-name))
+ yas-prompt-functions)))
(defun yas--prompt-for-keys (keys &optional prompt)
"Interactively choose a template key from the list KEYS.
@@ -1556,37 +1550,6 @@ Optional PROMPT sets the prompt to use."
(if display-fn (mapcar display-fn choices)
choices)))))
(keyboard-quit))))
-(defun yas--x-pretty-prompt-templates (prompt templates)
- "Display TEMPLATES, grouping neatly by table name."
- (let ((organized (make-hash-table :test #'equal))
- menu
- more-than-one-table
- prefix)
- (dolist (tl templates)
- (puthash (yas--template-table tl)
- (cons tl
- (gethash (yas--template-table tl) organized))
- organized))
- (setq more-than-one-table (> (hash-table-count organized) 1))
- (setq prefix (if more-than-one-table
- " " ""))
- (if more-than-one-table
- (maphash #'(lambda (table templates)
- (push (yas--table-name table) menu)
- (dolist (tl templates)
- (push (cons (concat prefix (yas--template-name tl)) tl)
menu))) organized)
- (setq menu (mapcar #'(lambda (tl) (cons (concat prefix
(yas--template-name tl)) tl)) templates)))
-
- (setq menu (nreverse menu))
- (or (x-popup-menu (if (fboundp 'posn-at-point)
- (let ((x-y (posn-x-y (posn-at-point (point)))))
- (list (list (+ (car x-y) 10)
- (+ (cdr x-y) 20))
- (selected-window)))
- t)
- (list prompt (push "title" menu)))
- (keyboard-quit))))
-
(defun yas-ido-prompt (prompt choices &optional display-fn)
(when (and (fboundp 'ido-completing-read)
(or (>= emacs-major-version 24)
@@ -2224,8 +2187,8 @@ Prompt the user if TEMPLATES has more than one element,
else
expand immediately. Common gateway for
`yas-expand-from-trigger-key' and `yas-expand-from-keymap'."
(let ((yas--current-template (or (and (rest templates) ;; more than one
- (yas--prompt-for-template (mapcar #'cdr
templates)))
- (cdar templates))))
+ (yas--prompt-for-template (mapcar
#'cdr templates)))
+ (cdar templates))))
(when yas--current-template
(yas-expand-snippet (yas--template-content yas--current-template)
start
- [elpa] master 0f8c2ab 094/177: Add `yas-after-reload-hook' and run it at the end of `yas-reload-all', (continued)
- [elpa] master 0f8c2ab 094/177: Add `yas-after-reload-hook' and run it at the end of `yas-reload-all', João Távora, 2015/03/28
- [elpa] master 987942c 095/177: update snippets submodule, João Távora, 2015/03/28
- [elpa] master c128580 096/177: yasnippet templates don't add newlines, João Távora, 2015/03/28
- [elpa] master 83c174c 097/177: Merge pull request #464 from kidd/master, João Távora, 2015/03/28
- [elpa] master 12b7f82 092/177: Add Travis CI and update tests. Start a Changelog., João Távora, 2015/03/28
- [elpa] master 3744f92 098/177: avoid double choices reversing, João Távora, 2015/03/28
- [elpa] master 1fc858f 099/177: Remove experimental Changelog file, João Távora, 2015/03/28
- [elpa] master 4d220f7 100/177: Remove an obsolete hack notice, João Távora, 2015/03/28
- [elpa] master 4470110 101/177: display-fn isn't actually used for filtering, João Távora, 2015/03/28
- [elpa] master c07db05 102/177: yas-x-prompt: remove dead code, João Távora, 2015/03/28
- [elpa] master 43a501a 103/177: remove yas--x-pretty-prompt-templates,
João Távora <=
- [elpa] master 8e7295b 108/177: Closes #403: more uniform behaviour for `yas-use-menu', João Távora, 2015/03/28
- [elpa] master 498cbe4 105/177: Closes #469: Don't use `yas--init-minor-keymap', João Távora, 2015/03/28
- [elpa] master e7599b9 104/177: Merge pull request #466 from npostavs/no-reverse, João Távora, 2015/03/28
- [elpa] master a4e04f9 109/177: update doc for org 8.x, João Távora, 2015/03/28
- [elpa] master a0c2217 110/177: Merge pull request #473 from npostavs/org8, João Távora, 2015/03/28
- [elpa] master b36a4f7 107/177: Properly closes #469: Don't use `yas--init-minor-keymap', João Távora, 2015/03/28
- [elpa] master d809e88 106/177: Revert "Closes #469: Don't use `yas--init-minor-keymap'", João Távora, 2015/03/28
- [elpa] master 599a262 113/177: Closes #474: fix cc-mode fontification conflict, João Távora, 2015/03/28
- [elpa] master a80033d 115/177: Refactor yas-good-grace error handling, João Távora, 2015/03/28
- [elpa] master 4d9eee9 111/177: Simpler, more effective .travis file, João Távora, 2015/03/28