1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-31 01:20:37 -08:00
Commit graph

1644 commits

Author SHA1 Message Date
Stephen Berman
d5a845b4d0 * calendar/todo-mode.el (todo-rename-file): Fix incorrect use of
replace-regexp-in-string and inadvertent omissions in previous change.
(todo-filter-items): Ensure only file names are comma-separated in
renamed filtered items buffer.
2013-07-29 00:34:32 +02:00
Stephen Berman
ae43b66aba * calendar/todo-mode.el: Add command to rename todo files.
(todo-rename-file): New command.
(todo-key-bindings-t): Add key binding for it.  Change the
bindings of todo-filter-regexp-items(-multifile) to use `x'
instead of `r', since the latter is better suited to the new
renaming command.
2013-07-27 17:58:56 +02:00
Stephen Berman
d610f6dd0f * calendar/todo-mode.el: Add handling of file deletion, both by
mode command and externally.  Fix various related bugs.  Clarify
Commentary and improve some documentation strings and code.
(todo-delete-file): New command.
(todo-check-file): New function.
(todo-show): Handle external deletion of the file we're trying to
show.  Replace called-interactively-p by an optional
prefix argument to avoid problematic interaction with catch form
when byte compiled (bug#14702).
(todo-quit): Handle external deletion of the archive's todo file.
Make sure the buffer that was visiting the archive file is still
live before trying to bury it.
(todo-category-completions): Handle external deletion of any
category completion files.
(todo-jump-to-category, todo-basic-insert-item): Recalculate list
of todo files, in case of external deletion.
(todo-add-file): Replace unnecessary setq by let-binding.
(todo-find-archive): Check whether there are any archives.
Replace unnecessary setq by let-binding.
(todo-archive-done-item): Use find-file-noselect to get the
archive buffer whether or not the archive already exists.  Remove
superfluous code.  Use file size instead of buffer-file-name to
check if the archive is new; if it is, update list of archives.
(todo-default-todo-file): Allow nil to be a valid value for when
there are no todo files.
(todo-reevaluate-default-file-defcustom): Use corrected definition
of todo-default-todo-file.
(todo-key-bindings-t+a+f): Add key binding for todo-delete-file.
(todo-delete-category, todo-show-categories-table)
(todo-category-number): Clarify comment.
(todo-filter-items): Clarify documentation string.
(todo-show-current-file, todo-display-as-todo-file)
(todo-reset-and-enable-done-separator): Tweak documentation string.
(todo-done-separator): Make separator length window-width, since
bug#2749 is now fixed.

Fixes: debbugs:14688
2013-07-05 16:03:35 +02:00
Paul Eggert
adc5dbceb0 Spelling fixes. 2013-06-30 08:10:33 -07:00
Stephen Berman
5b8f19cc5e * calendar/ChangeLog: Remove prior to merging new version of
todo-mode.el to trunk.
2013-06-21 23:04:32 +02:00
Stephen Berman
ebc83885b7 * todo-mode.el: Change two occurrences of "document string" to
"documentation string".
2013-06-21 16:07:46 +02:00
Stephen Berman
4fe738d374 * todo-mode.el: Clean up doc strings, comments and prompt strings,
mainly by changing "Todo" to "todo" when it is not part of a mode
name or does not begin a sentence.
2013-06-21 16:02:39 +02:00
Stephen Berman
03e6d46963 * todo-mode.el: Offer to convert legacy file. Update commentary.
(todo-show): If a legacy file is found and no new todo file
exists, offer to convert it and show it.  Restore autoload cookie.
(todo-convert-legacy-files): Delete unused local variable.
If todo-directory doesn't exist, create it before writing to file.
Check format of converted files.  Prompt to show converted todo file.
2013-06-21 15:23:51 +02:00
Stephen Berman
e2ff2f69b9 * todo-mode.el (todo-convert-legacy-files): Eliminate last change,
since it couldn't avoid namespace clashes, and instead let local
variables hold the legacy values used for conversion.  This also
does not interfere with live todo buffers.
2013-06-19 22:11:03 +02:00
Stephen Berman
ddce2e3ed1 * todo-mode.el: Rename from todos.el, change all occurrences of
"todos-" prefix to "todo-" and references to "Todos" to "Todo" or
"Todo mode".
2013-06-19 21:59:26 +02:00
Stephen Berman
18b4baa8a4 * calendar/todo-mode.el: Rename to otodo-mode.el and move to obsolete/. 2013-06-19 21:50:32 +02:00
Stephen Berman
5e7b7e2bb3 * todos.el (todos-convert-legacy-files): Add code to make it work
after the new version is renamed and has the same namespace as the
old version.  This also requires there to be no live todo buffers
when this command is called.
2013-06-19 14:22:46 +02:00
Stephen Berman
857b9748a7 * todos.el: Reinstate current copyright dates and original
todo-mode.el author.  Add reference in commentary to legacy file
format conversion command.
(todos-legacy-date-time-regexp): Rename from
todos-todo-mode-date-time-regexp and adjust uses.
2013-06-18 19:44:01 +02:00
Stephen Berman
a8f4bb8361 * diary-lib.el (diary-goto-entry-function): New variable.
(diary-entry): Use it in the action of this button type instead of
diary-goto-entry.

* todos.el (todos-diary-goto-entry): Add item locating code from
diary-goto-entry.  Add it at the top-level to override the latter
function.
(todos-powerset): Use definition by Wolfgang Jenkner, posted at
http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00423.html.
2013-06-18 18:05:01 +02:00
Stephen Berman
bd35877986 Merge from trunk. 2013-06-14 22:07:55 +02:00
Stephen Berman
2a97b47f08 * todos.el (todos-edit-done-item-comment): Rename from
todos-done-item-add-edit-or-delete-comment.
(todos-key-bindings-t): Use it.
2013-06-09 23:22:33 +02:00
Stephen Berman
d7a49dae50 * todos.el: Fix and improve item date string editing.
(todos-date-pattern): Make dayname an explicitly numbered group.
(todos-basic-edit-item-header): Set match for dayname and use it
to ensure attempting to edit day, month or year of a date header
containing a day name is a noop, simplifying and fixing buggy code.
2013-06-09 21:16:39 +02:00
Stephen Berman
85ea34e22c * todos.el: Improve commentary.
(todos-item-end): Revert last change, since bug#14565 is now fixed.
2013-06-09 01:40:21 +02:00
Stephen Berman
8b27b080c1 * todos.el: Reorganize file structure again, to pacify byte-compiler. 2013-06-08 00:55:42 +02:00
Stephen Berman
1d59b7236c * todos.el: Fix byte-compiler warnings.
(todos-merge-category): Relocate let-bound variable.
(todos-toggle-item-highlighting): Restrict to todos-mode,
todos-archive-mode and todos-filtered-items-mode.
(todos-toggle-item-header, todos-diary-goto-entry)
(todos-insert-sort-button): Let-bind variables that were
mistakenly free.
(todos-convert-legacy-files): Just require todo-mode instead of
conditionalizing it.
(todos-modes-set-2): Check whether hl-line-range-function is void.
2013-06-05 23:43:44 +02:00
Stephen Berman
db5ea4772d * todos.el: Further code cleanup. Changes to commentary. Remove
autoload cookies.  Handle todo items in Fancy Diary display.
(todos-done-separator): Reinstate length one less than
window-width until bug#2749 is fixed.
(todos-diary-goto-entry): New function, extracted from adapted
definition of diary-goto-entry, which is removed to be added to
diary-lib.el.
(todos-powerset): Rename from todos-powerset-iterative and remove
defalias by this name.  Add doc string and comments.
(todos-modes-set-1, todos-modes-set-2, todos-modes-set-3)
(todos-mode-external-set): Add doc string.
2013-06-05 15:59:14 +02:00
Stephen Berman
c66f681c4f * todos.el (todos-add-item-if-new-category): Change default value.
(todos-show, todos-jump-to-category, todos-add-file)
(todos-add-category): Update doc string to reflect new default
prompt for item insertion.
(todos-add-file): Add omitted argument to called-interactively-p.
(todos-show): Improve handling of adding first category.
2013-06-05 00:34:11 +02:00
Stephen Berman
37f482490b * todos.el: Allow prompting for first item on adding a new
category.  Fix handling of default todo file on adding first file.
(todos-add-item-if-new-category): New defcustom.
(todos-show, todos-jump-to-category, todos-add-category): Use it.
(todos-short-file-name): Return nil if file name is not a string.
(todos-add-file): Recalculate todos-files after adding a file.
(todos-show): If first file was just added, make it the default.
2013-06-04 16:51:01 +02:00
Stephen Berman
6d12ff8b33 * todos.el (todos-read-category, todos-merge-category):
Fix argument value to accord with documented change from 2013-05-14.
2013-06-04 13:06:18 +02:00
Stephen Berman
e99a2125b5 * todos.el: More code cleanup. Update file copyright and author
lines, add commentary.  Reformat so most lines do not exceed 80
columns.  Fix doc strings problems found by checkdoc.
(todos-edit-file): Delete unused argument.
(todos-delete-item): Delete superfluous concat.
(todos-next-button, todos-previous-button): Delete optional
arguments, adjusting interactive spec accordingly, and add them as
non-nil arguments to the invocations of forward-button and
backward-button.
2013-06-03 15:54:28 +02:00
Stephen Berman
cc416fd363 * todos.el (todos-y-with-space): New defcustom.
(todos-y-or-n-p): New function.
(todos-delete-category, todos-move-category, todos-delete-item)
(todos-done-item-add-edit-or-delete-comment, todos-item-undone)
(todos-find-archive, todos-archive-done-item, todos-search)
(todos-read-category): Use it instead of y-or-n-p.
2013-06-03 10:35:37 +02:00
Stephen Berman
9e6b072c72 * todos.el (todos-show-categories-table): Correct doc string.
(todos-sort-categories-alphabetically-or-numerically): Rename from
todos-sort-categories-alphabetically-or-by-priority and adjust uses.
(todos-set-category-number): Rename from
todos-set-category-priority and adjust uses.
(todos-raise-category): Rename from todos-raise-category-priority
and adjust uses.
(todos-lower-category): Rename from todos-lower-category-priority
and adjust uses.
2013-06-02 23:37:57 +02:00
Stephen Berman
53e63b4cb9 * todos.el: Some custom cleanup.
(todos-edit): Rename from todos-item-insertion and adjust doc string.
(todos-display): Rename from todos-mode-display.
(todos-item-mark, todos-undo-item-omit-comment): Change :group to
todos-edit.
(todos-indent-to-here): Change :group to todos-display.
(todos, todos-edit, todos-categories, todos-filtered)
(todos-display, todos-faces): Change :version to "24.4".
2013-06-01 18:01:47 +02:00
Stephen Berman
23cbdcbcbe * todos.el (todos-filtered-items-mode-map): Fix omission in
previous change.
(todos-mode): Comment out invocation of easy-menu-add, since menu
definition was commented out in last change.
2013-06-01 15:55:35 +02:00
Stephen Berman
e4ae44d950 * todos.el: Move auto-mode-alist entries above provide sexp.
Update adapted diary-goto-entry, so it also works with todo items
when the buffer in which the included todo file is processed for
the Fancy Diary is not killed.
(todos-insert-item-from-calendar): Move to item editing commands
section of file.  Add doc string, use todos-basic-insert-item and
remove mistaken invocation of todos-show.
2013-06-01 01:37:53 +02:00
Stephen Berman
9fa6407338 * todos.el (todos-edit-quit): After editing an item, make sure to
return to its category.
2013-05-31 15:43:25 +02:00
Stephen Berman
a9b0e28e23 * todos.el: Clean up code. Uncapitalize file name in first line.
Require cl-lib instead of cl.  Add section title separators.
Reindent some code and comments.  Comment out Todos mode menu
definition.
(todos-basic-insert-item): Rename from todos-insert-item-1 and
adjust uses.
(todos-basic-edit-item-header): Rename from
todos-edit-item-header-1 and adjust uses.
(todos-display-categories): Rename from todos-display-categories-1
and adjust uses.
(todos-show, todos-basic-insert-item)
(todos-basic-edit-item-header, todos-set-item-priority)
(todos-item-undone, todos-convert-legacy-files)
(todos-check-format, todos-filter-items-1):
Use user-error instead of error.
(todos-add-file, todos-basic-insert-item, todos-mark)
(todos-button, todos-sorted-column, todos-archived-only)
(todos-search, todos-category-string)
(todos-top-priorities-overrides)
(todos-insertion-commands-args-genlist, todos-filter-items)
(todos-filter-items-1, todos-filtered-items-mode-map):
Correct or improve document string.
(todos-edit-file)
(todos-sort-categories-alphabetically-or-by-priority)
(todos-sort-categories-by-todo, todos-sort-categories-by-diary)
(todos-sort-categories-by-done)
(todos-sort-categories-by-archived, todos-next-button)
(todos-previous-button, todos-gen-arglists)
(todos-define-insertion-command)
(todos-insertion-commands-arg-key-list)
(todos-insertion-key-bindings, todos-update-categories-display):
Add document string.
(todos-powerset-recursive): Rename from powerset-recursive and
reformulate slightly.
(todos-powerset-iterative): Rename from powerset-bitwise and
reformulate.
(todos-insertion-commands-args): Use cl-remove-duplicates instead
of remove-duplicates.
(todos-define-insertion-command): Improve doc string of generated defun.
(todos-adjusted-category-label-length)
(todos-insert-category-line, todos-update-categories-display):
Call cl-oddp instead of inlining its definition.
(todos-key-bindings): Remove, replacing by the following.
(todos-key-bindings-t, todos-key-bindings-t+a+f)
(todos-key-bindings-t+a, todos-key-bindings-t+f): New variables.
(todos-mode-map): Use new key-binding variables.
(todos-archive-mode-map, todos-filtered-items-mode-map): Use new
key-binding variables.  Don't suppress digit keys.
(todos-categories-mode-map): Don't suppress digit keys.
(todos-modes-set-1, todos-modes-set-2, todos-modes-set-3)
(todos-mode, todos-archive-mode, todos-mode-external-set):
Use setq-local instead of make-local-variable.
2013-05-31 15:08:21 +02:00
Stephen Berman
27139cd5e8 * todos.el: Reorganize file structure. 2013-05-24 11:29:53 +02:00
Stephen Berman
6a6394e670 * todos.el (todos-edit-quit): Don't allow dateless item. 2013-05-22 13:23:36 +02:00
Stephen Berman
f4228ddc97 * todos.el (todos-key-bindings, todos-archive-mode-map)
(todos-filtered-items-mode-map): Update bindings.
(todos-find-archive): Rename from todos-show-archive and adjust uses.
(todos-find-filtered-items-file): New command.
2013-05-21 15:49:12 +02:00
Stephen Berman
8a10ab0299 * todos.el: Use visual-line-mode instead of custom code.
(todos-line-wrapping-function, todos-wrap-and-indent): Remove.
(todos-wrap-lines, todos-indent-to-here): Update doc string.
(todos-modes-set-1): Use visual-line-mode.
2013-05-21 12:04:44 +02:00
Stephen Berman
e8429183d5 * todos.el (todos-read-file-name): Fix previous change to ensure
it works when invoked outside of a Todos file.
2013-05-21 11:23:52 +02:00
Stephen Berman
d196d62507 * todos.el: Fixes concerning filtered items.
(todos-mode-line-control): Make doc string more precise.
(todos-read-file-name): Default to current file when user hits RET
without choosing a file, to avoid creating file with empty base name.
(todos-filter-items): Rename buffer of filtered items files.
(todos-find-item): Save match data to avoid arg out of range error.
(todos-print-buffer): Fix header of filtered items buffer output.
2013-05-20 16:26:08 +02:00
Stephen Berman
17de84fb54 * todos.el (todos-done-separator): Use window-width for length, in
anticipation of bug#2749 being fixed.
2013-05-17 23:41:09 +02:00
Stephen Berman
60c9e80317 * todos.el (todos-category-completions): Restore point after
ensuring category is properly displayed.
2013-05-17 16:26:58 +02:00
Stephen Berman
ea3ae33b5b * todos.el (todos-filtered-items-mode-map): Update some bindings.
(todos-show): Make it work the same in todos-archive-mode and
todos-filtered-items-mode as in todos-mode.
(todos-quit): When called in todos-archive-mode, switch to
corresponding category in todo file.  When called in todos-mode,
avoid going right back to archive.
2013-05-16 20:29:06 +02:00
Stephen Berman
46fa56ece0 * todos.el: Improve toggling of item numbering and headers.
(todos-prefix-overlays): Don't reset item numbering for
done items unless in todos-mode.
(todos-archive-mode-map): Add bindings for todos-toggle-item-header.
(todos-toggle-prefix-numbers): Reimplement without using
todos-reset-prefix and make it work in Todos Archive mode and
Todos Filtered Items mode.
(todos-toggle-item-header): Make it work in Todos Archive mode and
Todos Filtered Items mode.
2013-05-16 12:02:26 +02:00
Stephen Berman
860ae8b019 * todos.el: Use tab instead of spaces to indent.
(todos-indent-to-here): Change default value.
(todos-modes-set-1): Make tab-width a local variable and set it to
todos-indent-to-here.
(todos-insert-item-1, todos-edit-item): Use tab not spaces to indent.
(todos-edit-quit): Use tab not spaces to indent and fix omission of item.
2013-05-15 16:44:07 +02:00
Stephen Berman
407d724e35 * todos.el (todos-jump-to-category): Fix wrong variable left over
from previous change.
2013-05-15 15:24:45 +02:00
Stephen Berman
04c9cdf7e8 * todos.el: Improve handling of jumping to a category, in
particular that of an archive.
(todos-category-completions): Add optional parameter to restrict
completions of archive categories to current archive.  Exclude
archive from completion files.
(todos-read-category): When called from an archive, restrict
category completions to the archive.  Fix mistaken use of all
completion files instead of just those in which the chosen
category occurs.
(todos-archive-mode-map): Add new key binding.
(todos-jump-to-category): Rename second optional parameter and
extend its use to restricting category completions to the current
archive.
(todos-jump-to-archive-category): New command.
2013-05-14 23:52:19 +02:00
Stephen Berman
199b0d3904 * todos.el (todos-modes-set-2): Restore point after finding start
and end of hl-line-range-function.
2013-05-13 11:59:59 +02:00
Stephen Berman
74e1403148 * todos.el: Fixes for item marking and marked items.
(todos-toggle-mark-item): Make no-op if point is not on an item.
Toggle mark even if point is not at start of item.
(todos-item-done): Signal an error if a done item is marked.
Process marked todo items even if point is in done items section.
2013-05-13 11:42:25 +02:00
Glenn Morris
472a3834de * diary-lib.el (diary-outlook-format-1): Don't include dayname in the output.
Fixes: debbugs:14349
2013-05-11 18:34:30 -07:00
Stephen Berman
5bdcc43053 * todos.el (todos-item-undone): Remove item highlighting when user
quits before deciding whether to omit comment.  Fix misplaced
closing paren.  Change two uses of `if' to `when'.
2013-05-11 22:50:28 +02:00
Stephen Berman
caa229d50a * todos.el: Rename numerous commands and defcustoms and adjust all
uses, change numerous key bindings, make some basic commands
noninteractive and use them to define the commands, unify
archiving commands.
(todos-directory): Rename from todos-files-directory.
(todos-print-buffer-function): Rename from todos-print-function.
(todos-number-prefix): Rename from todos-number-priorities.
(todos-top-priorities-overrides): Rename from todos-priorities-rules.
(todos-top-priorities): Rename from todos-show-priorities.
(todos-insertion-command-name, todos-insertion-key-bindings):
Use "todos-insert-item-".
(todos-key-bindings, todos-archive-mode-map)
(todos-categories-mode-map, todos-filtered-items-mode-map):
Adjust to renamed commands, make bindings more systematic,
reorder entries.
(todos-show-categories-table): Rename from todos-display-categories.
(todos-sort-categories-alphabetically-or-by-priority): Rename from
todos-display-categories-alphabetically-or-by-priority.
(todos-sort-categories-by-todo): Rename from
todos-display-categories-sorted-by-todo.
(todos-sort-categories-by-diary): Rename from
todos-display-categories-sorted-by-diary.
(todos-sort-categories-by-done): Rename from
todos-display-categories-sorted-by-done.
(todos-sort-categories-by-archived): Rename from
todos-display-categories-sorted-by-archived.
(todos-print-buffer): Rename function from todos-print.
(todos-print-buffer-to-file): Rename from todos-print-to-file.
(todos-go-to-source-item): Rename from todos-jump-to-item.
(todos-forward-item, todos-backward-item): Remove interactive form
and move most of doc string and prefix argument error checking to...
(todos-next-item, todos-previous-item): ...these new commands,
which use the preceding functions.
(todos-next-button): Rename from todos-forward-button.
(todos-previous-button): Rename from todos-backward-button.
(todos-toggle-prefix-numbers): Rename from
todos-hide-show-item-numbering.
(todos-toggle-view-done-items): Rename from todos-hide-show-done-items.
(todos-toggle-view-done-only): Rename from todos-show-done-only.
(todos-toggle-item-highlighting): Rename from todos-highlight-item.
(todos-toggle-item-header): Rename from todos-hide-show-date-time.
(todos-toggle-mark-item): Rename from todos-mark-unmark-item.
(todos-filter-top-priorities): Rename from todos-top-priorities.
(todos-filter-top-priorities-multifile): Rename from
todos-top-priorities-multifile.
(todos-filter-diary-items): Rename from todos-diary-items.
(todos-filter-diary-items-multifile): Rename from
todos-diary-items-multifile.
(todos-filter-regexp-items): Rename from todos-regexp-items.
(todos-filter-regexp-items-multifile): Rename from
todos-regexp-items-multifile.
(todos-insert-item-1): Remove interactive form, since
todos-insert-item is generated like other item insertion commands.
(todos-edit-file): Rename from todos-edit-multiline.
(todos-item-undone): Rename from todos-item-undo.
(todos-archive-done-item): Add raw prefix spec to interactive form
and use it to test for archiving all done items in category;
reorder tests in function body accordingly.
(todos-archive-category-done-items): Remove.
2013-05-11 00:57:47 +02:00