description of the properties. Likewise 'button-describe' does the
same for a button.
-** Obsolete commands are no longer hidden from command completion.
+** Obsolete aliases are no longer hidden from command completion.
Completion of command names now considers obsolete aliases as
-candidates. Invoking a command via an obsolete alias now mentions the
+candidates, if they were marked obsolete in the current major version
+of Emacs. Invoking a command via an obsolete alias now mentions the
obsolescence fact and shows the new name of the command.
+++
'(metadata
(affixation-function . read-extended-command--affixation)
(category . command))
- (complete-with-action action obarray string pred)))
+ (let ((pred
+ (if (memq action '(nil t))
+ ;; Exclude from completions obsolete commands
+ ;; lacking a `current-name', or where `when' is
+ ;; not the current major version.
+ (lambda (sym)
+ (let ((obsolete (get sym 'byte-obsolete-info)))
+ (and (funcall pred sym)
+ (or (equal string (symbol-name sym))
+ (not obsolete)
+ (and
+ ;; Has a current-name.
+ (functionp (car obsolete))
+ ;; when >= emacs-major-version
+ (>= (car (version-to-list (caddr obsolete)))
+ emacs-major-version))))))
+ pred)))
+ (complete-with-action action obarray string pred))))
(lambda (sym)
(and (commandp sym)
(cond ((null read-extended-command-predicate))