(timeclock-ask-before-exiting, timeclock-use-display-time): Use `symbol'.
(timeclock-modeline-display): Define as alias before the actual definition.
(timeclock-mode-line-display): Use define-minor-mode.
(timeclock-day-list-template): Make it a function, add an argument.
(timeclock-day-list-required, timeclock-day-list-length)
(timeclock-day-list-debt, timeclock-day-list-span)
(timeclock-day-list-break): Adjust calls accordingly.
* lisp/calendar/calendar.el (calendar-weekday-header)
(calendar-weekend-header, calendar-month-header): New faces.
(calendar-day-header-construct): New function.
(calendar-day-header-width): Also :set calendar-day-header-array.
(calendar-american-month-header, calendar-european-month-header)
(calendar-iso-month-header): Use calendar- faces.
(calendar-generate-month):
Use calendar-day-header-array for day headers; apply faces to them.
(calendar-mode): Check calendar-font-lock-keywords non-nil.
(calendar-abbrev-construct): Add optional maxlen argument.
(calendar-day-name-array): Doc fix.
(calendar-day-name-array, calendar-abbrev-length)
(calendar-day-abbrev-array):
Also :set calendar-day-header-array, and maybe redraw.
(calendar-day-header-array): New option.
(calendar-font-lock-keywords): Use calendar-day-header-array,
and calendar- faces. Make obsolete.
(calendar-day-name): Add option to use header array.
* etc/NEWS: Mention this.
Fixes: debbugs:15007
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.
(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.
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
(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.
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.
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.
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.
(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.
(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.
(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.
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.
(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.
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.
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.
(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.
(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.
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.
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.
(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.
(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.
(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.