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

Fix helpful--autoloaded-p in Emacs 29.0.50 #283

Merged
merged 2 commits into from
Feb 20, 2022
Merged

Conversation

rhaps0dy
Copy link
Contributor

@rhaps0dy rhaps0dy commented Feb 9, 2022

I don't know how (or whether to) add this change, since it likely breaks helpful for anyone not using the latest Emacs. What to do?

help-fns--autoloaded-p

The function help-fns--autoloaded-p now only takes 1 argument, so describe-function errors out; as described in doomemacs/doomemacs#6097 . The change was made on 2022-01-31.

helpful--skip-advice

Also fixed helpful--skip-advice. The advice info is now appended to the
documentation, so the test helpful--docstring-advice would fail.

That is, the docstring from (documentation #'test-foo-advised t) now reads:

"Docstring here too.

This function has :around advice: ‘ad-Advice-test-foo-advised’.

(fn)"

Also fixed `helpful--skip-advice`, which is now appended to the
documentation instead of prepended.
@baracunatana
Copy link

I don't know how (or whether to) add this change, since it likely breaks helpful for anyone not using the latest Emacs. What to do?

Maybe a simple (when (equal emacs-version "20.0.50) ...?

@tpeacock19
Copy link

tpeacock19 commented Feb 17, 2022

I would suggest using the following that has worked for me:

(defun helpful--autoloaded-p (sym buf)
  "Return non-nil if function SYM is autoloaded."
  (-when-let (file-name (buffer-file-name buf))
    (setq file-name (s-chop-suffix ".gz" file-name))
    (if (boundp 'read-symbol-positions-list)
        (help-fns--autoloaded-p sym file-name)
      (help-fns--autoloaded-p sym))))

Additionally, with the changes from my PR
Wilfred/elisp-refs#36 there is no need to edit
helpful--skip-advice

And revert helpful--compiled-p
@rhaps0dy
Copy link
Contributor Author

Thank you very much @tpeacock19 ! Your fix does solve helpful--skip-advice.

In the end I've gone with the advice of Stefan in StackOverflow and just tried to call the old function first.

@tpeacock19
Copy link

I'm still learning about lisp and programming in general. So may I ask why you prefer to call the function?

@Wilfred Wilfred merged commit 67cdd10 into Wilfred:master Feb 20, 2022
@Wilfred
Copy link
Owner

Wilfred commented Feb 20, 2022

Thanks for the PR :)

@rhaps0dy
Copy link
Contributor Author

@tpeacock19 I think checking whether read-symbol-positions-list is a proxy for what we actually care about, which is the number of arguments to help-fns--autoloaded-p. So I'd rather check directly for the latter. Maybe a user defined read-symbol-positions-list in their config but help-fns--autoloaded-p still takes two arguments, in which case checking for read-symbol-positions-list would be the wrong thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants