Commit 7bd9ce64 authored by Stephen Berman's avatar Stephen Berman
Browse files

Add a warning and a menu.

* calendar/todo-mode.el (todo-edit-file): Use display-warning.
(todo-menu): Uncomment and update.
parent aed4b12d
2014-05-02 Stephen Berman <stephen.berman@gmx.net>
* calendar/todo-mode.el (todo-edit-file): Use display-warning.
(todo-menu): Uncomment and update.
2014-05-02 Stephen Berman <stephen.berman@gmx.net> 2014-05-02 Stephen Berman <stephen.berman@gmx.net>
* calendar/todo-mode.el: Reimplement item editing to have the same * calendar/todo-mode.el: Reimplement item editing to have the same
......
...@@ -1216,9 +1216,19 @@ this command should be used with caution." ...@@ -1216,9 +1216,19 @@ this command should be used with caution."
(widen) (widen)
(todo-edit-mode) (todo-edit-mode)
(remove-overlays) (remove-overlays)
(message "%s" (substitute-command-keys (display-warning 'todo (format "\
(concat "Type \\[todo-edit-quit] to check file format "
"validity and return to Todo mode.\n")))) Type %s to return to Todo mode.
This also runs a file format check and signals an error if
the format has become invalid. However, this check cannot
tell if the number of items or categories changed, which
could result in the file containing inconsistent information.
You can repair this inconsistency by invoking the command
`todo-repair-categories-sexp', but this will revert any
renumbering of the categories you have made, so you will
have to renumber them again (see `(todo-mode) Reordering
Categories')." (substitute-command-keys "\\[todo-edit-quit]"))))
(defun todo-add-category (&optional file cat) (defun todo-add-category (&optional file cat)
"Add a new category to a todo file. "Add a new category to a todo file.
...@@ -6309,64 +6319,74 @@ Filtered Items mode following todo (not done) items." ...@@ -6309,64 +6319,74 @@ Filtered Items mode following todo (not done) items."
map) map)
"Todo Filtered Items mode keymap.") "Todo Filtered Items mode keymap.")
;; FIXME: Is it worth having a menu and if so, which commands? (easy-menu-define
;; (easy-menu-define todo-menu todo-mode-map "Todo Menu"
;; todo-menu todo-mode-map "Todo Menu" '("Todo"
;; '("Todo" ("Navigation"
;; ("Navigation" ["Next Item" todo-next-item t]
;; ["Next Item" todo-forward-item t] ["Previous Item" todo-previous-item t]
;; ["Previous Item" todo-backward-item t] "---"
;; "---" ["Next Category" todo-forward-category t]
;; ["Next Category" todo-forward-category t] ["Previous Category" todo-backward-category t]
;; ["Previous Category" todo-backward-category t] ["Jump to Another Category" todo-jump-to-category t]
;; ["Jump to Category" todo-jump-to-category t] "---"
;; "---" ["Visit Another Todo File" todo-show t]
;; ["Search Todo File" todo-search t] ["Visit Archive" todo-find-archive t]
;; ["Clear Highlighting on Search Matches" todo-category-done t]) ["Visit Filtered Items File" todo-find-filtered-items-file t]
;; ("Display" )
;; ["List Current Categories" todo-show-categories-table t] ("Editing"
;; ;; ["List Categories Alphabetically" todo-display-categories-alphabetically t] ["Insert New Item" todo-insert-item t]
;; ["Turn Item Highlighting on/off" todo-toggle-item-highlighting t] ["Edit Item" todo-edit-item t]
;; ["Turn Item Numbering on/off" todo-toggle-prefix-numbers t] ["Lower Item Priority" todo-lower-item-priority t]
;; ["Turn Item Time Stamp on/off" todo-toggle-item-header t] ["Raise Item Priority" todo-raise-item-priority t]
;; ["View/Hide Done Items" todo-toggle-view-done-items t] ["Set Item Priority" todo-set-item-priority t]
;; "---" ["Mark/Unmark Item" todo-toggle-mark-item t]
;; ["View Diary Items" todo-filter-diary-items t] ["Move (Recategorize) Item" todo-move-item t]
;; ["View Top Priority Items" todo-filter-top-priorities t] ["Delete Item" todo-delete-item t]
;; ["View Multifile Top Priority Items" todo-filter-top-priorities-multifile t] ["Mark and Bury Done Item" todo-item-done t]
;; "---" ["Undo Done Item" todo-item-undone t]
;; ["Print Category" todo-print-buffer t]) ["Archive Done Item" todo-archive-done-item t]
;; ("Editing" "---"
;; ["Insert New Item" todo-insert-item t] ["Add New Category" todo-add-category t]
;; ["Insert Item Here" todo-insert-item-here t] ["Rename Current Category" todo-rename-category t]
;; ("More Insertion Commands") ["Delete Current Category" todo-delete-category t]
;; ["Edit Item" todo-edit-item t] ["Move Current Category" todo-move-category t]
;; ["Edit Multiline Item" todo-edit-multiline-item t] ["Merge Current Category" todo-merge-category t]
;; ["Edit Item Header" todo-edit-item-header t] "---"
;; ["Edit Item Date" todo-edit-item-date t] ["Add New Todo File" todo-add-file t]
;; ["Edit Item Time" todo-edit-item-time t] ["Rename Todo File" todo-rename-file t]
;; "---" ["Delete Todo File" todo-delete-file t]
;; ["Lower Item Priority" todo-lower-item-priority t] ["Edit Todo File" todo-edit-file t]
;; ["Raise Item Priority" todo-raise-item-priority t] )
;; ["Set Item Priority" todo-set-item-priority t] ("Searching and Item Filtering"
;; ["Move (Recategorize) Item" todo-move-item t] ["Search Todo File" todo-search t]
;; ["Delete Item" todo-delete-item t] ["Clear Match Highlighting" todo-clear-matches t]
;; ["Undo Done Item" todo-item-undone t] "---"
;; ["Mark/Unmark Item for Diary" todo-toggle-item-diary-inclusion t] ["Set Top Priorities in File" todo-set-top-priorities-in-file t]
;; ["Mark/Unmark Items for Diary" todo-edit-item-diary-inclusion t] ["Set Top Priorities in Category" todo-set-top-priorities-in-category t]
;; ["Mark & Hide Done Item" todo-item-done t] ["Filter Top Priorities" todo-filter-top-priorities t]
;; ["Archive Done Items" todo-archive-category-done-items t] ["Filter Multifile Top Priorities" todo-filter-top-priorities-multifile t]
;; "---" ["Filter Diary Items" todo-filter-diary-items t]
;; ["Add New Todo File" todo-add-file t] ["Filter Multifile Diary Items" todo-filter-diary-items-multifile t]
;; ["Add New Category" todo-add-category t] ["Filter Regexp" todo-filter-regexp-items t]
;; ["Delete Current Category" todo-delete-category t] ["Filter Multifile Regexp" todo-filter-regexp-items-multifile t]
;; ["Rename Current Category" todo-rename-category t] )
;; "---" ("Display and Printing"
;; ["Save Todo File" todo-save t] ["Show/Hide Done Items" todo-toggle-view-done-items t]
;; ) ["Show/Hide Done Items Only" todo-toggle-view-done-only t]
;; "---" ["Show/Hide Item Highlighting" todo-toggle-item-highlighting t]
;; ["Quit" todo-quit t] ["Show/Hide Item Numbering" todo-toggle-prefix-numbers t]
;; )) ["Show/Hide Item Header" todo-toggle-item-header t]
"---"
["Display Table of Categories" todo-show-categories-table t]
"---"
["Print Category" todo-print-buffer t]
["Print Category to File" todo-print-buffer-to-file t]
)
"---"
["Save Todo File" todo-save t]
["Quit Todo Mode" todo-quit t]
))
;; ----------------------------------------------------------------------------- ;; -----------------------------------------------------------------------------
;;; Hook functions and mode definitions ;;; Hook functions and mode definitions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment