annotate lisp/calendar/todo-mode.el @ 109715:843bffdd92eb

Fix query-replace-regexp incomplete highlighting (Bug#6808). * replace.el (replace-highlight): Bind isearch-forward and isearch-error, ensuring that highlighting is updated if the user switches the search direction (Bug#6808). * isearch.el (isearch-lazy-highlight-forward): New var. (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-search): (isearch-lazy-highlight-update): Use it.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 08 Aug 2010 16:55:52 -0400
parents 1d1d5d9bd884
children 1a6d2311d8d5 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 38296
diff changeset
1 ;;; todo-mode.el --- major mode for editing TODO list files
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
2
92956
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
3 ;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 105843
diff changeset
4 ;; 2008, 2009, 2010 Free Software Foundation, Inc.
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
5
101655
22f27f5cbe39 Update Oliver Seidel's email address, and add Stephen Berman as
Chong Yidong <cyd@stupidchicken.com>
parents: 101600
diff changeset
6 ;; Author: Oliver Seidel <privat@os10000.net>
22f27f5cbe39 Update Oliver Seidel's email address, and add Stephen Berman as
Chong Yidong <cyd@stupidchicken.com>
parents: 101600
diff changeset
7 ;; Maintainer: Stephen Berman <stephen.berman@gmx.net>
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
8 ;; Created: 2 Aug 1997
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
9 ;; Keywords: calendar, todo
19180
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
10
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
11 ;; This file is part of GNU Emacs.
19180
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
12
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92956
diff changeset
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
19180
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92956
diff changeset
15 ;; the Free Software Foundation, either version 3 of the License, or
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92956
diff changeset
16 ;; (at your option) any later version.
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
17
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19180
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
21 ;; GNU General Public License for more details.
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
22
19180
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
23 ;; You should have received a copy of the GNU General Public License
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 92956
diff changeset
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19180
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
25
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
26 ;; ---------------------------------------------------------------------------
5de82ccd80eb Made todomode.el available under GPL.
Oliver Seidel <os10000@seidel-space.de>
parents: 19179
diff changeset
27
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
28 ;;; Commentary:
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
29
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
30 ;; Mode Description
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
31 ;;
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
32 ;; TODO is a major mode for EMACS which offers functionality to
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
33 ;; treat most lines in one buffer as a list of items one has to
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
34 ;; do. There are facilities to add new items, which are
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
35 ;; categorised, to edit or even delete items from the buffer.
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
36 ;; The buffer contents are currently compatible with the diary,
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
37 ;; so that the list of todo-items will show up in the FANCY diary
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
38 ;; mode.
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
39 ;;
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
40 ;; Notice: Besides the major mode, this file also exports the
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
41 ;; function `todo-show' which will change to the one specific
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
42 ;; TODO file that has been specified in the todo-file-do
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
43 ;; variable. If this file does not conform to the TODO mode
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
44 ;; conventions, the todo-show function will add the appropriate
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
45 ;; header and footer. I don't anticipate this to cause much
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
46 ;; grief, but be warned, in case you attempt to read a plain text
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
47 ;; file.
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
48 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
49 ;; Preface, Quickstart Installation
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
50 ;;
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
51 ;; To get this to work, make Emacs execute the line
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
52 ;;
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
53 ;; (autoload 'todo-mode "todo-mode"
20173
0044ff755ee7 Added three suggestions from Carsten
Oliver Seidel <os10000@seidel-space.de>
parents: 20172
diff changeset
54 ;; "Major mode for editing TODO lists." t)
0044ff755ee7 Added three suggestions from Carsten
Oliver Seidel <os10000@seidel-space.de>
parents: 20172
diff changeset
55 ;; (autoload 'todo-show "todo-mode"
0044ff755ee7 Added three suggestions from Carsten
Oliver Seidel <os10000@seidel-space.de>
parents: 20172
diff changeset
56 ;; "Show TODO items." t)
0044ff755ee7 Added three suggestions from Carsten
Oliver Seidel <os10000@seidel-space.de>
parents: 20172
diff changeset
57 ;; (autoload 'todo-insert-item "todo-mode"
0044ff755ee7 Added three suggestions from Carsten
Oliver Seidel <os10000@seidel-space.de>
parents: 20172
diff changeset
58 ;; "Add TODO item." t)
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
59 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
60 ;; You may now enter new items by typing "M-x todo-insert-item",
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
61 ;; or enter your TODO list file by typing "M-x todo-show".
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
62 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
63 ;; The TODO list file has a special format and some auxiliary
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
64 ;; information, which will be added by the todo-show function if
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
65 ;; it attempts to visit an un-initialised file. Hence it is
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
66 ;; recommended to use the todo-show function for the first time,
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
67 ;; in order to initialise the file, but it is not necessary
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
68 ;; afterwards.
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
69 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
70 ;; As these commands are quite long to type, I would recommend
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
71 ;; the addition of two bindings to your to your global keymap. I
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
72 ;; personally have the following in my initialisation file:
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
73 ;;
92956
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
74 ;; (global-set-key "\C-ct" 'todo-show) ; switch to TODO buffer
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
75 ;; (global-set-key "\C-ci" 'todo-insert-item) ; insert new item
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
76 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
77 ;; Note, however, that this recommendation has prompted some
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
78 ;; criticism, since the keys C-c LETTER are reserved for user
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
79 ;; functions. I believe my recommendation is acceptable, since
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
80 ;; the Emacs Lisp Manual *Tips* section also details that the
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
81 ;; mode itself should not bind any functions to those keys. The
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
82 ;; express aim of the above two bindings is to work outside the
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
83 ;; mode, which doesn't need the show function and offers a
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
84 ;; different binding for the insert function. They serve as
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
85 ;; shortcuts and are not even needed (since the TODO mode will be
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
86 ;; entered by visiting the TODO file, and later by switching to
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
87 ;; its buffer).
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
88 ;;
20196
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
89 ;; If you are an advanced user of this package, please consult
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
90 ;; the whole source code for autoloads, because there are several
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
91 ;; extensions that are not explicitly listed in the above quick
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
92 ;; installation.
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
93 ;;
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
94 ;; Pre-Requisites
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
95 ;;
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
96 ;; This package will require the following packages to be
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
97 ;; available on the load-path:
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
98 ;;
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
99 ;; time-stamp
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
100 ;; easymenu
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
101 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
102 ;; Operation
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
103 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
104 ;; You will have the following facilities available:
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
105 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
106 ;; M-x todo-show will enter the todo list screen, here type
19187
9d37b4ab16b5 Acted upon suggestion from Shane Holder <holder@rsn.hp.com>:
Oliver Seidel <os10000@seidel-space.de>
parents: 19186
diff changeset
107 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
108 ;; + to go to next category
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
109 ;; - to go to previous category
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
110 ;; d to file the current entry, including a
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
111 ;; comment and timestamp
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
112 ;; e to edit the current entry
20198
8fa6333a22f2 Improved documentation, fixed insertion with prefix.
Oliver Seidel <os10000@seidel-space.de>
parents: 20197
diff changeset
113 ;; E to edit a multi-line entry
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
114 ;; f to file the current entry, including a
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
115 ;; comment and timestamp
20199
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
116 ;; i to insert a new entry, with prefix, omit category
20198
8fa6333a22f2 Improved documentation, fixed insertion with prefix.
Oliver Seidel <os10000@seidel-space.de>
parents: 20197
diff changeset
117 ;; I to insert a new entry at current cursor position
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
118 ;; j jump to category
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
119 ;; k to kill the current entry
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
120 ;; l to lower the current entry's priority
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
121 ;; n for the next entry
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
122 ;; p for the previous entry
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
123 ;; P print
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
124 ;; q to save the list and exit the buffer
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
125 ;; r to raise the current entry's priority
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
126 ;; s to save the list
20193
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
127 ;; S to save the list of top priorities
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
128 ;; t show top priority items for each category
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
129 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
130 ;; When you add a new entry, you are asked for the text and then
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
131 ;; for the category. I for example have categories for things
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
132 ;; that I want to do in the office (like mail my mum), that I
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
133 ;; want to do in town (like buy cornflakes) and things I want to
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
134 ;; do at home (move my suitcases). The categories can be
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
135 ;; selected with the cursor keys and if you type in the name of a
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
136 ;; category which didn't exist before, an empty category of the
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
137 ;; desired name will be added and filled with the new entry.
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
138 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
139 ;; Configuration
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
140 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
141 ;; Variable todo-prefix
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
142 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
143 ;; I would like to recommend that you use the prefix "*/*" (by
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
144 ;; leaving the variable 'todo-prefix' untouched) so that the
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
145 ;; diary displays each entry every day.
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
146 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
147 ;; To understand what I mean, please read the documentation that
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
148 ;; goes with the calendar since that will tell you how you can
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
149 ;; set up the fancy diary display and use the #include command to
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
150 ;; include your todo list file as part of your diary.
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
151 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
152 ;; If you have the diary package set up to usually display more
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
153 ;; than one day's entries at once, consider using
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
154 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
155 ;; "&%%(equal (calendar-current-date) date)"
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
156 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
157 ;; as the value of `todo-prefix'. Please note that this may slow
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
158 ;; down the processing of your diary file some.
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
159 ;;
20196
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
160 ;; Carsten Dominik <dominik@strw.LeidenUniv.nl> suggested that
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
161 ;;
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
162 ;; "&%%(todo-cp)"
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
163 ;;
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
164 ;; might be nicer and to that effect a function has been declared
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
165 ;; further down in the code. You may wish to auto-load this.
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
166 ;;
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
167 ;; Carsten also writes that that *changing* the prefix after the
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
168 ;; todo list is already established is not as simple as changing
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
169 ;; the variable - the todo files have to be changed by hand.
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
170 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
171 ;; Variable todo-file-do
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
172 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
173 ;; This variable is fairly self-explanatory. You have to store
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
174 ;; your TODO list somewhere. This variable tells the package
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
175 ;; where to go and find this file.
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
176 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
177 ;; Variable todo-file-done
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
178 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
179 ;; Even when you're done, you may wish to retain the entries.
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
180 ;; Given that they're timestamped and you are offered to add a
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
181 ;; comment, this can make a useful diary of past events. It will
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
182 ;; even blend in with the EMACS diary package. So anyway, this
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
183 ;; variable holds the name of the file for the filed todo-items.
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
184 ;;
20193
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
185 ;; Variable todo-file-top
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
186 ;;
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
187 ;; File storing the top priorities of your TODO list when
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
188 ;; todo-save-top-priorities is non-nil. Nice to include in your
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
189 ;; diary instead of the complete TODO list.
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
190 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
191 ;; Variable todo-mode-hook
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
192 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
193 ;; Just like other modes, too, this mode offers to call your
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
194 ;; functions before it goes about its business. This variable
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
195 ;; will be inspected for any functions you may wish to have
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
196 ;; called once the other TODO mode preparations have been
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
197 ;; completed.
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
198 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
199 ;; Variable todo-insert-threshold
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
200 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
201 ;; Another nifty feature is the insertion accuracy. If you have
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
202 ;; 8 items in your TODO list, then you may get asked 4 questions
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
203 ;; by the binary insertion algorithm. However, you may not
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
204 ;; really have a need for such accurate priorities amongst your
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
205 ;; TODO items. If you now think about the binary insertion
77383
e905e4598d5f Fix some typos.
Glenn Morris <rgm@gnu.org>
parents: 77305
diff changeset
206 ;; halving the size of the window each time, then the threshold
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
207 ;; is the window size at which it will stop. If you set the
77305
40f74d56a5f0 Fix typo: "threshhold" -> "threshold".
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
208 ;; threshold to zero, the upper and lower bound will coincide at
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
209 ;; the end of the loop and you will insert your item just before
77305
40f74d56a5f0 Fix typo: "threshhold" -> "threshold".
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
210 ;; that point. If you set the threshold to, e.g. 8, it will stop
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
211 ;; as soon as the window size drops below that amount and will
96364
c5e50585b044 American English spelling fix.
Glenn Morris <rgm@gnu.org>
parents: 94653
diff changeset
212 ;; insert the item in the approximate center of that window. I
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
213 ;; got the idea for this feature after reading a very helpful
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
214 ;; e-mail reply from Trey Jackson <trey@cs.berkeley.edu> who
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
215 ;; corrected some of my awful coding and pointed me towards some
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
216 ;; good reading. Thanks Trey!
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
217 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
218 ;; Things to do
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
219 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
220 ;; These originally were my ideas, but now also include all the
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
221 ;; suggestions that I included before forgetting them:
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
222 ;;
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
223 ;; o Fancy fonts for todo/top-priority buffer
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
224 ;; o Remove todo-prefix option in todo-top-priorities
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
225 ;; o Rename category
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
226 ;; o Move entry from one category to another one
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
227 ;; o Entries which both have the generic */* prefix and a
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
228 ;; "deadline" entry which are understood by diary, indicating
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
229 ;; an event (unless marked by &)
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
230 ;; o The optional COUNT variable of todo-forward-item should be
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
231 ;; applied to the other functions performing similar tasks
77383
e905e4598d5f Fix some typos.
Glenn Morris <rgm@gnu.org>
parents: 77305
diff changeset
232 ;; o Modularization could be done for repeated elements of
23349
081564884463 Alex Schroeder startup description added.
Oliver Seidel <os10000@seidel-space.de>
parents: 20643
diff changeset
233 ;; the code, like the completing-read lines of code.
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
234 ;; o license / version function
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
235 ;; o export to diary file
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
236 ;; o todo-report-bug
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
237 ;; o GNATS support
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
238 ;; o elide multiline (as in bbdb, or, to a lesser degree, in
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
239 ;; outline mode)
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
240 ;; o rewrite complete package to store data as Lisp objects
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
241 ;; and have display modes for display, for diary export,
77383
e905e4598d5f Fix some typos.
Glenn Morris <rgm@gnu.org>
parents: 77305
diff changeset
242 ;; etc. (Richard Stallman pointed out this is a bad idea)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
243 ;; o so base todo-mode.el on generic-mode.el instead
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
244 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
245 ;; History and Gossip
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
246 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
247 ;; Many thanks to all the ones who have contributed to the
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
248 ;; evolution of this package! I hope I have listed all of you
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
249 ;; somewhere in the documentation or at least in the RCS history!
19189
1519cf07cfab Fixed header, typos, layout, documentation.
Oliver Seidel <os10000@seidel-space.de>
parents: 19188
diff changeset
250 ;;
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
251 ;; Enjoy this package and express your gratitude by sending nice
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
252 ;; things to my parents' address!
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
253 ;;
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
254 ;; Oliver Seidel
77383
e905e4598d5f Fix some typos.
Glenn Morris <rgm@gnu.org>
parents: 77305
diff changeset
255 ;; (Lessingstr. 8, 65760 Eschborn, Federal Republic of Germany)
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
256
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
257 ;;; Code:
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
258
41957
614f3f592531 Require time-stamp.
Pavel Janík <Pavel@Janik.cz>
parents: 41188
diff changeset
259 (require 'time-stamp)
614f3f592531 Require time-stamp.
Pavel Janík <Pavel@Janik.cz>
parents: 41188
diff changeset
260
614f3f592531 Require time-stamp.
Pavel Janík <Pavel@Janik.cz>
parents: 41188
diff changeset
261
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
262 ;; User-configurable variables:
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
263
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
264 (defgroup todo nil
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
265 "Maintain a list of todo items."
34968
c8d0a552d56e (todo): Add :link, :version.
Dave Love <fx@gnu.org>
parents: 33795
diff changeset
266 :link '(emacs-commentary-link "todo-mode")
c8d0a552d56e (todo): Add :link, :version.
Dave Love <fx@gnu.org>
parents: 33795
diff changeset
267 :version "21.1"
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
268 :group 'calendar)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
269
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
270 (defcustom todo-prefix "*/*"
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
271 "TODO mode prefix for entries.
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
272
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
273 This is useful in conjunction with `calendar' and `diary' if you use
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
274
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
275 #include \"~/.todo-do\"
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
276
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
277 in your diary file to include your todo list file as part of your
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
278 diary. With the default value \"*/*\" the diary displays each entry
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
279 every day and it may also be marked on every day of the calendar.
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
280 Using \"&%%(equal (calendar-current-date) date)\" instead will only
77383
e905e4598d5f Fix some typos.
Glenn Morris <rgm@gnu.org>
parents: 77305
diff changeset
281 show and mark todo entries for today, but may slow down processing of
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
282 the diary file somewhat."
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
283 :type 'string
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
284 :group 'todo)
98861
444fb994e174 (todo-file-do, todo-file-done, todo-file-top): Run file names that begin with
Eli Zaretskii <eliz@gnu.org>
parents: 96364
diff changeset
285 (defcustom todo-file-do (convert-standard-filename "~/.todo-do")
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
286 "TODO mode list file."
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
287 :type 'file
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
288 :group 'todo)
98861
444fb994e174 (todo-file-do, todo-file-done, todo-file-top): Run file names that begin with
Eli Zaretskii <eliz@gnu.org>
parents: 96364
diff changeset
289 (defcustom todo-file-done (convert-standard-filename "~/.todo-done")
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
290 "TODO mode archive file."
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
291 :type 'file
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
292 :group 'todo)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
293 (defcustom todo-mode-hook nil
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
294 "TODO mode hooks."
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
295 :type 'hook
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
296 :group 'todo)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
297 (defcustom todo-edit-mode-hook nil
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
298 "TODO Edit mode hooks."
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
299 :type 'hook
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
300 :group 'todo)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
301 (defcustom todo-insert-threshold 0
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
302 "TODO mode insertion accuracy.
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
303
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
304 If you have 8 items in your TODO list, then you may get asked 4
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
305 questions by the binary insertion algorithm. However, you may not
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
306 really have a need for such accurate priorities amongst your TODO
77383
e905e4598d5f Fix some typos.
Glenn Morris <rgm@gnu.org>
parents: 77305
diff changeset
307 items. If you now think about the binary insertion halving the size
77305
40f74d56a5f0 Fix typo: "threshhold" -> "threshold".
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
308 of the window each time, then the threshold is the window size at
40f74d56a5f0 Fix typo: "threshhold" -> "threshold".
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
309 which it will stop. If you set the threshold to zero, the upper and
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
310 lower bound will coincide at the end of the loop and you will insert
77305
40f74d56a5f0 Fix typo: "threshhold" -> "threshold".
Glenn Morris <rgm@gnu.org>
parents: 75346
diff changeset
311 your item just before that point. If you set the threshold to,
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
312 e.g. 8, it will stop as soon as the window size drops below that
63265
411ad86176dd (todo-insert-threshold): Fix spellings in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 62756
diff changeset
313 amount and will insert the item in the approximate center of that
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
314 window."
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
315 :type 'integer
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
316 :group 'todo)
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
317 (defvar todo-edit-buffer " *TODO Edit*"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
318 "TODO Edit buffer name.")
98861
444fb994e174 (todo-file-do, todo-file-done, todo-file-top): Run file names that begin with
Eli Zaretskii <eliz@gnu.org>
parents: 96364
diff changeset
319 (defcustom todo-file-top (convert-standard-filename "~/.todo-top")
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
320 "TODO mode top priorities file.
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
321
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
322 Not in TODO format, but diary compatible.
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
323 Automatically generated when `todo-save-top-priorities' is non-nil."
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
324 :type 'string
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
325 :group 'todo)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
326
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
327 (defcustom todo-print-function 'ps-print-buffer-with-faces
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
328 "Function to print the current buffer."
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
329 :type 'symbol
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
330 :group 'todo)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
331 (defcustom todo-show-priorities 1
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
332 "Default number of priorities to show by \\[todo-top-priorities].
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
333 0 means show all entries."
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
334 :type 'integer
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
335 :group 'todo)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
336 (defcustom todo-print-priorities 0
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
337 "Default number of priorities to print by \\[todo-print].
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
338 0 means print all entries."
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
339 :type 'integer
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
340 :group 'todo)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
341 (defcustom todo-remove-separator t
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
342 "Non-nil to remove category separators in\
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
343 \\[todo-top-priorities] and \\[todo-print]."
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
344 :type 'boolean
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
345 :group 'todo)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
346 (defcustom todo-save-top-priorities-too t
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
347 "Non-nil makes `todo-save' automatically save top-priorities in `todo-file-top'."
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
348 :type 'boolean
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
349 :group 'todo)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
350
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
351 ;; Thanks for the ISO time stamp format go to Karl Eichwalder <ke@suse.de>
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
352 ;; My format string for the appt.el package is "%3b %2d, %y, %02I:%02M%p".
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
353 ;;
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
354 (defcustom todo-time-string-format
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
355 "%:y-%02m-%02d %02H:%02M"
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
356 "TODO mode time string format for done entries.
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
357 For details see the variable `time-stamp-format'."
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
358 :type 'string
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
359 :group 'todo)
20193
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
360
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
361 (defcustom todo-entry-prefix-function 'todo-entry-timestamp-initials
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
362 "Function producing text to insert at start of todo entry."
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
363 :type 'symbol
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
364 :group 'todo)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
365 (defcustom todo-initials (or (getenv "INITIALS") (user-login-name))
92547
3c802ca7a7fa Remove leading `*' from defcustom doc-strings.
Glenn Morris <rgm@gnu.org>
parents: 87566
diff changeset
366 "Initials of todo item author."
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
367 :type 'string
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
368 :group 'todo)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
369
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
370 (defun todo-entry-timestamp-initials ()
20193
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
371 "Prepend timestamp and your initials to the head of a TODO entry."
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
372 (let ((time-stamp-format todo-time-string-format))
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
373 (concat (time-stamp-string) " " todo-initials ": ")))
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
374
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
375 ;; ---------------------------------------------------------------------------
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
376
19189
1519cf07cfab Fixed header, typos, layout, documentation.
Oliver Seidel <os10000@seidel-space.de>
parents: 19188
diff changeset
377 ;; Set up some helpful context ...
1519cf07cfab Fixed header, typos, layout, documentation.
Oliver Seidel <os10000@seidel-space.de>
parents: 19188
diff changeset
378
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
379 (defvar todo-categories nil
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
380 "TODO categories.")
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
381
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
382 (defvar todo-cats nil
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
383 "Old variable for holding the TODO categories.
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
384 Use `todo-categories' instead.")
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
385
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
386 (defvar todo-previous-line 0
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
387 "Previous line asked about.")
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
388
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
389 (defvar todo-previous-answer 0
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
390 "Previous answer got.")
19189
1519cf07cfab Fixed header, typos, layout, documentation.
Oliver Seidel <os10000@seidel-space.de>
parents: 19188
diff changeset
391
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
392 (defvar todo-mode-map
19179
dce72c66de1e Fixed insertion routine with help from Trey Jackson
Oliver Seidel <os10000@seidel-space.de>
parents: 19166
diff changeset
393 (let ((map (make-keymap)))
dce72c66de1e Fixed insertion routine with help from Trey Jackson
Oliver Seidel <os10000@seidel-space.de>
parents: 19166
diff changeset
394 (suppress-keymap map t)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
395 (define-key map "+" 'todo-forward-category)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
396 (define-key map "-" 'todo-backward-category)
20198
8fa6333a22f2 Improved documentation, fixed insertion with prefix.
Oliver Seidel <os10000@seidel-space.de>
parents: 20197
diff changeset
397 (define-key map "d" 'todo-file-item) ;done/delete
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
398 (define-key map "e" 'todo-edit-item)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
399 (define-key map "E" 'todo-edit-multiline)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
400 (define-key map "f" 'todo-file-item)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
401 (define-key map "i" 'todo-insert-item)
20197
33e3febd442d Implemented "insert-under-cursor" as suggested by
Oliver Seidel <os10000@seidel-space.de>
parents: 20196
diff changeset
402 (define-key map "I" 'todo-insert-item-here)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
403 (define-key map "j" 'todo-jump-to-category)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
404 (define-key map "k" 'todo-delete-item)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
405 (define-key map "l" 'todo-lower-item)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
406 (define-key map "n" 'todo-forward-item)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
407 (define-key map "p" 'todo-backward-item)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
408 (define-key map "P" 'todo-print)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
409 (define-key map "q" 'todo-quit)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
410 (define-key map "r" 'todo-raise-item)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
411 (define-key map "s" 'todo-save)
20193
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
412 (define-key map "S" 'todo-save-top-priorities)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
413 (define-key map "t" 'todo-top-priorities)
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
414 map)
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
415 "TODO mode keymap.")
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
416
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
417 (defvar todo-category-number 0 "TODO category number.")
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
418
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
419 (defvar todo-tmp-buffer-name " *todo tmp*")
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
420
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
421 (defvar todo-category-sep (make-string 75 ?-)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
422 "Category separator.")
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
423
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
424 (defvar todo-category-beg " --- "
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
425 "Category start separator to be prepended onto category name.")
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
426
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
427 (defvar todo-category-end "--- End"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
428 "Separator after a category.")
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
429
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
430 (defvar todo-header "-*- mode: todo; "
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
431 "Header of todo files.")
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
432
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
433 ;; ---------------------------------------------------------------------------
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
434
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
435 (defun todo-category-select ()
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
436 "Make TODO mode display the current category correctly."
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
437 (let ((name (nth todo-category-number todo-categories)))
19186
023404dbc696 Improved documentation. Broke some lines to comply with
Oliver Seidel <os10000@seidel-space.de>
parents: 19180
diff changeset
438 (setq mode-line-buffer-identification
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
439 ;; (concat "Category: " name))
20643
2a37005dcd69 Added patch from Don Hejna <djhejna@oasis.ambit.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 20419
diff changeset
440 (concat "Category: " (format "%18s" name)))
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
441 (widen)
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
442 (goto-char (point-min))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
443 (search-forward-regexp
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
444 (concat "^"
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
445 (regexp-quote (concat todo-prefix todo-category-beg name))
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
446 "$"))
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
447 (let ((begin (1+ (line-end-position))))
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
448 (search-forward-regexp (concat "^" todo-category-end))
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
449 (narrow-to-region begin (line-beginning-position))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
450 (goto-char (point-min)))))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
451 (defalias 'todo-cat-slct 'todo-category-select)
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
452
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
453 (defun todo-forward-category ()
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
454 "Go forward to TODO list of next category."
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
455 (interactive)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
456 (setq todo-category-number
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
457 (mod (1+ todo-category-number) (length todo-categories)))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
458 (todo-category-select))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
459 (defalias 'todo-cmd-forw 'todo-forward-category)
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
460
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
461 (defun todo-backward-category ()
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
462 "Go back to TODO list of previous category."
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
463 (interactive)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
464 (setq todo-category-number
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
465 (mod (1- todo-category-number) (length todo-categories)))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
466 (todo-category-select))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
467 (defalias 'todo-cmd-back 'todo-backward-category)
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
468
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
469 (defun todo-backward-item ()
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
470 "Select previous entry of TODO list."
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
471 (interactive)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
472 (search-backward-regexp (concat "^" (regexp-quote todo-prefix)) nil t)
19189
1519cf07cfab Fixed header, typos, layout, documentation.
Oliver Seidel <os10000@seidel-space.de>
parents: 19188
diff changeset
473 (message ""))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
474 (defalias 'todo-cmd-prev 'todo-backward-item)
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
475
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
476 (defun todo-forward-item (&optional count)
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
477 "Select COUNT-th next entry of TODO list."
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
478 (interactive "P")
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
479 (if (listp count) (setq count (car count)))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
480 (end-of-line)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
481 (search-forward-regexp (concat "^" (regexp-quote todo-prefix))
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
482 nil 'goto-end count)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
483 (beginning-of-line)
19189
1519cf07cfab Fixed header, typos, layout, documentation.
Oliver Seidel <os10000@seidel-space.de>
parents: 19188
diff changeset
484 (message ""))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
485 (defalias 'todo-cmd-next 'todo-forward-item)
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
486
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
487 (defun todo-save ()
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
488 "Save the TODO list."
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
489 (interactive)
40974
5fe63defd48e (todo-save): Add save-excursion and save-restriction.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
490 (save-excursion
5fe63defd48e (todo-save): Add save-excursion and save-restriction.
Richard M. Stallman <rms@gnu.org>
parents: 38436
diff changeset
491 (save-restriction
41188
0ca5d3516741 (todo-save): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 40974
diff changeset
492 (save-buffer)))
0ca5d3516741 (todo-save): Fix previous change.
Richard M. Stallman <rms@gnu.org>
parents: 40974
diff changeset
493 (if todo-save-top-priorities-too (todo-save-top-priorities)))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
494 (defalias 'todo-cmd-save 'todo-save)
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
495
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
496 (defun todo-quit ()
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
497 "Done with TODO list for now."
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
498 (interactive)
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
499 (widen)
20193
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
500 (todo-save)
19102
b605b8dbb880 Cleaned up variables, prefix and cursor position.
Oliver Seidel <os10000@seidel-space.de>
parents: 19101
diff changeset
501 (message "")
19189
1519cf07cfab Fixed header, typos, layout, documentation.
Oliver Seidel <os10000@seidel-space.de>
parents: 19188
diff changeset
502 (bury-buffer))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
503 (defalias 'todo-cmd-done 'todo-quit)
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
504
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
505 (defun todo-edit-item ()
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
506 "Edit current TODO list entry."
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
507 (interactive)
105812
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
508 (if (< (point-min) (point-max))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
509 (let ((item (todo-item-string)))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
510 (if (todo-string-multiline-p item)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
511 (todo-edit-multiline)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
512 (let ((new (read-from-minibuffer "Edit: " item)))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
513 (todo-remove-item)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
514 (insert new "\n")
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
515 (todo-backward-item)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
516 (message ""))))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
517 (error "No TODO list entry to edit")))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
518 (defalias 'todo-cmd-edit 'todo-edit-item)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
519
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
520 (defun todo-edit-multiline ()
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
521 "Set up a buffer for editing a multiline TODO list entry."
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
522 (interactive)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
523 (let ((buffer-name (generate-new-buffer-name todo-edit-buffer)))
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
524 (switch-to-buffer
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
525 (make-indirect-buffer
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
526 (file-name-nondirectory todo-file-do) buffer-name))
20042
691f7e0ee17d Added string-split (which I stole from ediff-util), changed
Oliver Seidel <os10000@seidel-space.de>
parents: 20028
diff changeset
527 (message "To exit, simply kill this buffer and return to list.")
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
528 (todo-edit-mode)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
529 (narrow-to-region (todo-item-start) (todo-item-end))))
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
530
34968
c8d0a552d56e (todo): Add :link, :version.
Dave Love <fx@gnu.org>
parents: 33795
diff changeset
531 ;;;###autoload
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
532 (defun todo-add-category (&optional cat)
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
533 "Add new category CAT to the TODO list."
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
534 (interactive)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
535 (let ((buf (find-file-noselect todo-file-do t))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
536 (prompt "Category: "))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
537 (unless (zerop (buffer-size buf))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
538 (and (null todo-categories)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
539 (null todo-cats)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
540 (error "Error in %s: File is non-empty but contains no category"
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
541 todo-file-do)))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
542 (unless cat (setq cat (read-from-minibuffer prompt)))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
543 (with-current-buffer buf
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
544 ;; reject names that could induce bugs and confusion
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
545 (while (and (cond ((string= "" cat)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
546 (setq prompt "Enter a non-empty category name: "))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
547 ((string-match "\\`\\s-+\\'" cat)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
548 (setq prompt "Enter a category name that is not only white space: "))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
549 ((member cat todo-categories)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
550 (setq prompt "Enter a non-existing category name: ")))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
551 (setq cat (read-from-minibuffer prompt))))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
552 ;; initialize a newly created Todo buffer for Todo mode
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
553 (unless (file-exists-p todo-file-do) (todo-mode))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
554 (setq todo-categories (cons cat todo-categories))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
555 (widen)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
556 (goto-char (point-min))
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
557 (if (search-forward "-*- mode: todo; " (+ (point-min) 16) t)
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
558 (kill-line)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
559 (insert "-*- mode: todo; \n")
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
560 (forward-char -1))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
561 (insert (format "todo-categories: %S; -*-" todo-categories))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
562 (forward-char 1)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
563 (insert (format "%s%s%s\n%s\n%s %s\n"
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
564 todo-prefix todo-category-beg cat
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
565 todo-category-end
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
566 todo-prefix todo-category-sep))
105372
bd2966850aac Use `called-interactively-p' instead of `interactive-p'.
Juanma Barranquero <lekktu@gmail.com>
parents: 104001
diff changeset
567 (if (called-interactively-p 'interactive)
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
568 ;; properly display the newly added category
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
569 (progn (setq todo-category-number 0) (todo-show))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
570 0))))
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
571
34968
c8d0a552d56e (todo): Add :link, :version.
Dave Love <fx@gnu.org>
parents: 33795
diff changeset
572 ;;;###autoload
20199
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
573 (defun todo-add-item-non-interactively (new-item category)
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
574 "Insert NEW-ITEM in TODO list as a new entry in CATEGORY."
20173
0044ff755ee7 Added three suggestions from Carsten
Oliver Seidel <os10000@seidel-space.de>
parents: 20172
diff changeset
575 (save-excursion
20195
c2017bcd6e9f Patch from Paul Stodghill <stodghil@CS.Cornell.EDU>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20194
diff changeset
576 (todo-show))
c2017bcd6e9f Patch from Paul Stodghill <stodghil@CS.Cornell.EDU>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20194
diff changeset
577 (save-excursion
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
578 (if (string= "" category)
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
579 (setq category (nth todo-category-number todo-categories)))
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
580 (let ((cat-exists (member category todo-categories)))
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
581 (setq todo-category-number
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
582 (if cat-exists
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
583 (- (length todo-categories) (length cat-exists))
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
584 (todo-add-category category))))
20199
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
585 (todo-show)
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
586 (setq todo-previous-line 0)
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
587 (let ((top 1)
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
588 (bottom (1+ (count-lines (point-min) (point-max)))))
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
589 (while (> (- bottom top) todo-insert-threshold)
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
590 (let* ((current (/ (+ top bottom) 2))
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
591 (answer (if (< current bottom)
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
592 (todo-more-important-p current) nil)))
20199
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
593 (if answer
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
594 (setq bottom current)
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
595 (setq top (1+ current)))))
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
596 (setq top (/ (+ top bottom) 2))
92956
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
597 ;; goto-line doesn't have the desired behavior in a narrowed buffer.
20199
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
598 (goto-char (point-min))
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
599 (forward-line (1- top)))
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
600 (insert new-item "\n")
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
601 (todo-backward-item)
20193
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
602 (todo-save)
19179
dce72c66de1e Fixed insertion routine with help from Trey Jackson
Oliver Seidel <os10000@seidel-space.de>
parents: 19166
diff changeset
603 (message "")))
20173
0044ff755ee7 Added three suggestions from Carsten
Oliver Seidel <os10000@seidel-space.de>
parents: 20172
diff changeset
604
34968
c8d0a552d56e (todo): Add :link, :version.
Dave Love <fx@gnu.org>
parents: 33795
diff changeset
605 ;;;###autoload
30027
a37837ad882e Minor doc fixes and code tweaks.
Dave Love <fx@gnu.org>
parents: 29472
diff changeset
606 (defun todo-insert-item (arg)
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
607 "Insert new TODO list entry.
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
608 With a prefix argument ARG solicit the category, otherwise use the current
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
609 category."
20173
0044ff755ee7 Added three suggestions from Carsten
Oliver Seidel <os10000@seidel-space.de>
parents: 20172
diff changeset
610 (interactive "P")
20195
c2017bcd6e9f Patch from Paul Stodghill <stodghil@CS.Cornell.EDU>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20194
diff changeset
611 (save-excursion
87566
0c4a74c24677 * progmodes/ada-xref.el (ada-prj-find-prj-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86495
diff changeset
612 (if (not (derived-mode-p 'todo-mode)) (todo-show))
20198
8fa6333a22f2 Improved documentation, fixed insertion with prefix.
Oliver Seidel <os10000@seidel-space.de>
parents: 20197
diff changeset
613 (let* ((new-item (concat todo-prefix " "
8fa6333a22f2 Improved documentation, fixed insertion with prefix.
Oliver Seidel <os10000@seidel-space.de>
parents: 20197
diff changeset
614 (read-from-minibuffer
8fa6333a22f2 Improved documentation, fixed insertion with prefix.
Oliver Seidel <os10000@seidel-space.de>
parents: 20197
diff changeset
615 "New TODO entry: "
8fa6333a22f2 Improved documentation, fixed insertion with prefix.
Oliver Seidel <os10000@seidel-space.de>
parents: 20197
diff changeset
616 (if todo-entry-prefix-function
8fa6333a22f2 Improved documentation, fixed insertion with prefix.
Oliver Seidel <os10000@seidel-space.de>
parents: 20197
diff changeset
617 (funcall todo-entry-prefix-function)))))
8fa6333a22f2 Improved documentation, fixed insertion with prefix.
Oliver Seidel <os10000@seidel-space.de>
parents: 20197
diff changeset
618 (current-category (nth todo-category-number todo-categories))
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
619 (category (if arg (todo-completing-read) current-category)))
20199
70fcbe6a5e23 Three insertion options:
Oliver Seidel <os10000@seidel-space.de>
parents: 20198
diff changeset
620 (todo-add-item-non-interactively new-item category))))
20173
0044ff755ee7 Added three suggestions from Carsten
Oliver Seidel <os10000@seidel-space.de>
parents: 20172
diff changeset
621
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
622 (defalias 'todo-cmd-inst 'todo-insert-item)
19179
dce72c66de1e Fixed insertion routine with help from Trey Jackson
Oliver Seidel <os10000@seidel-space.de>
parents: 19166
diff changeset
623
20197
33e3febd442d Implemented "insert-under-cursor" as suggested by
Oliver Seidel <os10000@seidel-space.de>
parents: 20196
diff changeset
624 (defun todo-insert-item-here ()
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
625 "Insert a new TODO list entry directly above the entry at point.
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
626 If point is on an empty line, insert the entry there."
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
627 (interactive)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
628 (if (not (derived-mode-p 'todo-mode)) (todo-show))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
629 (let ((new-item (concat todo-prefix " "
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
630 (read-from-minibuffer
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
631 "New TODO entry: "
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
632 (if todo-entry-prefix-function
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
633 (funcall todo-entry-prefix-function))))))
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
634 (unless (and (bolp) (eolp)) (todo-item-start))
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
635 (insert (concat new-item "\n"))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
636 (backward-char)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
637 ;; put point at start of new entry
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
638 (todo-item-start)))
20197
33e3febd442d Implemented "insert-under-cursor" as suggested by
Oliver Seidel <os10000@seidel-space.de>
parents: 20196
diff changeset
639
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
640 (defun todo-more-important-p (line)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
641 "Ask whether entry is more important than the one at LINE."
92956
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
642 (unless (equal todo-previous-line line)
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
643 (setq todo-previous-line line)
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
644 (goto-char (point-min))
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
645 (forward-line (1- todo-previous-line))
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
646 (let ((item (todo-item-string-start)))
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
647 (setq todo-previous-answer
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
648 (y-or-n-p (concat "More important than '" item "'? ")))))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
649 todo-previous-answer)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
650 (defalias 'todo-ask-p 'todo-more-important-p)
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
651
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
652 (defun todo-delete-item ()
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
653 "Delete current TODO list entry."
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
654 (interactive)
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
655 (if (> (count-lines (point-min) (point-max)) 0)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
656 (let* ((todo-entry (todo-item-string-start))
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
657 (todo-answer (y-or-n-p (concat "Permanently remove '"
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
658 todo-entry "'? "))))
92956
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
659 (when todo-answer
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
660 (todo-remove-item)
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
661 (todo-backward-item))
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
662 (message ""))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
663 (error "No TODO list entry to delete")))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
664 (defalias 'todo-cmd-kill 'todo-delete-item)
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
665
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
666 (defun todo-raise-item ()
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
667 "Raise priority of current entry."
19143
96a5705f73d5 Added Raise/Lower item.
Oliver Seidel <os10000@seidel-space.de>
parents: 19102
diff changeset
668 (interactive)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
669 (if (> (count-lines (point-min) (point)) 0)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
670 (let ((item (todo-item-string)))
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
671 (todo-remove-item)
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
672 (todo-backward-item)
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
673 (save-excursion
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
674 (insert item "\n"))
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
675 (message ""))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
676 (error "No TODO list entry to raise")))
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
677 (defalias 'todo-cmd-rais 'todo-raise-item)
19143
96a5705f73d5 Added Raise/Lower item.
Oliver Seidel <os10000@seidel-space.de>
parents: 19102
diff changeset
678
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
679 (defun todo-lower-item ()
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
680 "Lower priority of current entry."
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
681 (interactive)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
682 (if (> (count-lines (point) (point-max)) 1)
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
683 ;; Assume there is a final newline
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
684 (let ((item (todo-item-string)))
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
685 (todo-remove-item)
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
686 (todo-forward-item)
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
687 (save-excursion
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
688 (insert item "\n"))
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
689 (message ""))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
690 (error "No TODO list entry to lower")))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
691 (defalias 'todo-cmd-lowr 'todo-lower-item)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
692
20419
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
693 (defun todo-file-item (&optional comment)
29390
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
694 "File the current TODO list entry away, annotated with an optional COMMENT."
20419
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
695 (interactive "sComment: ")
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
696 (or (> (count-lines (point-min) (point-max)) 0)
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
697 (error "No TODO list entry to file away"))
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
698 (let ((time-stamp-format todo-time-string-format))
92956
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
699 (when (and comment (> (length comment) 0))
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
700 (goto-char (todo-item-end))
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
701 (insert
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
702 (if (save-excursion (beginning-of-line)
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
703 (looking-at (regexp-quote todo-prefix)))
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
704 " "
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
705 "\n\t")
cddd00e11754 (todo-add-category): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 92599
diff changeset
706 "(" comment ")"))
20419
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
707 (goto-char (todo-item-end))
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
708 (insert " [" (nth todo-category-number todo-categories) "]")
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
709 (todo-item-start)
20419
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
710 (let ((temp-point (point)))
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
711 (if (looking-at (regexp-quote todo-prefix))
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
712 (replace-match (time-stamp-string))
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
713 ;; Standard prefix -> timestamp
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
714 ;; Else prefix non-standard item start with timestamp
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
715 (insert (time-stamp-string)))
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
716 (append-to-file temp-point (todo-item-end 'include-sep) todo-file-done)
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
717 (delete-region temp-point (todo-item-end 'include-sep)))
20419
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
718 (todo-backward-item)
28110a85d23e Another patch by Michael Cook to fix annotation.
Oliver Seidel <os10000@seidel-space.de>
parents: 20388
diff changeset
719 (message "")))
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
720
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
721 ;; ---------------------------------------------------------------------------
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
722
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
723 ;; Utility functions:
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
724
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
725
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
726 ;;;###autoload
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
727 (defun todo-top-priorities (&optional nof-priorities category-pr-page
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
728 interactive)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
729 "List top priorities for each category.
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
730
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
731 Number of entries for each category is given by NOF-PRIORITIES which
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
732 defaults to `todo-show-priorities'.
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
733
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
734 If CATEGORY-PR-PAGE is non-nil, a page separator \'^L\' is inserted
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
735 between each category.
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
736 INTERACTIVE should be non-nil if this function is called interactively."
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
737
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
738 (interactive "P\ni\nP")
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
739 (or nof-priorities (setq nof-priorities todo-show-priorities))
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
740 (if (listp nof-priorities) ;universal argument
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
741 (setq nof-priorities (car nof-priorities)))
33795
152ae6b57597 (todo-top-priorities): Use
Dave Love <fx@gnu.org>
parents: 30028
diff changeset
742 (let ((todo-print-buffer-name todo-tmp-buffer-name)
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
743 ;;(todo-print-category-number 0)
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
744 (todo-category-break (if category-pr-page " " ""))
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
745 (cat-end
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
746 (concat
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
747 (if todo-remove-separator
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
748 (concat todo-category-end "\n"
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
749 (regexp-quote todo-prefix) " " todo-category-sep "\n")
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
750 (concat todo-category-end "\n"))))
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
751 beg end)
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
752 (save-excursion
105812
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
753 (todo-show)
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
754 (save-restriction
105812
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
755 (save-current-buffer
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
756 (widen)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
757 (copy-to-buffer todo-print-buffer-name (point-min) (point-max))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
758 (set-buffer todo-print-buffer-name)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
759 (goto-char (point-min))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
760 (when (re-search-forward (regexp-quote todo-header) nil t)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
761 (beginning-of-line 1)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
762 (delete-region (point) (line-end-position)))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
763 (while (re-search-forward ;Find category start
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
764 (regexp-quote (concat todo-prefix todo-category-beg))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
765 nil t)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
766 (setq beg (+ (line-end-position) 1)) ;Start of first entry.
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
767 (re-search-forward cat-end nil t)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
768 (setq end (match-beginning 0))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
769 (replace-match todo-category-break)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
770 (narrow-to-region beg end) ;In case we have too few entries.
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
771 (goto-char (point-min))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
772 (if (zerop nof-priorities) ;Traverse entries.
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
773 (goto-char end) ;All entries
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
774 (todo-forward-item nof-priorities))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
775 (setq beg (point))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
776 (delete-region beg end)
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
777 (widen))
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
778 (and (looking-at " ") (replace-match "")) ;Remove trailing form-feed.
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
779 (goto-char (point-min)) ;Due to display buffer
68937a278ce7 Stephen Berman <stephen.berman at gmx.net>
Glenn Morris <rgm@gnu.org>
parents: 105372
diff changeset
780 )))
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
781 (when interactive (display-buffer todo-print-buffer-name))
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
782 (message "Type C-x 1 to remove %s window. M-C-v to scroll the help."
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
783 todo-print-buffer-name)))
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
784
20193
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
785 (defun todo-save-top-priorities (&optional nof-priorities)
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
786 "Save top priorities for each category in `todo-file-top'.
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
787
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
788 Number of entries for each category is given by NOF-PRIORITIES which
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
789 defaults to `todo-show-priorities'."
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
790 (interactive "P")
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
791 (save-window-excursion
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
792 (save-excursion
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
793 (save-restriction
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
794 (todo-top-priorities nof-priorities)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
795 (set-buffer todo-tmp-buffer-name)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
796 (write-file todo-file-top)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
797 (kill-this-buffer)))))
20193
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
798
ab4710f1f645 Harald Backer <harald.backer@fou.telenor.no> sent the following:
Oliver Seidel <os10000@seidel-space.de>
parents: 20192
diff changeset
799 ;;;###autoload
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
800 (defun todo-print (&optional category-pr-page)
29390
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
801 "Print todo summary using `todo-print-function'.
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
802 If CATEGORY-PR-PAGE is non-nil, a page separator `^L' is inserted
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
803 between each category.
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
804
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
805 Number of entries for each category is given by `todo-print-priorities'."
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
806 (interactive "P")
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
807 (save-window-excursion
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
808 (save-excursion
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
809 (save-restriction
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
810 (todo-top-priorities todo-print-priorities
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
811 category-pr-page)
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
812 (set-buffer todo-tmp-buffer-name)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
813 (and (funcall todo-print-function)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
814 (kill-this-buffer))
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
815 (message "Todo printing done.")))))
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
816
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
817 (defun todo-jump-to-category ()
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
818 "Jump to a category. Default is previous category."
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
819 (interactive)
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
820 (let ((category (todo-completing-read)))
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
821 (if (string= "" category)
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
822 (setq category (nth todo-category-number todo-categories)))
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
823 (setq todo-category-number
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
824 (if (member category todo-categories)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
825 (- (length todo-categories)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
826 (length (member category todo-categories)))
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
827 (todo-add-category category)))
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
828 (todo-show)))
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
829
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
830 (defun todo-line-string ()
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
831 "Return current line in buffer as a string."
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
832 (buffer-substring (line-beginning-position) (line-end-position)))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
833
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
834 (defun todo-item-string-start ()
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
835 "Return the start of this TODO list entry as a string."
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
836 ;; Suitable for putting in the minibuffer when asking the user
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
837 (let ((item (todo-item-string)))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
838 (if (> (length item) 60)
20084
c97d281f1bd2 Jari Aalto <jari.aalto@ntc.nokia.com> writes:
Oliver Seidel <os10000@seidel-space.de>
parents: 20045
diff changeset
839 (setq item (concat (substring item 0 56) "...")))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
840 item))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
841
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
842 (defun todo-item-start ()
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
843 "Go to start of current TODO list item and return point."
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
844 (beginning-of-line)
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
845 (if (not (looking-at (regexp-quote todo-prefix)))
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
846 (search-backward-regexp
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
847 (concat "^" (regexp-quote todo-prefix)) nil t))
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
848 (point))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
849
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
850 (defun todo-item-end (&optional include-sep)
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
851 "Return point at end of current TODO list item.
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
852 If INCLUDE-SEP is non-nil, return point after the separator."
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
853 (save-excursion
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
854 (end-of-line)
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
855 (if (search-forward-regexp
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
856 (concat "^" (regexp-quote todo-prefix)) nil 'goto-end)
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
857 (goto-char (match-beginning 0)))
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
858 (unless include-sep (skip-chars-backward "\n"))
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
859 (point)))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
860
28889
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
861 (defun todo-remove-item ()
7d6f2982fe6e Remove some compatibility stuff and CL
Dave Love <fx@gnu.org>
parents: 24720
diff changeset
862 "Delete the current entry from the TODO list."
105843
4e4705fae3d0 (todo-add-category): Don't hardcode point-min==1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 105812
diff changeset
863 (delete-region (todo-item-start) (todo-item-end 'include-sep)))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
864
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
865 (defun todo-item-string ()
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
866 "Return current TODO list entry as a string."
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
867 (buffer-substring (todo-item-start) (todo-item-end)))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
868
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
869 (defun todo-string-count-lines (string)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
870 "Return the number of lines STRING spans."
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
871 (length (split-string string "\n")))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
872
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
873 (defun todo-string-multiline-p (string)
20194
c7b847e97647 Improvements sent in by Dave Love <d.love@dl.ac.uk>:
Oliver Seidel <os10000@seidel-space.de>
parents: 20193
diff changeset
874 "Return non-nil if STRING spans several lines."
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
875 (> (todo-string-count-lines string) 1))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
876
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
877 (defun todo-completing-read ()
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
878 "Return a category name, with completion, for use in Todo mode."
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
879 ;; make a copy of todo-categories in case history-delete-duplicates is
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
880 ;; non-nil, which makes completing-read alter todo-categories
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
881 (let* ((categories (copy-sequence todo-categories))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
882 (history (cons 'todo-categories (1+ todo-category-number)))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
883 (default (nth todo-category-number todo-categories))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
884 (category (completing-read
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
885 (concat "Category [" default "]: ")
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
886 todo-categories nil nil nil history default)))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
887 ;; restore the original value of todo-categories
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
888 (setq todo-categories categories)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
889 category))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
890
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
891 ;; ---------------------------------------------------------------------------
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
892
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
893 (easy-menu-define todo-menu todo-mode-map "Todo Menu"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
894 '("Todo"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
895 ["Next category" todo-forward-category t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
896 ["Previous category" todo-backward-category t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
897 ["Jump to category" todo-jump-to-category t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
898 ["Show top priority items" todo-top-priorities t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
899 ["Print categories" todo-print t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
900 "---"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
901 ["Edit item" todo-edit-item t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
902 ["File item" todo-file-item t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
903 ["Insert new item" todo-insert-item t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
904 ["Insert item here" todo-insert-item-here t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
905 ["Kill item" todo-delete-item t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
906 "---"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
907 ["Lower item priority" todo-lower-item t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
908 ["Raise item priority" todo-raise-item t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
909 "---"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
910 ["Next item" todo-forward-item t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
911 ["Previous item" todo-backward-item t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
912 "---"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
913 ["Save" todo-save t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
914 ["Save Top Priorities" todo-save-top-priorities t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
915 "---"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
916 ["Quit" todo-quit t]
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
917 ))
19166
8af428cb3906 Incorporated menus for XEmacs from Allan.Cochrane@soton.sc.philips.com,
Oliver Seidel <os10000@seidel-space.de>
parents: 19165
diff changeset
918
20088
1d51bc7c2563 Thanks to Harald Backer <harald.backer@fou.telenor.no>, we now have
Oliver Seidel <os10000@seidel-space.de>
parents: 20084
diff changeset
919 ;; As calendar reads .todo-do before todo-mode is loaded.
34968
c8d0a552d56e (todo): Add :link, :version.
Dave Love <fx@gnu.org>
parents: 33795
diff changeset
920 ;;;###autoload
29390
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
921 (defun todo-mode ()
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
922 "Major mode for editing TODO lists.
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
923
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
924 \\{todo-mode-map}"
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
925 (interactive)
62756
845536eca3d9 (todo-mode): Use kill-all-local-variables and run-mode-hooks.
Lute Kamstra <lute@gnu.org>
parents: 54770
diff changeset
926 (kill-all-local-variables)
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
927 (setq major-mode 'todo-mode)
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
928 (setq mode-name "TODO")
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
929 (use-local-map todo-mode-map)
19188
56e1d94a7083 Applied patch from Istvan Marko <istvan@cmdmail.amd.com>
Oliver Seidel <os10000@seidel-space.de>
parents: 19187
diff changeset
930 (easy-menu-add todo-menu)
62756
845536eca3d9 (todo-mode): Use kill-all-local-variables and run-mode-hooks.
Lute Kamstra <lute@gnu.org>
parents: 54770
diff changeset
931 (run-mode-hooks 'todo-mode-hook))
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
932
92599
f90cefa62737 Remove un-needed eval-when-compile.
Glenn Morris <rgm@gnu.org>
parents: 92547
diff changeset
933 (defvar date)
f90cefa62737 Remove un-needed eval-when-compile.
Glenn Morris <rgm@gnu.org>
parents: 92547
diff changeset
934 (defvar entry)
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
935
86495
65af9ed993be (calendar-current-date): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents: 85510
diff changeset
936 ;; t-c should be used from diary code, which requires calendar.
104001
27e12d5d8f28 (calendar-current-date): Update declaration.
Glenn Morris <rgm@gnu.org>
parents: 101655
diff changeset
937 (declare-function calendar-current-date "calendar" (&optional offset))
86495
65af9ed993be (calendar-current-date): Declare as a function.
Glenn Morris <rgm@gnu.org>
parents: 85510
diff changeset
938
20196
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
939 ;; Read about this function in the setup instructions above!
34968
c8d0a552d56e (todo): Add :link, :version.
Dave Love <fx@gnu.org>
parents: 33795
diff changeset
940 ;;;###autoload
20196
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
941 (defun todo-cp ()
29390
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
942 "Make a diary entry appear only in the current date's diary."
20196
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
943 (if (equal (calendar-current-date) date)
29390
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
944 entry))
20196
5c9cedc7dd75 Incorporated simplifying suggestions from
Oliver Seidel <os10000@seidel-space.de>
parents: 20195
diff changeset
945
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
946 (define-derived-mode todo-edit-mode text-mode "TODO Edit"
29390
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
947 "Major mode for editing items in the TODO list.
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
948
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
949 \\{todo-edit-mode-map}")
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
950
34968
c8d0a552d56e (todo): Add :link, :version.
Dave Love <fx@gnu.org>
parents: 33795
diff changeset
951 ;;;###autoload
29390
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
952 (defun todo-show ()
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
953 "Show TODO list."
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
954 (interactive)
101600
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
955 ;; Call todo-initial-setup only if there is neither a Todo file nor
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
956 ;; a corresponding unsaved buffer.
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
957 (if (or (file-exists-p todo-file-do)
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
958 (let* ((buf (get-buffer (file-name-nondirectory todo-file-do)))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
959 (bufname (buffer-file-name buf)))
10d6e33982c3 (todo-insert-item-here): Prevent insertion
Chong Yidong <cyd@stupidchicken.com>
parents: 100908
diff changeset
960 (equal (expand-file-name todo-file-do) bufname)))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
961 (find-file todo-file-do)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
962 (todo-initial-setup))
30028
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
963 (if (null todo-categories)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
964 (if (null todo-cats)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
965 (error "Error in %s: No categories in list `todo-categories'"
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
966 todo-file-do)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
967 (goto-char (point-min))
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
968 (and (search-forward "todo-cats:" nil t)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
969 (replace-match "todo-categories:"))
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
970 (make-local-variable 'todo-categories)
2a636f84f3c5 Replaced with a working version, based on revision 1.34 tidied up.
Dave Love <fx@gnu.org>
parents: 30027
diff changeset
971 (setq todo-categories todo-cats)))
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
972 (beginning-of-line)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
973 (todo-category-select))
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
974
29390
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
975 (defun todo-initial-setup ()
bc5fce1393f8 [This needs more work on the outline stuff.]
Dave Love <fx@gnu.org>
parents: 28889
diff changeset
976 "Set up things to work properly in TODO mode."
19165
9bf7fc374b58 Added improvements from Ron Gut <rgut@aware.com>.
Oliver Seidel <os10000@seidel-space.de>
parents: 19143
diff changeset
977 (find-file todo-file-do)
20028
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
978 (erase-buffer)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
979 (todo-mode)
a5846414f380 Harald Meland <harald.meland@usit.uio.no> asked for
Oliver Seidel <os10000@seidel-space.de>
parents: 19436
diff changeset
980 (todo-add-category "Todo"))
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
981
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
982 (provide 'todo-mode)
19100
0cbf5673993f Initial revision
Oliver Seidel <os10000@seidel-space.de>
parents:
diff changeset
983
87566
0c4a74c24677 * progmodes/ada-xref.el (ada-prj-find-prj-file):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 86495
diff changeset
984 ;; arch-tag: 6fd91be5-776e-4464-a109-da4ea0e4e497
19436
38aa295db414 - changed name to todo-mode
Oliver Seidel <os10000@seidel-space.de>
parents: 19189
diff changeset
985 ;;; todo-mode.el ends here