From: Stephen Berman Date: Fri, 4 Jul 2014 15:53:25 +0000 (+0200) Subject: * calendar/todo-mode.el: Fix two bugs. Shorten Commentary and X-Git-Tag: emacs-24.3.93~96 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95fab4ba13c785ff350fb8c1a7b67f2643d1f878;p=emacs.git * calendar/todo-mode.el: Fix two bugs. Shorten Commentary and refer to the Todo mode Info manual. Update the comment on requiring cl-lib. (todo-find-filtered-items-file): Add todo-prefix overlays. (todo-filter-items): Reorder a let-bound variable to avoid a wrong-type-argument error on canceling the file choice dialog. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 021b0693654..e9c492dc013 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2014-07-04 Stephen Berman + + * calendar/todo-mode.el: Fix two bugs. Shorten Commentary and + refer to the Todo mode Info manual. Update the comment on + requiring cl-lib. + (todo-find-filtered-items-file): Add todo-prefix overlays. + (todo-filter-items): Reorder a let-bound variable to avoid a + wrong-type-argument error on canceling the file choice dialog. + 2014-07-04 Stefan Monnier * progmodes/octave.el (inferior-octave-mode): diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index b4945c542c5..a1da75c20e8 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -24,63 +24,37 @@ ;;; Commentary: -;; This package provides facilities for making, displaying, navigating -;; and editing todo lists, which are prioritized lists of todo items. -;; Todo lists are identified with named categories, so you can group -;; together and separately prioritize thematically related todo items. -;; Each category is stored in a file, which thus provides a further -;; level of organization. You can create as many todo files, and in -;; each as many categories, as you want. +;; This package provides facilities for making and maintaining +;; prioritized lists of things to do. These todo lists are identified +;; with named categories, so you can group together thematically +;; related todo items. Each category is stored in a file, providing a +;; further level of organization. You can create as many todo files, +;; and in each as many categories, as you want. ;; With Todo mode you can navigate among the items of a category, and ;; between categories in the same and in different todo files. You -;; can edit todo items, reprioritize them within their category, move -;; them to another category, delete them, or mark items as done and -;; store them separately from the not yet done items in a category. -;; You can add new todo files, edit and delete them. You can add new -;; categories, rename and delete them, move categories to another file -;; and merge the items of two categories. You can also reorder the -;; sequence of categories in a todo file for the purpose of -;; navigation. You can display summary tables of the categories in a -;; file and the types of items they contain. And you can compile -;; lists of existing items from multiple categories in one or more -;; todo files, which are filtered by various criteria. - -;; To get started, load this package and type `M-x todo-show'. This -;; will prompt you for the name of the first todo file, its first -;; category and the category's first item, create these and display -;; them in Todo mode. Now you can insert further items into the list -;; (i.e., the category) and assign them priorities by typing `i i'. - -;; You will probably find it convenient to give `todo-show' a global -;; key binding in your init file, since it is one of the entry points -;; to Todo mode; a good choice is `C-c t', since `todo-show' is -;; bound to `t' in Todo mode. - -;; To see a list of all Todo mode commands and their key bindings, -;; including other entry points, type `C-h m' in Todo mode. Consult -;; the documentation strings of the commands for details of their use. -;; The `todo' customization group and its subgroups list the options -;; you can set to alter the behavior of many commands and various -;; aspects of the display. - -;; This package is a new version of Oliver Seidel's todo-mode.el. -;; While it retains the same basic organization and handling of todo -;; lists and the basic UI, it significantly extends these and adds -;; many features. This required also making changes to the internals, -;; including the file format. If you have a todo file in old format, -;; then the first time you invoke `todo-show' (i.e., before you have -;; created any todo file in the current format), it will ask you -;; whether to convert that file and show it. If you choose not to -;; convert the old-style file at this time, you can do so later by -;; calling the command `todo-convert-legacy-files'. +;; can add and edit todo items, reprioritize them, move them to +;; another category, or delete them. You can also mark items as done +;; and store them within their category or in separate archive files. +;; You can include todo items in the Emacs Fancy Diary display and +;; treat them as appointments. You can add new todo files, and rename +;; or delete them. You can add new categories to a file, rename or +;; delete them, move a category to another file and merge the items of +;; two categories. You can also reorder the sequence of categories in +;; a todo file for the purpose of navigation. You can display +;; sortable summary tables of the categories in a file and the types +;; of items they contain. And you can filter items by various +;; criteria from multiple categories in one or more todo files to +;; create prioritizable cross-category overviews of your todo items. + +;; To get started, type `M-x todo-show'. For full details of the user +;; interface, commands and options, consult the Todo mode user manual, +;; which is included in the Info documentation. ;;; Code: (require 'diary-lib) -;; For cl-remove-duplicates (in todo-insertion-commands-args) and -;; cl-oddp. -(require 'cl-lib) +(require 'cl-lib) ; For cl-oddp and cl-assert. ;; ----------------------------------------------------------------------------- ;;; Setting up todo files, categories, and items @@ -3971,7 +3945,8 @@ regexp items." (setq file (cdr (assoc-string file falist))) (find-file file) (unless (derived-mode-p 'todo-filtered-items-mode) - (todo-filtered-items-mode)))) + (todo-filtered-items-mode)) + (todo-prefix-overlays))) (defun todo-go-to-source-item () "Display the file and category of the filtered item at point." @@ -4080,7 +4055,6 @@ multifile commands for further details." (progn (todo-multiple-filter-files) todo-multiple-filter-files)) (list todo-current-todo-file))) - (multi (> (length flist) 1)) (fname (if (equal flist 'quit) ;; Pressed `cancel' in t-m-f-f file selection dialog. (keyboard-quit) @@ -4089,6 +4063,7 @@ multifile commands for further details." (cond (top ".todt") (diary ".tody") (regexp ".todr"))))) + (multi (> (length flist) 1)) (rxfiles (when regexp (directory-files todo-directory t ".*\\.todr$" t))) (file-exists (or (file-exists-p fname) rxfiles))