emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117319: * calendar/todo-mode.el (todo-set-top-pr


From: Stephen Berman
Subject: [Emacs-diffs] emacs-24 r117319: * calendar/todo-mode.el (todo-set-top-priorities): Fix logic to
Date: Fri, 27 Jun 2014 15:16:03 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117319
revision-id: address@hidden
parent: address@hidden
committer: Stephen Berman <address@hidden>
branch nick: emacs-24
timestamp: Fri 2014-06-27 17:15:30 +0200
message:
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/calendar/todo-mode.el     todos.el-20120911155047-0ytqo2nidwqquefa-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-06-27 04:10:04 +0000
+++ b/lisp/ChangeLog    2014-06-27 15:15:30 +0000
@@ -1,3 +1,9 @@
+2014-06-27  Stephen Berman  <address@hidden>
+
+       * 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  <address@hidden>
 
        * calc/calc.el (math-bignum): Handle most-negative-fixnum.  (Bug#17556)

=== modified file 'lisp/calendar/todo-mode.el'
--- a/lisp/calendar/todo-mode.el        2014-06-26 19:22:08 +0000
+++ b/lisp/calendar/todo-mode.el        2014-06-27 15:15:30 +0000
@@ -4292,30 +4292,30 @@
         (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.


reply via email to

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