aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStephen Berman <[email protected]>2014-06-27 17:15:30 +0200
committerStephen Berman <[email protected]>2014-06-27 17:15:30 +0200
commitb9d484082c664276a90586ffa44458edc49812f3 (patch)
tree00858b8513d1ac62f3b2e0b2d4cb30f6a39ebe68 /lisp
parent2549d174e49c5a0426b8f5bc94852faa2891cdc8 (diff)
* calendar/todo-mode.el (todo-set-top-priorities): Fix logic to
account for file-wide setting of todo-top-priorities-overrides. Make code a bit cleaner.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/calendar/todo-mode.el26
2 files changed, 19 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dcbb027e94..d393ae4de5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2014-06-27 Stephen Berman <[email protected]>
+
+ * calendar/todo-mode.el (todo-set-top-priorities): Fix logic to
+ account for file-wide setting of todo-top-priorities-overrides.
+ Make code a bit cleaner.
+
2014-06-27 Leo Liu <[email protected]>
* calc/calc.el (math-bignum): Handle most-negative-fixnum. (Bug#17556)
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 6b246c98ed..b4945c542c 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -4292,30 +4292,30 @@ set the user customizable option `todo-top-priorities-overrides'."
(file todo-current-todo-file)
(rules todo-top-priorities-overrides)
(frule (assoc-string file rules))
- (crule (assoc-string cat (nth 2 frule)))
(crules (nth 2 frule))
- (cur (or (if arg (cdr crule) (nth 1 frule))
+ (crule (assoc-string cat crules))
+ (cur (or (and arg (cdr crule))
+ (nth 1 frule)
todo-top-priorities))
(prompt (if arg (concat "Number of top priorities in this category"
" (currently %d): ")
(concat "Default number of top priorities per category"
" in this file (currently %d): ")))
- (new -1)
- nrule)
+ (new -1))
(while (< new 0)
(let ((cur0 cur))
(setq new (read-number (format prompt cur0))
prompt "Enter a non-negative number: "
cur0 nil)))
- (setq nrule (if arg
- (append (delete crule crules) (list (cons cat new)))
- (append (list file new) (list crules))))
- (setq rules (cons (if arg
- (list file cur nrule)
- nrule)
- (delete frule rules)))
- (customize-save-variable 'todo-top-priorities-overrides rules)
- (todo-prefix-overlays)))
+ (let ((nrule (if arg
+ (append (delete crule crules) (list (cons cat new)))
+ (append (list file new) (list crules)))))
+ (setq rules (cons (if arg
+ (list file cur nrule)
+ nrule)
+ (delete frule rules)))
+ (customize-save-variable 'todo-top-priorities-overrides rules)
+ (todo-prefix-overlays))))
(defun todo-find-item (str)
"Search for filtered item STR in its saved todo file.