diff options
| author | Stephen Berman | 2014-06-27 17:15:30 +0200 |
|---|---|---|
| committer | Stephen Berman | 2014-06-27 17:15:30 +0200 |
| commit | b9d484082c664276a90586ffa44458edc49812f3 (patch) | |
| tree | 00858b8513d1ac62f3b2e0b2d4cb30f6a39ebe68 /lisp | |
| parent | 2549d174e49c5a0426b8f5bc94852faa2891cdc8 (diff) | |
| download | emacs-b9d484082c664276a90586ffa44458edc49812f3.tar.gz emacs-b9d484082c664276a90586ffa44458edc49812f3.zip | |
* 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/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/calendar/todo-mode.el | 26 |
2 files changed, 19 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dcbb027e94f..d393ae4de51 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-06-27 Stephen Berman <stephen.berman@gmx.net> | ||
| 2 | |||
| 3 | * calendar/todo-mode.el (todo-set-top-priorities): Fix logic to | ||
| 4 | account for file-wide setting of todo-top-priorities-overrides. | ||
| 5 | Make code a bit cleaner. | ||
| 6 | |||
| 1 | 2014-06-27 Leo Liu <sdl.web@gmail.com> | 7 | 2014-06-27 Leo Liu <sdl.web@gmail.com> |
| 2 | 8 | ||
| 3 | * calc/calc.el (math-bignum): Handle most-negative-fixnum. (Bug#17556) | 9 | * 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 6b246c98ed4..b4945c542c5 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'." | |||
| 4292 | (file todo-current-todo-file) | 4292 | (file todo-current-todo-file) |
| 4293 | (rules todo-top-priorities-overrides) | 4293 | (rules todo-top-priorities-overrides) |
| 4294 | (frule (assoc-string file rules)) | 4294 | (frule (assoc-string file rules)) |
| 4295 | (crule (assoc-string cat (nth 2 frule))) | ||
| 4296 | (crules (nth 2 frule)) | 4295 | (crules (nth 2 frule)) |
| 4297 | (cur (or (if arg (cdr crule) (nth 1 frule)) | 4296 | (crule (assoc-string cat crules)) |
| 4297 | (cur (or (and arg (cdr crule)) | ||
| 4298 | (nth 1 frule) | ||
| 4298 | todo-top-priorities)) | 4299 | todo-top-priorities)) |
| 4299 | (prompt (if arg (concat "Number of top priorities in this category" | 4300 | (prompt (if arg (concat "Number of top priorities in this category" |
| 4300 | " (currently %d): ") | 4301 | " (currently %d): ") |
| 4301 | (concat "Default number of top priorities per category" | 4302 | (concat "Default number of top priorities per category" |
| 4302 | " in this file (currently %d): "))) | 4303 | " in this file (currently %d): "))) |
| 4303 | (new -1) | 4304 | (new -1)) |
| 4304 | nrule) | ||
| 4305 | (while (< new 0) | 4305 | (while (< new 0) |
| 4306 | (let ((cur0 cur)) | 4306 | (let ((cur0 cur)) |
| 4307 | (setq new (read-number (format prompt cur0)) | 4307 | (setq new (read-number (format prompt cur0)) |
| 4308 | prompt "Enter a non-negative number: " | 4308 | prompt "Enter a non-negative number: " |
| 4309 | cur0 nil))) | 4309 | cur0 nil))) |
| 4310 | (setq nrule (if arg | 4310 | (let ((nrule (if arg |
| 4311 | (append (delete crule crules) (list (cons cat new))) | 4311 | (append (delete crule crules) (list (cons cat new))) |
| 4312 | (append (list file new) (list crules)))) | 4312 | (append (list file new) (list crules))))) |
| 4313 | (setq rules (cons (if arg | 4313 | (setq rules (cons (if arg |
| 4314 | (list file cur nrule) | 4314 | (list file cur nrule) |
| 4315 | nrule) | 4315 | nrule) |
| 4316 | (delete frule rules))) | 4316 | (delete frule rules))) |
| 4317 | (customize-save-variable 'todo-top-priorities-overrides rules) | 4317 | (customize-save-variable 'todo-top-priorities-overrides rules) |
| 4318 | (todo-prefix-overlays))) | 4318 | (todo-prefix-overlays)))) |
| 4319 | 4319 | ||
| 4320 | (defun todo-find-item (str) | 4320 | (defun todo-find-item (str) |
| 4321 | "Search for filtered item STR in its saved todo file. | 4321 | "Search for filtered item STR in its saved todo file. |