aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Berman2012-12-14 18:21:39 +0100
committerStephen Berman2012-12-14 18:21:39 +0100
commit86ea3fbd34c5d1d2c061e4bc86fdbad3cee16b3a (patch)
tree336945a5c7f3844f720b35580e0f430e62721c7c
parentd9f80d442fe751011527517be3828ba6f9387fd5 (diff)
downloademacs-86ea3fbd34c5d1d2c061e4bc86fdbad3cee16b3a.tar.gz
emacs-86ea3fbd34c5d1d2c061e4bc86fdbad3cee16b3a.zip
* calendar/todos.el (todos-priorities-rules): Fix customization
type to prevent mismatch error. (todos-set-top-priorities): Fix rule construction; fix input check; improve prompt.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/calendar/todos.el20
2 files changed, 18 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9f76d4e9a79..57113398ec7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,12 @@
12012-12-14 Stephen Berman <stephen.berman@gmx.net> 12012-12-14 Stephen Berman <stephen.berman@gmx.net>
2 2
3 * calendar/todos.el (todos-priorities-rules): Fix customization
4 type to prevent mismatch error.
5 (todos-set-top-priorities): Fix rule construction; fix input check;
6 improve prompt.
7
82012-12-14 Stephen Berman <stephen.berman@gmx.net>
9
3 * calendar/todos.el (todos-insert-item): If user exits Calendar 10 * calendar/todos.el (todos-insert-item): If user exits Calendar
4 before choosing a date, cancel item insertion. 11 before choosing a date, cancel item insertion.
5 (todos-set-date-from-calendar): If user exits Calendar before 12 (todos-set-date-from-calendar): If user exits Calendar before
diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el
index 200f77dd77c..b4ad6c16f64 100644
--- a/lisp/calendar/todos.el
+++ b/lisp/calendar/todos.el
@@ -493,7 +493,7 @@ number of top priority items for each category in that file, and
493ALIST, when non-nil, consists of conses of a category name in 493ALIST, when non-nil, consists of conses of a category name in
494FILE and a number specifying the default number of top priority 494FILE and a number specifying the default number of top priority
495items in that category, which overrides NUM." 495items in that category, which overrides NUM."
496 :type 'list 496 :type 'sexp
497 :group 'todos-filtered) 497 :group 'todos-filtered)
498 498
499(defcustom todos-show-priorities 1 499(defcustom todos-show-priorities 1
@@ -1992,21 +1992,23 @@ set the user customizable option `todos-priorities-rules'."
1992 (rules todos-priorities-rules) 1992 (rules todos-priorities-rules)
1993 (frule (assoc-string file rules)) 1993 (frule (assoc-string file rules))
1994 (crule (assoc-string cat (nth 2 frule))) 1994 (crule (assoc-string cat (nth 2 frule)))
1995 (crules (nth 2 frule))
1995 (cur (or (if arg (cdr crule) (nth 1 frule)) 1996 (cur (or (if arg (cdr crule) (nth 1 frule))
1996 todos-show-priorities)) 1997 todos-show-priorities))
1997 (prompt (concat "Current number of top priorities in this " 1998 (prompt (if arg (concat "Number of top priorities in this category"
1998 (if arg "category" "file") ": %d; " 1999 " (currently %d): ")
1999 "enter new number: ")) 2000 (concat "Default number of top priorities per category"
2000 (new "-1") 2001 " in this file (currently %d): ")))
2002 (new -1)
2001 nrule) 2003 nrule)
2002 (while (< (string-to-number new) 0) 2004 (while (< new 0)
2003 (let ((cur0 cur)) 2005 (let ((cur0 cur))
2004 (setq new (read-number (format prompt cur0) cur0) 2006 (setq new (read-number (format prompt cur0))
2005 prompt "Enter a non-negative number: " 2007 prompt "Enter a non-negative number: "
2006 cur0 nil))) 2008 cur0 nil)))
2007 (setq nrule (if arg 2009 (setq nrule (if arg
2008 (append (nth 2 (delete crule frule)) (list (cons cat new))) 2010 (append (delete crule crules) (list (cons cat new)))
2009 (append (list file new) (list (nth 2 frule))))) 2011 (append (list file new) (list crules))))
2010 (setq rules (cons (if arg 2012 (setq rules (cons (if arg
2011 (list file cur nrule) 2013 (list file cur nrule)
2012 nrule) 2014 nrule)