]> code.delx.au - gnu-emacs-elpa/commitdiff
more compatible with dropdown-list.el
authorZhang Chiyuan <pluskid@gmail.com>
Sun, 16 Mar 2008 03:41:12 +0000 (03:41 +0000)
committerZhang Chiyuan <pluskid@gmail.com>
Sun, 16 Mar 2008 03:41:12 +0000 (03:41 +0000)
yasnippet.el

index 6dc3f134d71eb2abaa64591b373cf5657e9f48e2..5ce5f6408739dd35f02292958fb3d2ba1c3b1e2d 100644 (file)
@@ -769,12 +769,14 @@ You can also use this in window-system.
 
 NOTE: You need to download and install dropdown-list.el to use this."
   (if (fboundp 'dropdown-list)
-      (yas/template-content
-       (cdr (nth (dropdown-list (mapcar (lambda (i)
-                                         (yas/template-name
-                                          (cdr i)))
-                                       templates))
-                templates)))
+      (let ((n (dropdown-list (mapcar (lambda (i)
+                                       (yas/template-name
+                                        (cdr i)))
+                                     templates))))
+       (if n
+           (yas/template-content
+            (cdr (nth n templates)))
+         nil))
     (error "Please download and install dropdown-list.el to use this")))
 
 (defun yas/popup-for-template (templates)