diff options
| author | Stephen Berman | 2014-05-02 16:10:11 +0200 |
|---|---|---|
| committer | Stephen Berman | 2014-05-02 16:10:11 +0200 |
| commit | 7bd9ce641f414853e5a2d2fe83b8cadea1a47d44 (patch) | |
| tree | d196a5f5d8b555c56635dc234f4105f2e43845cb | |
| parent | aed4b12d6a24698e87e48e3e677c00451fadc430 (diff) | |
| download | emacs-7bd9ce641f414853e5a2d2fe83b8cadea1a47d44.tar.gz emacs-7bd9ce641f414853e5a2d2fe83b8cadea1a47d44.zip | |
Add a warning and a menu.
* calendar/todo-mode.el (todo-edit-file): Use display-warning.
(todo-menu): Uncomment and update.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/calendar/todo-mode.el | 142 |
2 files changed, 86 insertions, 61 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 816c25cf716..9edc7641c74 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2014-05-02 Stephen Berman <stephen.berman@gmx.net> | 1 | 2014-05-02 Stephen Berman <stephen.berman@gmx.net> |
| 2 | 2 | ||
| 3 | * calendar/todo-mode.el (todo-edit-file): Use display-warning. | ||
| 4 | (todo-menu): Uncomment and update. | ||
| 5 | |||
| 6 | 2014-05-02 Stephen Berman <stephen.berman@gmx.net> | ||
| 7 | |||
| 3 | * calendar/todo-mode.el: Reimplement item editing to have the same | 8 | * calendar/todo-mode.el: Reimplement item editing to have the same |
| 4 | basic user interface as item insertion, and make small UI and | 9 | basic user interface as item insertion, and make small UI and |
| 5 | larger internal improvements to the latter. | 10 | larger internal improvements to the latter. |
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index df9f379a185..ddc3a4843c9 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el | |||
| @@ -1216,9 +1216,19 @@ this command should be used with caution." | |||
| 1216 | (widen) | 1216 | (widen) |
| 1217 | (todo-edit-mode) | 1217 | (todo-edit-mode) |
| 1218 | (remove-overlays) | 1218 | (remove-overlays) |
| 1219 | (message "%s" (substitute-command-keys | 1219 | (display-warning 'todo (format "\ |
| 1220 | (concat "Type \\[todo-edit-quit] to check file format " | 1220 | |
| 1221 | "validity and return to Todo mode.\n")))) | 1221 | Type %s to return to Todo mode. |
| 1222 | |||
| 1223 | This also runs a file format check and signals an error if | ||
| 1224 | the format has become invalid. However, this check cannot | ||
| 1225 | tell if the number of items or categories changed, which | ||
| 1226 | could result in the file containing inconsistent information. | ||
| 1227 | You can repair this inconsistency by invoking the command | ||
| 1228 | `todo-repair-categories-sexp', but this will revert any | ||
| 1229 | renumbering of the categories you have made, so you will | ||
| 1230 | have to renumber them again (see `(todo-mode) Reordering | ||
| 1231 | Categories')." (substitute-command-keys "\\[todo-edit-quit]")))) | ||
| 1222 | 1232 | ||
| 1223 | (defun todo-add-category (&optional file cat) | 1233 | (defun todo-add-category (&optional file cat) |
| 1224 | "Add a new category to a todo file. | 1234 | "Add a new category to a todo file. |
| @@ -6309,64 +6319,74 @@ Filtered Items mode following todo (not done) items." | |||
| 6309 | map) | 6319 | map) |
| 6310 | "Todo Filtered Items mode keymap.") | 6320 | "Todo Filtered Items mode keymap.") |
| 6311 | 6321 | ||
| 6312 | ;; FIXME: Is it worth having a menu and if so, which commands? | 6322 | (easy-menu-define |
| 6313 | ;; (easy-menu-define | 6323 | todo-menu todo-mode-map "Todo Menu" |
| 6314 | ;; todo-menu todo-mode-map "Todo Menu" | 6324 | '("Todo" |
| 6315 | ;; '("Todo" | 6325 | ("Navigation" |
| 6316 | ;; ("Navigation" | 6326 | ["Next Item" todo-next-item t] |
| 6317 | ;; ["Next Item" todo-forward-item t] | 6327 | ["Previous Item" todo-previous-item t] |
| 6318 | ;; ["Previous Item" todo-backward-item t] | 6328 | "---" |
| 6319 | ;; "---" | 6329 | ["Next Category" todo-forward-category t] |
| 6320 | ;; ["Next Category" todo-forward-category t] | 6330 | ["Previous Category" todo-backward-category t] |
| 6321 | ;; ["Previous Category" todo-backward-category t] | 6331 | ["Jump to Another Category" todo-jump-to-category t] |
| 6322 | ;; ["Jump to Category" todo-jump-to-category t] | 6332 | "---" |
| 6323 | ;; "---" | 6333 | ["Visit Another Todo File" todo-show t] |
| 6324 | ;; ["Search Todo File" todo-search t] | 6334 | ["Visit Archive" todo-find-archive t] |
| 6325 | ;; ["Clear Highlighting on Search Matches" todo-category-done t]) | 6335 | ["Visit Filtered Items File" todo-find-filtered-items-file t] |
| 6326 | ;; ("Display" | 6336 | ) |
| 6327 | ;; ["List Current Categories" todo-show-categories-table t] | 6337 | ("Editing" |
| 6328 | ;; ;; ["List Categories Alphabetically" todo-display-categories-alphabetically t] | 6338 | ["Insert New Item" todo-insert-item t] |
| 6329 | ;; ["Turn Item Highlighting on/off" todo-toggle-item-highlighting t] | 6339 | ["Edit Item" todo-edit-item t] |
| 6330 | ;; ["Turn Item Numbering on/off" todo-toggle-prefix-numbers t] | 6340 | ["Lower Item Priority" todo-lower-item-priority t] |
| 6331 | ;; ["Turn Item Time Stamp on/off" todo-toggle-item-header t] | 6341 | ["Raise Item Priority" todo-raise-item-priority t] |
| 6332 | ;; ["View/Hide Done Items" todo-toggle-view-done-items t] | 6342 | ["Set Item Priority" todo-set-item-priority t] |
| 6333 | ;; "---" | 6343 | ["Mark/Unmark Item" todo-toggle-mark-item t] |
| 6334 | ;; ["View Diary Items" todo-filter-diary-items t] | 6344 | ["Move (Recategorize) Item" todo-move-item t] |
| 6335 | ;; ["View Top Priority Items" todo-filter-top-priorities t] | 6345 | ["Delete Item" todo-delete-item t] |
| 6336 | ;; ["View Multifile Top Priority Items" todo-filter-top-priorities-multifile t] | 6346 | ["Mark and Bury Done Item" todo-item-done t] |
| 6337 | ;; "---" | 6347 | ["Undo Done Item" todo-item-undone t] |
| 6338 | ;; ["Print Category" todo-print-buffer t]) | 6348 | ["Archive Done Item" todo-archive-done-item t] |
| 6339 | ;; ("Editing" | 6349 | "---" |
| 6340 | ;; ["Insert New Item" todo-insert-item t] | 6350 | ["Add New Category" todo-add-category t] |
| 6341 | ;; ["Insert Item Here" todo-insert-item-here t] | 6351 | ["Rename Current Category" todo-rename-category t] |
| 6342 | ;; ("More Insertion Commands") | 6352 | ["Delete Current Category" todo-delete-category t] |
| 6343 | ;; ["Edit Item" todo-edit-item t] | 6353 | ["Move Current Category" todo-move-category t] |
| 6344 | ;; ["Edit Multiline Item" todo-edit-multiline-item t] | 6354 | ["Merge Current Category" todo-merge-category t] |
| 6345 | ;; ["Edit Item Header" todo-edit-item-header t] | 6355 | "---" |
| 6346 | ;; ["Edit Item Date" todo-edit-item-date t] | 6356 | ["Add New Todo File" todo-add-file t] |
| 6347 | ;; ["Edit Item Time" todo-edit-item-time t] | 6357 | ["Rename Todo File" todo-rename-file t] |
| 6348 | ;; "---" | 6358 | ["Delete Todo File" todo-delete-file t] |
| 6349 | ;; ["Lower Item Priority" todo-lower-item-priority t] | 6359 | ["Edit Todo File" todo-edit-file t] |
| 6350 | ;; ["Raise Item Priority" todo-raise-item-priority t] | 6360 | ) |
| 6351 | ;; ["Set Item Priority" todo-set-item-priority t] | 6361 | ("Searching and Item Filtering" |
| 6352 | ;; ["Move (Recategorize) Item" todo-move-item t] | 6362 | ["Search Todo File" todo-search t] |
| 6353 | ;; ["Delete Item" todo-delete-item t] | 6363 | ["Clear Match Highlighting" todo-clear-matches t] |
| 6354 | ;; ["Undo Done Item" todo-item-undone t] | 6364 | "---" |
| 6355 | ;; ["Mark/Unmark Item for Diary" todo-toggle-item-diary-inclusion t] | 6365 | ["Set Top Priorities in File" todo-set-top-priorities-in-file t] |
| 6356 | ;; ["Mark/Unmark Items for Diary" todo-edit-item-diary-inclusion t] | 6366 | ["Set Top Priorities in Category" todo-set-top-priorities-in-category t] |
| 6357 | ;; ["Mark & Hide Done Item" todo-item-done t] | 6367 | ["Filter Top Priorities" todo-filter-top-priorities t] |
| 6358 | ;; ["Archive Done Items" todo-archive-category-done-items t] | 6368 | ["Filter Multifile Top Priorities" todo-filter-top-priorities-multifile t] |
| 6359 | ;; "---" | 6369 | ["Filter Diary Items" todo-filter-diary-items t] |
| 6360 | ;; ["Add New Todo File" todo-add-file t] | 6370 | ["Filter Multifile Diary Items" todo-filter-diary-items-multifile t] |
| 6361 | ;; ["Add New Category" todo-add-category t] | 6371 | ["Filter Regexp" todo-filter-regexp-items t] |
| 6362 | ;; ["Delete Current Category" todo-delete-category t] | 6372 | ["Filter Multifile Regexp" todo-filter-regexp-items-multifile t] |
| 6363 | ;; ["Rename Current Category" todo-rename-category t] | 6373 | ) |
| 6364 | ;; "---" | 6374 | ("Display and Printing" |
| 6365 | ;; ["Save Todo File" todo-save t] | 6375 | ["Show/Hide Done Items" todo-toggle-view-done-items t] |
| 6366 | ;; ) | 6376 | ["Show/Hide Done Items Only" todo-toggle-view-done-only t] |
| 6367 | ;; "---" | 6377 | ["Show/Hide Item Highlighting" todo-toggle-item-highlighting t] |
| 6368 | ;; ["Quit" todo-quit t] | 6378 | ["Show/Hide Item Numbering" todo-toggle-prefix-numbers t] |
| 6369 | ;; )) | 6379 | ["Show/Hide Item Header" todo-toggle-item-header t] |
| 6380 | "---" | ||
| 6381 | ["Display Table of Categories" todo-show-categories-table t] | ||
| 6382 | "---" | ||
| 6383 | ["Print Category" todo-print-buffer t] | ||
| 6384 | ["Print Category to File" todo-print-buffer-to-file t] | ||
| 6385 | ) | ||
| 6386 | "---" | ||
| 6387 | ["Save Todo File" todo-save t] | ||
| 6388 | ["Quit Todo Mode" todo-quit t] | ||
| 6389 | )) | ||
| 6370 | 6390 | ||
| 6371 | ;; ----------------------------------------------------------------------------- | 6391 | ;; ----------------------------------------------------------------------------- |
| 6372 | ;;; Hook functions and mode definitions | 6392 | ;;; Hook functions and mode definitions |