string consists of more (or less) than one character, it will be
the value of `todo-done-separator'."
:type 'string
- :initialize 'custom-initialize-default
- :set 'todo-reset-done-separator-string
+ :initialize #'custom-initialize-default
+ :set #'todo-reset-done-separator-string
:group 'todo-display)
(defun todo-done-separator ()
the diary date."
:type '(list string string)
:group 'todo-edit
- :initialize 'custom-initialize-default
- :set 'todo-reset-nondiary-marker)
+ :initialize #'custom-initialize-default
+ :set #'todo-reset-nondiary-marker)
(defconst todo-nondiary-start (nth 0 todo-nondiary-marker)
"String inserted before item date to block diary inclusion.")
(defcustom todo-done-string "DONE "
"Identifying string appended to the front of done todo items."
:type 'string
- :initialize 'custom-initialize-default
- :set 'todo-reset-done-string
+ :initialize #'custom-initialize-default
+ :set #'todo-reset-done-string
:group 'todo-edit)
(defconst todo-done-string-start
(format-message
"Invalid value: must be distinct from `todo-item-mark'"))
widget)))
- :initialize 'custom-initialize-default
- :set 'todo-reset-prefix
+ :initialize #'custom-initialize-default
+ :set #'todo-reset-prefix
:group 'todo-display)
(defcustom todo-number-prefix t
"Non-nil to prefix items with consecutively increasing integers.
These reflect the priorities of the items in each category."
:type 'boolean
- :initialize 'custom-initialize-default
- :set 'todo-reset-prefix
+ :initialize #'custom-initialize-default
+ :set #'todo-reset-prefix
:group 'todo-display)
(defun todo-mode-line-control (cat)
(defcustom todo-highlight-item nil
"Non-nil means highlight items at point."
:type 'boolean
- :initialize 'custom-initialize-default
- :set 'todo-reset-highlight-item
+ :initialize #'custom-initialize-default
+ :set #'todo-reset-highlight-item
:group 'todo-display)
(defcustom todo-wrap-lines t
"Non-nil to make `todo-show' visit the current todo file.
Otherwise, `todo-show' always visits `todo-default-todo-file'."
:type 'boolean
- :initialize 'custom-initialize-default
- :set 'todo-set-show-current-file
+ :initialize #'custom-initialize-default
+ :set #'todo-set-show-current-file
:group 'todo)
(defcustom todo-show-first 'first
(list archive)))))
(dolist (buf buffers)
(with-current-buffer (find-file-noselect buf)
- (let (buffer-read-only)
+ (let ((inhibit-read-only t))
(setq todo-categories (todo-set-categories))
(save-excursion
(save-restriction
"\"" (and arg " and all its entries")
"? "))))
(widen)
- (let ((buffer-read-only)
+ (let ((inhibit-read-only t)
(beg (re-search-backward
(concat "^" (regexp-quote (concat todo-category-beg cat))
"\n")
(defcustom todo-comment-string "COMMENT"
"String inserted before optional comment appended to done item."
:type 'string
- :initialize 'custom-initialize-default
- :set 'todo-reset-comment-string
+ :initialize #'custom-initialize-default
+ :set #'todo-reset-comment-string
:group 'todo-edit)
(defcustom todo-undo-item-omit-comment 'ask
(todo-date-from-calendar
(let (calendar-view-diary-initially-flag)
(calendar)) ; *Calendar* is now current buffer.
- (define-key calendar-mode-map [remap newline] 'exit-recursive-edit)
+ (define-key calendar-mode-map [remap newline] #'exit-recursive-edit)
;; If user exits Calendar before choosing a date, clean up properly.
(define-key calendar-mode-map
[remap calendar-exit] (lambda ()
(calendar-exit)
(todo-insert-item--basic arg nil todo-date-from-calendar))
-(define-key calendar-mode-map "it" 'todo-insert-item-from-calendar)
+(define-key calendar-mode-map "it" #'todo-insert-item-from-calendar)
(defun todo-delete-item ()
"Delete at least one item in this category.
(save-excursion (todo-item-end))))
(overlay-put ov 'face 'todo-search)
(todo-y-or-n-p "Permanently delete this item? "))))
- buffer-read-only)
+ (inhibit-read-only t))
(when answer
(and marked (goto-char (point-min)))
(catch 'done
(defun todo-edit-item--diary-inclusion (&optional nonmarking)
"Function providing diary marking facilities of `todo-edit-item'."
- (let ((buffer-read-only)
+ (let ((inhibit-read-only t)
(marked (assoc (todo-current-category) todo-categories-with-marks)))
(when marked (todo--user-error-if-marked-done-item))
(catch 'stop
(goto-char (point-min))
(let ((todo-count (todo-get-count 'todo))
(diary-count (todo-get-count 'diary))
- (buffer-read-only))
+ (inhibit-read-only t))
(catch 'stop
(while (not (eobp))
(if (todo-done-item-p) ; We've gone too far.
(interactive "P")
(save-excursion
(goto-char (point-min))
- (let (buffer-read-only)
+ (let ((inhibit-read-only t))
(catch 'stop
(while (not (eobp))
(if (todo-done-item-p) ; We've gone too far.
(with-current-buffer archive
(unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))
(let ((headers-hidden todo--item-headers-hidden)
- buffer-read-only)
+ (inhibit-read-only t))
(if headers-hidden (todo-toggle-item-header))
(widen)
(goto-char (point-min))
(if (and (re-search-forward
(concat "^" (regexp-quote
- (concat todo-category-beg cat)) "$")
+ (concat todo-category-beg cat))
+ "$")
nil t)
(re-search-forward (regexp-quote todo-category-done)
nil t))
(item (concat (todo-item-string) "\n"))
(marked-count 0)
marked-items
- buffer-read-only)
+ (inhibit-read-only t))
(when marked
(save-excursion
(goto-char (point-min))
;; Restore items to top of category's done section and update counts.
(with-current-buffer tbuf
(let ((headers-hidden todo--item-headers-hidden)
- buffer-read-only newcat)
+ (inhibit-read-only t) newcat)
(if headers-hidden (todo-toggle-item-header))
(widen)
(goto-char (point-min))
(kill-all-local-variables)
(todo-categories-mode)
(let ((archive (member todo-current-todo-file todo-archives))
- buffer-read-only)
+ (inhibit-read-only t))
(erase-buffer)
(insert (format (concat "Category counts for todo "
(if archive "archive" "file")
(forward-line -2)
(goto-char (next-single-char-property-change
(point) 'face nil (line-end-position))))))
- (buffer-read-only))
+ (inhibit-read-only t))
(forward-line 2)
(delete-region (point) (point-max))
;; Fill in the table with buttonized lines, each showing a category and
(widen)))
(setq bufstr (buffer-string))
(with-current-buffer buf
- (let (buffer-read-only)
+ (let ((inhibit-read-only t))
(insert bufstr)))))))
(set-window-buffer (selected-window) (set-buffer buf))
(todo-prefix-overlays)
SPC to affirm the question only if option `todo-y-with-space' is
non-nil."
(unless todo-y-with-space
- (define-key query-replace-map " " 'ignore))
+ (define-key query-replace-map " " #'ignore))
(prog1
(y-or-n-p prompt)
(define-key query-replace-map " " 'act)))
(dolist (f files)
(let ((buf (find-buffer-visiting f)))
(with-current-buffer (find-file-noselect f)
- (let (buffer-read-only)
+ (let ((inhibit-read-only t))
(widen)
(goto-char (point-min))
(while (not (eobp))
(when (not (equal value oldvalue))
(dolist (f files)
(with-current-buffer (find-file-noselect f)
- (let (buffer-read-only)
+ (let ((inhibit-read-only t))
(setq todo-done-separator (todo-done-separator))
(when (= 1 (length value))
(todo-reset-done-separator sep)))
(dolist (f files)
(let ((buf (find-buffer-visiting f)))
(with-current-buffer (find-file-noselect f)
- (let (buffer-read-only)
+ (let ((inhibit-read-only t))
(widen)
(goto-char (point-min))
(while (not (eobp))
(dolist (f files)
(let ((buf (find-buffer-visiting f)))
(with-current-buffer (find-file-noselect f)
- (let (buffer-read-only)
+ (let ((inhibit-read-only t))
(widen)
(goto-char (point-min))
(while (not (eobp))
(define-key map (nth 0 kb) (nth 1 kb)))
(dolist (kb todo-key-bindings-t+a)
(define-key map (nth 0 kb) (nth 1 kb)))
- (define-key map "a" 'todo-jump-to-archive-category)
- (define-key map "u" 'todo-unarchive-items)
+ (define-key map "a" #'todo-jump-to-archive-category)
+ (define-key map "u" #'todo-unarchive-items)
map)
"Todo Archive mode keymap.")
(defvar todo-edit-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "\C-x\C-q" 'todo-edit-quit)
+ (define-key map "\C-x\C-q" #'todo-edit-quit)
map)
"Todo Edit mode keymap.")
(defvar todo-categories-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "c" 'todo-sort-categories-alphabetically-or-numerically)
- (define-key map "t" 'todo-sort-categories-by-todo)
- (define-key map "y" 'todo-sort-categories-by-diary)
- (define-key map "d" 'todo-sort-categories-by-done)
- (define-key map "a" 'todo-sort-categories-by-archived)
- (define-key map "#" 'todo-set-category-number)
- (define-key map "l" 'todo-lower-category)
- (define-key map "r" 'todo-raise-category)
- (define-key map "n" 'todo-next-button)
- (define-key map "p" 'todo-previous-button)
- (define-key map [tab] 'todo-next-button)
- (define-key map [backtab] 'todo-previous-button)
- (define-key map "q" 'todo-quit)
+ (define-key map "c" #'todo-sort-categories-alphabetically-or-numerically)
+ (define-key map "t" #'todo-sort-categories-by-todo)
+ (define-key map "y" #'todo-sort-categories-by-diary)
+ (define-key map "d" #'todo-sort-categories-by-done)
+ (define-key map "a" #'todo-sort-categories-by-archived)
+ (define-key map "#" #'todo-set-category-number)
+ (define-key map "l" #'todo-lower-category)
+ (define-key map "r" #'todo-raise-category)
+ (define-key map "n" #'todo-next-button)
+ (define-key map "p" #'todo-previous-button)
+ (define-key map [tab] #'todo-next-button)
+ (define-key map [backtab] #'todo-previous-button)
+ (define-key map "q" #'todo-quit)
map)
"Todo Categories mode keymap.")
(define-key map (nth 0 kb) (nth 1 kb)))
(dolist (kb todo-key-bindings-t+f)
(define-key map (nth 0 kb) (nth 1 kb)))
- (define-key map "g" 'todo-go-to-source-item)
- (define-key map [remap newline] 'todo-go-to-source-item)
+ (define-key map "g" #'todo-go-to-source-item)
+ (define-key map [remap newline] #'todo-go-to-source-item)
map)
"Todo Filtered Items mode keymap.")
;; (add-hook 'find-file-hook #'todo-display-as-todo-file nil t)
)
-(put 'todo-mode 'mode-class 'special)
-
;;;###autoload
(define-derived-mode todo-mode special-mode "Todo"
- "Major mode for displaying, navigating and editing todo lists.
-
-\\{todo-mode-map}"
+ "Major mode for displaying, navigating and editing todo lists."
(if (called-interactively-p 'any)
(message "%s"
(substitute-command-keys
#'todo-reset-and-enable-done-separator nil t)
(add-hook 'kill-buffer-hook #'todo-reset-global-current-todo-file nil t)))
-(put 'todo-archive-mode 'mode-class 'special)
-
;; If todo-mode is parent, all todo-mode key bindings appear to be
;; available in todo-archive-mode (e.g. shown by C-h m).
;;;###autoload
(define-derived-mode todo-archive-mode special-mode "Todo-Arch"
- "Major mode for archived todo categories.
-
-\\{todo-archive-mode-map}"
+ "Major mode for archived todo categories."
(todo-modes-set-1)
(todo-modes-set-2)
(todo-modes-set-3)
(setq-local todo-show-done-only t))
(define-derived-mode todo-edit-mode text-mode "Todo-Ed"
- "Major mode for editing multiline todo items.
-
-\\{todo-edit-mode-map}"
+ "Major mode for editing multiline todo items."
(todo-modes-set-1)
(setq-local indent-line-function #'todo-indent)
(if (> (buffer-size) (- (point-max) (point-min)))
(setq-local todo-categories (todo-set-categories)))
(setq buffer-read-only nil))
-(put 'todo-categories-mode 'mode-class 'special)
-
(define-derived-mode todo-categories-mode special-mode "Todo-Cats"
- "Major mode for displaying and editing todo categories.
-
-\\{todo-categories-mode-map}"
+ "Major mode for displaying and editing todo categories."
(setq-local todo-current-todo-file todo-global-current-todo-file)
(setq-local todo-categories
;; Can't use find-buffer-visiting when
todo-current-todo-file 'nowarn)
todo-categories)))
-(put 'todo-filtered-items-mode 'mode-class 'special)
-
;;;###autoload
(define-derived-mode todo-filtered-items-mode special-mode "Todo-Fltr"
- "Mode for displaying and reprioritizing top priority Todo.
-
-\\{todo-filtered-items-mode-map}"
+ "Mode for displaying and reprioritizing top priority Todo."
(todo-modes-set-1)
(todo-modes-set-2))