emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113133: * lisp/play/cookie1.el (cookie-apropos): Mi


From: Glenn Morris
Subject: [Emacs-diffs] trunk r113133: * lisp/play/cookie1.el (cookie-apropos): Minor simplification.
Date: Sat, 22 Jun 2013 00:37:20 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113133
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2013-06-21 20:37:18 -0400
message:
  * lisp/play/cookie1.el (cookie-apropos): Minor simplification.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/play/cookie1.el           cookie1.el-20091113204419-o5vbwnq5f7feedwu-559
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-06-22 00:35:51 +0000
+++ b/lisp/ChangeLog    2013-06-22 00:37:18 +0000
@@ -1,5 +1,7 @@
 2013-06-22  Glenn Morris  <address@hidden>
 
+       * play/cookie1.el (cookie-apropos): Minor simplification.
+
        * progmodes/gdb-mi.el (gdb-mapcar*): Remove, replace with cl-mapcar.
 
 2013-06-22  Dmitry Gutov  <address@hidden>

=== modified file 'lisp/play/cookie1.el'
--- a/lisp/play/cookie1.el      2013-06-21 16:00:00 +0000
+++ b/lisp/play/cookie1.el      2013-06-22 00:37:18 +0000
@@ -194,34 +194,28 @@
                     (if (or current-prefix-arg (not cookie-file))
                         (read-file-name "Cookie file: " nil
                                         cookie-file t cookie-file)
-                      cookie-file)))
+                      cookie-file) t))
   (setq phrase-file (cookie-check-file phrase-file))
   ;; Make sure phrases are loaded.
   (cookie phrase-file)
   (let* ((case-fold-search t)
          (cookie-table-symbol (intern phrase-file cookie-cache))
          (string-table (symbol-value cookie-table-symbol))
-         (matches nil)
-         (len (length string-table))
-         (i 0))
-    (save-match-data
-      (while (< i len)
-        (and (string-match regexp (aref string-table i))
-             (setq matches (cons (aref string-table i) matches)))
-        (setq i (1+ i))))
-    (and matches
+         (matches nil))
+    (and (dotimes (i (length string-table) matches)
+           (and (string-match-p regexp (aref string-table i))
+                (setq matches (cons (aref string-table i) matches))))
          (setq matches (sort matches 'string-lessp)))
-    (and (or display (called-interactively-p 'interactive))
-         (cond ((null matches)
-                (message "No matches found."))
-               (t
-                (let ((l matches))
-                  (with-output-to-temp-buffer "*Cookie Apropos*"
-                    (while l
-                      (princ (car l))
-                      (setq l (cdr l))
-                      (and l (princ "\n\n")))
-                   (help-print-return-message))))))
+    (and display
+         (if matches
+             (let ((l matches))
+               (with-output-to-temp-buffer "*Cookie Apropos*"
+                 (while l
+                   (princ (car l))
+                   (setq l (cdr l))
+                   (and l (princ "\n\n")))
+                 (help-print-return-message)))
+           (message "No matches found.")))
     matches))
 
 


reply via email to

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