Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suffixes are "Not documented" after invocation from a prefix #360

Open
aurtzy opened this issue Feb 16, 2025 · 1 comment
Open

Suffixes are "Not documented" after invocation from a prefix #360

aurtzy opened this issue Feb 16, 2025 · 1 comment
Labels
bug emacs A bug in Emacs that affects us

Comments

@aurtzy
Copy link

aurtzy commented Feb 16, 2025

Issue

A suffix command's documentation is no longer accessible after the command is executed from a prefix.

Expectation

To be able to see a suffix's documentation after executing it.

I found that this was not an issue in earlier versions, and was able to do a bisect (results below).

Reproduction steps

Emacs version: 29.4

Tested with emacs -Q.

  1. Evaluate the following code:
    (require 'transient)
    
    (transient-define-suffix test-command ()
      "This is documentation for `test-command'."
      (interactive)
      (message "hi!"))
    
    (transient-define-prefix test-dispatch ()
      ["Test"
       ("t" "Test command" test-command)])
  2. See that when executing M-x test-dispatch C-h t, documentation can be found.
  3. Resume transient command with q.
  4. Execute test-command with t.
  5. See that executing M-x test-dispatch C-h t now displays "Not documented" in the help buffer instead of the docstring.

Bisect results

possible first bad commit: [8806655] transient-help: Fix regression
possible first bad commit: [87f70af] Use defvar-keymap
possible first bad commit: [c2bdf7e] transient--recursive-edit: Fix trivial bug
possible first bad commit: [a177418] Remove broken transient-define-groups
possible first bad commit: [5a1b2ba] Support using recursive-edit while transient is active
possible first bad commit: [fcdeadc] Support using top-level while transient is active
possible first bad commit: [52cac9c] Adjust around advice to work in Emacs < 30
possible first bad commit: [51c68c8] Use around advice to deal with skipped post-command-hook

Some of these commits had funky behavior with executing C-h in a prefix, which was fixed by the last "potentially bad" commit.

@tarsius
Copy link
Member

tarsius commented Feb 17, 2025

This seems to be an Emacs bug, I can reproduce it like so:

(defun an-interpreted-function () nil)
(put 'an-interpreted-function 'function-documentation "The docstring.")

(let ((advice (lambda (fn &rest args)
                (apply fn args))))
  (advice-add 'an-interpreted-function :around advice)
  (advice-remove 'an-interpreted-function advice))

@tarsius tarsius changed the title [Regression] Suffixes are "Not documented" after invocation from a prefix Suffixes are "Not documented" after invocation from a prefix Feb 17, 2025
@tarsius tarsius added the bug emacs A bug in Emacs that affects us label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug emacs A bug in Emacs that affects us
Projects
None yet
Development

No branches or pull requests

2 participants