]> git.eshelyaron.com Git - emacs.git/commitdiff
(timeclock-completing-read): new function.
authorJohn Wiegley <johnw@newartisans.com>
Wed, 11 Apr 2001 15:51:19 +0000 (15:51 +0000)
committerJohn Wiegley <johnw@newartisans.com>
Wed, 11 Apr 2001 15:51:19 +0000 (15:51 +0000)
(timeclock-ask-for-project, timeclock-ask-for-reason): Call
`timeclock-completing-read', which works under XEmacs as well.

lisp/ChangeLog
lisp/calendar/timeclock.el

index ebb8d109f159962668264f76009fcadbb3c2a34e..2e217312a7bbff981a1eb4faeb5f5d8a9f081689 100644 (file)
@@ -1,3 +1,17 @@
+2001-04-10  John Wiegley  <johnw@gnu.org>
+
+       * calendar/timeclock.el (timeclock-completing-read): new function.
+       (timeclock-ask-for-project, timeclock-ask-for-reason): Call
+       `timeclock-completing-read'.
+
+       * eshell/em-alias.el (eshell-command-aliased-p): `assoc' was
+       required where `member' was being used.
+
+2001-04-09  Colin Walters  <walters@cis.ohio-state.edu>
+
+       * eshell/em-hist.el (eshell-previous-matching-input): Don't
+       display "History item" if the the minibuffer is active.
+
 2001-04-11  Gerd Moellmann  <gerd@gnu.org>
 
        * startup.el (command-line): Output a newline after printing
index e3cc1257770b71f2dc04b1e98dfabb9eb85e65d5..82d1e4c3490ca7900c5015b2a4eae4816c166aaf 100644 (file)
@@ -540,21 +540,31 @@ non-nil."
 (defvar timeclock-project-list nil)
 (defvar timeclock-last-project nil)
 
+(defun timeclock-completing-read (prompt alist &optional default)
+  "A version of `completing-read' that works on both Emacs and XEmacs."
+  (if (featurep 'xemacs)
+      (let ((str (completing-read prompt alist)))
+       (if (or (null str) (= (length str) 0))
+           default
+         str))
+    (completing-read prompt alist nil nil nil nil default)))
+
 (defun timeclock-ask-for-project ()
   "Ask the user for the project they are clocking into."
-  (completing-read (format "Clock into which project (default \"%s\"): "
-                          (or timeclock-last-project
-                              (car timeclock-project-list)))
-                  (mapcar 'list timeclock-project-list)
-                  nil nil nil nil (or timeclock-last-project
-                                      (car timeclock-project-list))))
+  (timeclock-completing-read
+   (format "Clock into which project (default \"%s\"): "
+          (or timeclock-last-project
+              (car timeclock-project-list)))
+   (mapcar 'list timeclock-project-list)
+   (or timeclock-last-project
+       (car timeclock-project-list))))
 
 (defvar timeclock-reason-list nil)
 
 (defun timeclock-ask-for-reason ()
   "Ask the user for the reason they are clocking out."
-  (completing-read "Reason for clocking out: "
-                  (mapcar 'list timeclock-reason-list)))
+  (timeclock-completing-read "Reason for clocking out: "
+                            (mapcar 'list timeclock-reason-list)))
 
 (defun timeclock-update-modeline ()
   "Update the `timeclock-mode-string' displayed in the modeline."