amx icon indicating copy to clipboard operation
amx copied to clipboard

amx completion includes commands that are not defined anymore

Open bcc32 opened this issue 3 months ago • 0 comments

amx completion includes history elements that may not correspond to actually commands (i.e., commandp returns nil for them).

Invoking such commands always produces an error, so I think they should not be suggested even if they appear in history.

This can be confusing if:

  • If a package was updated and the command no longer exists
  • If the command was defined in some package but was not autoloaded, and that package isn't loaded at startup

reproduction steps

  1. emacs (no -q because that disables amx). Assume that the init file enables amx-mode.

  2. Define some command, or load a file which does:

    (defun this-is-a-deleted-command ()
      (interactive)
      (message "This command will be deleted in a future update of this package."))
    
  3. M-x this-is-a-deleted-command

  4. kill-emacs and restart Emacs

  5. M-x this-is contains this-is-a-deleted-command despite that command not being defined.

  6. Press RET. This produces a type error:

    Wrong type argument: commandp, this-is-a-deleted-command
    

bcc32 avatar Nov 13 '25 22:11 bcc32