literate-elisp-refs--read-all-buffer-forms
now takes SYMBOLS-WITH-POS argument
#15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
elisp-refs--read-all-buffer-forms
now takes two arguments (BUFFER and SYMBOLS-WITH-POS) instead of one, so the around adviceliterate-elisp-refs--read-all-buffer-forms
needs to take three arguments, now (the original function plus the two arguments it takes). This PR makes that change.There are two problems: the first is that when writing the commit messages, I forgot that
elisp-refs
isn’t an internal Emacs package and assumed that the change toelisp-refs--read-all-buffer-forms
happened with Emacs 28.3, so my commit message for the second commit is a bit misleading (it should say “make compatible with older versions of elisp-refs”). (If compatibility with older versions ofelisp-refs
isn’t important to you, you can omit that commit entirely; it uses somecl-defun
magic to make it so the advice can be called with either set of arguments.)The second problem is that the change to
elisp-refs--read-all-buffer-forms
was made to take advantage of the new function in Emacs 29,read-positioning-symbols
. Now, if the new SYMBOLS-WITH-POS argument is non-nil,elisp-refs--read-all-buffer-forms
will useread-positioning-symbols
instead ofread
. Given that the purpose of theliterate-elisp-refs--read-all-buffer-forms
advice is to replace theread
function withliterate-elisp-read-internal
temporarily when necessary, I’m assuming we’ll need aliterate-elisp
equivalent toread-positioning-symbols
as well, and to make theliterate-elisp-refs--read-all-buffer-forms
advice aware of it. (I’m not on Emacs 29, yet, and I don’t know howread-positioning-symbols
works, so this PR is just a quick fix so that theliterate-elisp-refs--read-all-buffer-forms
advice doesn’t return a “wrong number of arguments” error.)