Skip to content

Commit

Permalink
consult-mode-command: do not list obsolete commands
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Jan 19, 2021
1 parent ef0c816 commit da7f144
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions consult.el
Original file line number Diff line number Diff line change
Expand Up @@ -2071,7 +2071,8 @@ The arguments and expected return value are as specified for
"Extract commands from MODES.
The list of features is searched for files belonging to MODE.
From these files, the commands are extracted."
From these files, the commands are extracted.
KEY is the narrowing key."
(let ((filter (consult--regexp-filter consult-mode-command-filter))
(paths-hash (consult--string-hash (mapcar #'symbol-file modes)))
(name-regexp (regexp-opt
Expand All @@ -2093,7 +2094,8 @@ From these files, the commands are extracted."
(when (and (consp cmd)
(eq (car cmd) 'defun)
(commandp (cdr cmd))
(not (string-match-p filter (symbol-name (cdr cmd)))))
(not (string-match-p filter (symbol-name (cdr cmd))))
(not (get (cdr cmd) 'byte-obsolete-info)))
(push (cons (cdr cmd) key) commands))))))))

;;;###autoload
Expand Down

0 comments on commit da7f144

Please sign in to comment.