Changeset 8674 for lang/elisp
- Timestamp:
- 04/02/08 21:45:43 (8 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/anything-c-yasnippet/anything-c-yasnippet.el
r8612 r8674 2 2 3 3 ;; Author: Kenji.I (Kenji Imakado) <ken.imakaado@gmail.com> 4 ;; Version: 0. 34 ;; Version: 0.4 5 5 ;; Keywords: anything yasnippet 6 6 … … 72 72 73 73 ;;; Code 74 (defvar anything-c-yas-version "0. 3" "Version of anything-c-yasnippet")74 (defvar anything-c-yas-version "0.4" "Version of anything-c-yasnippet") 75 75 76 76 (defgroup anything-c-yasnippet nil … … 87 87 :group 'anything-c-yasnippet) 88 88 89 ;(defvar anything-c-yas-snippets-dir-list nil) ;;customizable list of path(string) for finding snippet file in Action90 89 (defcustom anything-c-yas-snippets-dir-list nil 91 90 "list of directory used to find snippet file" … … 100 99 quite convenience 101 100 Default: nil" 101 :type 'boolean 102 :group 'anything-c-yasnippet) 103 104 (defcustom anything-c-yas-display-key-on-candidate nil 105 "if non-nil anything display candidate(snippet name) include key 106 ex. [for] for (...) { ... } 107 otherwise display just name 108 ex. for (...) { ... }" 102 109 :type 'boolean 103 110 :group 'anything-c-yasnippet) … … 206 213 "Return list of dotlist, (DISPLAY . REAL) DISPLAY is name of snippet, REAL is template of snippet" 207 214 (let ((transformed-list (assoc-default 'transformed alist 'eq))) 208 (setq transformed-list (remove-if-not (lambda (lst) 209 (string-match (concat "^" (regexp-quote initial-input)) (car lst))) 210 transformed-list)) 215 (cond 216 ;; display key on candidate ex: [for] for (...) { ... } 217 (anything-c-yas-display-key-on-candidate 218 (setq transformed-list (remove-if-not (lambda (lst) 219 (string-match (concat "^" (regexp-quote initial-input)) (car lst))) 220 transformed-list)) 221 (setq transformed-list (loop for dotlst in transformed-list 222 for name = (car dotlst) 223 for template = (cdr dotlst) 224 for key = (anything-c-yas-get-key-by-template template alist) 225 for name-inc-key = (concat "[" key "] " name) 226 collect `(,name-inc-key . ,template)))) 227 ;; default ex: for (...) { ... } 228 (t 229 (setq transformed-list (remove-if-not (lambda (lst) 230 (string-match (concat "^" (regexp-quote initial-input)) (car lst))) 231 transformed-list)))) 211 232 (when anything-c-yas-not-display-dups 212 233 (setq transformed-list (delete-dups transformed-list))) … … 275 296 (anything-c-yas-initial-input anything-c-yas-point-start anything-c-yas-point-end) (anything-c-yas-get-cmp-context)) ;return values(str point point) 276 297 (setq anything-c-yas-cur-snippets-alist (anything-c-yas-build-cur-snippets-alist)))) 277 ;; (candidates . (lambda ()278 ;; (anything-c-yas-get-candidates anything-c-yas-cur-snippets-alist)))279 298 (candidates . (anything-c-yas-get-candidates anything-c-yas-cur-snippets-alist)) 280 299 (candidate-transformer . (lambda (candidates)
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)