emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 171/352: Täydennetään funktioiden kuvauksia ym. pientä järjestel


From: Stefan Monnier
Subject: [elpa] 171/352: Täydennetään funktioiden kuvauksia ym. pientä järjestelyä
Date: Mon, 07 Jul 2014 14:03:38 +0000

monnier pushed a commit to branch master
in repository elpa.

commit 356317d3ae58bc2652624b9793cbd72a01e8eb82
Author: Teemu Likonen <address@hidden>
Date:   Wed Aug 4 07:13:03 2010 +0000

    Täydennetään funktioiden kuvauksia ym. pientä järjestelyä
---
 wcheck-mode.el |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/wcheck-mode.el b/wcheck-mode.el
index dff713b..45d0538 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -1140,18 +1140,22 @@ suggestions as a list of strings (or nil if there 
aren't any)."
 
 (defun wcheck-choose-suggestion-popup (suggestions event)
   "Create a pop-up menu to choose a substitute suggestion.
-SUGGESTIONS is a list of strings. Return user's choice (string)."
-  (let ((menu (if suggestions
-                  (mapcar #'(lambda (item)
-                              (cons item item))
-                          suggestions)
-                (list "[No suggestions]"))))
-    (x-popup-menu event (list "Choose a substitute" (cons "" menu)))))
+SUGGESTIONS is a list of strings. EVENT is the mouse event that
+originated this sequence of function calls. Return user's
+choice (a string) or nil."
+  (let ((menu (list "Choose a substitute"
+                    (cons "" (if suggestions
+                                 (mapcar #'(lambda (item)
+                                             (cons item item))
+                                         suggestions)
+                               (list "[No suggestions]"))))))
+    (x-popup-menu event menu)))
 
 
 (defun wcheck-choose-suggestion-minibuffer (suggestions)
   "Create a text menu to choose a substitute suggestion.
-SUGGESTIONS is a list of strings. Return user's choice (string)."
+SUGGESTIONS is a list of strings. Return user's choice (a string)
+or nil."
   (if suggestions
       (let ((chars (append (number-sequence ?1 ?9) (list ?0)
                            (number-sequence ?a ?z)))
@@ -1204,8 +1208,11 @@ SUGGESTIONS is a list of strings. Return user's choice 
(string)."
                          minibuffer-prompt-properties)))
             (set-window-buffer window (current-buffer))
             (set-window-dedicated-p window t)
+            ;; Return the choice or nil.
             (cond ((cdr (assq (read-key prompt) alist)))
-                  (t (message "Not a valid character") nil)))))
+                  (t
+                   (message "Not a valid character")
+                   nil)))))
     (message "No suggestions")
     nil))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]