@@ -115,7 +115,7 @@ This should be set automatically by customizing
115115(defvar-local magit-todos-active-scan nil
116116 " The current scan's process.
117117Used to avoid running multiple simultaneous scans for a
118- magit-status buffer." )
118+ ` magit-status' buffer." )
119119
120120(defvar magit-todos-section-map
121121 (let ((map (make-sparse-keymap )))
@@ -167,7 +167,7 @@ A time value as returned by `current-time'.")
167167(defcustom magit-todos-scanner nil
168168 " File scanning method.
169169\" Automatic\" will attempt to use rg, ag, git-grep, and
170- find-grep, in that order. "
170+ find-grep, in that order."
171171 :type '(choice (const :tag " Automatic" nil )
172172 (function :tag " Custom function" ))
173173 :set (lambda (option value )
@@ -444,13 +444,13 @@ Only necessary when option `magit-todos-update' is nil."
444444 (magit-todos-update))
445445
446446(defun magit-todos-branch-list-set-commit (ref )
447- " Set commit ref used in branch to-do list."
447+ " Set commit REF used in branch to-do list."
448448 (interactive (list (completing-read " Refname: " (magit-list-refnames))))
449449 (setq-local magit-todos-branch-list-merge-base-ref ref)
450450 (magit-todos-update))
451451
452452(cl-defun magit-todos-jump-to-item (&key peek (item (oref (magit-current-section) value)))
453- " Show current item .
453+ " Show current ITEM .
454454If PEEK is non-nil, keep focus in status buffer window."
455455 (interactive )
456456 (let* ((status-window (selected-window ))
@@ -494,7 +494,8 @@ If PEEK is non-nil, keep focus in status buffer window."
494494;;;### autoload
495495(defun magit-todos-list (&optional directory )
496496 " Show to-do list of the current Git repository in a buffer.
497- With prefix, prompt for repository."
497+ With prefix, prompt for repository. Use repository in DIRECTORY,
498+ or `default-directory' if nil."
498499 ; ; Mostly copied from `magit-status'
499500 (interactive
500501 (let ((magit--refresh-cache (list (cons 0 0 ))))
@@ -547,13 +548,13 @@ Type \\[magit-diff-show-or-scroll-up] to peek at the item at point."
547548 " Return end position of section matching CONDITION, or nil.
548549CONDITION may be one accepted by `magit-section-match' , or `top'
549550or `bottom' , which are handled specially."
550- (cl-labels ((find-section
551- (condition) (save-excursion
552- (goto-char (point-min ))
553- (ignore-errors
554- (cl-loop until (magit-section-match condition)
555- do (magit-section-forward)
556- finally return (magit-current-section))))))
551+ (cl-labels ((find-section (condition)
552+ (save-excursion
553+ (goto-char (point-min ))
554+ (ignore-errors
555+ (cl-loop until (magit-section-match condition)
556+ do (magit-section-forward)
557+ finally return (magit-current-section))))))
557558 (save-excursion
558559 (goto-char (point-min ))
559560 (pcase condition
@@ -637,7 +638,13 @@ buffer for RESULTS-REGEXP."
637638
638639(cl-defun magit-todos--git-diff-callback (&key magit-status-buffer results-regexp search-regexp-elisp process heading
639640 exclude-globs &allow-other-keys )
640- " Callback for git diff scanner output."
641+ " Callback for git diff scanner output.
642+ Insert into MAGIT-STATUS-BUFFER. RESULTS-REGEXP matches a result
643+ on each line. SEARCH-REGEXP-ELISP finds the next hunk of
644+ results. PROCESS is the \" git diff\" process object.
645+ `magit-todos-section-heading' is bound to HEADING when inserting
646+ items. EXCLUDE-GLOBS is a list of glob patterns matching
647+ filenames to be excluded."
641648 ; ; NOTE: Doesn't handle newlines in filenames or diff.mnemonicPrefix.
642649 (cl-macrolet ((next-diff () `(re-search-forward (rx bol " diff --git " ) nil t ))
643650 (next-filename () `(when (re-search-forward (rx bol " +++ b/" (group (1+ nonl))) nil t )
@@ -1002,6 +1009,7 @@ advance to the next line."
10021009
10031010(defun magit-todos--fontify-like-in-org-mode (s &optional odd-levels )
10041011 " Fontify string S like in Org-mode.
1012+ Bind `org-odd-levels-only' to ODD-LEVELS.
10051013
10061014`org-fontify-like-in-org-mode' is a very, very slow function
10071015because it creates a new temporary buffer and runs `org-mode' for
@@ -1029,12 +1037,12 @@ useful with absolute paths)."
10291037 (car (f-split (magit-todos-item-filename item))))
10301038
10311039(cl-defun magit-todos--async-start-process (name &key command finish-func )
1032- " Start the executable PROGRAM asynchronously. See `async-start' .
1040+ " Start the executable COMMAND asynchronously. See `async-start' .
10331041PROGRAM is passed PROGRAM-ARGS, calling FINISH-FUNC with the
10341042process object when done. If FINISH-FUNC is nil, the future
10351043object will return the process object when the program is
10361044finished. Set DEFAULT-DIRECTORY to change PROGRAM's current
1037- working directory.
1045+ working directory. Process is named NAME.
10381046
10391047This is a copy of `async-start-process' that does not override
10401048`process-connection-type' . It also uses keyword arguments."
@@ -1054,7 +1062,7 @@ This is a copy of `async-start-process' that does not override
10541062 proc)))
10551063
10561064(defun magit-todos--async-when-done (proc &optional _change )
1057- " Process sentinel used to retrieve the value from the child process .
1065+ " Process sentinel used to retrieve the value from the child PROC .
10581066
10591067This is a copy of `async-when-done' that does not raise an error
10601068if the process's buffer has already been deleted."
@@ -1090,7 +1098,7 @@ if the process's buffer has already been deleted."
10901098 (backward-sexp )
10911099 (async-handle-result async-callback (read (current-buffer ))
10921100 (current-buffer )))
1093- (error " magit-todos--async-when-done: process %S failed with exit code %d . Output:%S "
1101+ (error " magit-todos--async-when-done: Process %S failed with exit code %d . Output:%S "
10941102 (process-name proc) (process-exit-status proc) (buffer-string )))))))
10951103
10961104; ;;;; Formatters
@@ -1121,7 +1129,7 @@ if the process's buffer has already been deleted."
11211129(defun magit-todos--sort-by-keyword (a b )
11221130 " Return non-nil if A's keyword is before B's in `magit-todos-keywords-list' ."
11231131 (cl-flet ((keyword-index (keyword)
1124- (or (-elem-index keyword magit-todos-keywords-list) 0 )))
1132+ (or (-elem-index keyword magit-todos-keywords-list) 0 )))
11251133 (< (keyword-index (magit-todos-item-keyword a))
11261134 (keyword-index (magit-todos-item-keyword b)))))
11271135
@@ -1486,7 +1494,7 @@ When SYNC is non-nil, match items are returned."
14861494; ; Helm or Ivy to be installed; it is only called after one of them is loaded.
14871495
14881496(declare-function helm-make-source " ext:helm-source" )
1489- (declare-function helm " ext:helm" )
1497+ (declare-function helm " ext:helm-core " )
14901498
14911499(with-eval-after-load 'helm
14921500 (defvar helm-magit-todos-source
0 commit comments