aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/calendar/timeclock.el26
2 files changed, 32 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ebb8d109f15..2e217312a7b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12001-04-10 John Wiegley <johnw@gnu.org>
2
3 * calendar/timeclock.el (timeclock-completing-read): new function.
4 (timeclock-ask-for-project, timeclock-ask-for-reason): Call
5 `timeclock-completing-read'.
6
7 * eshell/em-alias.el (eshell-command-aliased-p): `assoc' was
8 required where `member' was being used.
9
102001-04-09 Colin Walters <walters@cis.ohio-state.edu>
11
12 * eshell/em-hist.el (eshell-previous-matching-input): Don't
13 display "History item" if the the minibuffer is active.
14
12001-04-11 Gerd Moellmann <gerd@gnu.org> 152001-04-11 Gerd Moellmann <gerd@gnu.org>
2 16
3 * startup.el (command-line): Output a newline after printing 17 * startup.el (command-line): Output a newline after printing
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index e3cc1257770..82d1e4c3490 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -540,21 +540,31 @@ non-nil."
540(defvar timeclock-project-list nil) 540(defvar timeclock-project-list nil)
541(defvar timeclock-last-project nil) 541(defvar timeclock-last-project nil)
542 542
543(defun timeclock-completing-read (prompt alist &optional default)
544 "A version of `completing-read' that works on both Emacs and XEmacs."
545 (if (featurep 'xemacs)
546 (let ((str (completing-read prompt alist)))
547 (if (or (null str) (= (length str) 0))
548 default
549 str))
550 (completing-read prompt alist nil nil nil nil default)))
551
543(defun timeclock-ask-for-project () 552(defun timeclock-ask-for-project ()
544 "Ask the user for the project they are clocking into." 553 "Ask the user for the project they are clocking into."
545 (completing-read (format "Clock into which project (default \"%s\"): " 554 (timeclock-completing-read
546 (or timeclock-last-project 555 (format "Clock into which project (default \"%s\"): "
547 (car timeclock-project-list))) 556 (or timeclock-last-project
548 (mapcar 'list timeclock-project-list) 557 (car timeclock-project-list)))
549 nil nil nil nil (or timeclock-last-project 558 (mapcar 'list timeclock-project-list)
550 (car timeclock-project-list)))) 559 (or timeclock-last-project
560 (car timeclock-project-list))))
551 561
552(defvar timeclock-reason-list nil) 562(defvar timeclock-reason-list nil)
553 563
554(defun timeclock-ask-for-reason () 564(defun timeclock-ask-for-reason ()
555 "Ask the user for the reason they are clocking out." 565 "Ask the user for the reason they are clocking out."
556 (completing-read "Reason for clocking out: " 566 (timeclock-completing-read "Reason for clocking out: "
557 (mapcar 'list timeclock-reason-list))) 567 (mapcar 'list timeclock-reason-list)))
558 568
559(defun timeclock-update-modeline () 569(defun timeclock-update-modeline ()
560 "Update the `timeclock-mode-string' displayed in the modeline." 570 "Update the `timeclock-mode-string' displayed in the modeline."