From 1b45a9d5454feb02d64710d0056fb8ddfde79361 Mon Sep 17 00:00:00 2001 From: Zhang Chiyuan Date: Sun, 16 Mar 2008 03:41:12 +0000 Subject: [PATCH] more compatible with dropdown-list.el --- yasnippet.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index 6dc3f13..5ce5f64 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -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)