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

literate-elisp-refs--read-all-buffer-forms now takes SYMBOLS-WITH-POS argument #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions literate-elisp.el
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,25 @@ will be temporarily set to that of `literate-elisp-read-internal'
literate-elisp-emacs-read)))
,@body))

(defun literate-elisp-refs--read-all-buffer-forms (orig-fun buffer)
(cl-defun literate-elisp-refs--read-all-buffer-forms (orig-fun buffer &optional (symbols-with-pos nil swp-p))
"Around advice to make `literate-elisp' package comparible with `elisp-refs'.
Argument ORIG-FUN: the original function.
Argument BUFFER: the buffer."
Argument BUFFER: the buffer.
Argument SYMBOLS-WITH-POS: non-nil if forms are to be read with
`read-positioning-symbols' (Emacs 29+ only) instead of `read'. (For
compatiblity, this is only passed to the original function if it is
specified in the function call.)"
;; FIXME as `literate-elisp--replace-read-maybe' replaces `read'
;; with `literate-elisp-read-internal' where necessary, we need to
;; add a literate-elisp equivalent to the new
;; `read-positioning-symbols' function, and make this advice aware
;; of when to make the switch for that as well.
(literate-elisp--replace-read-maybe
(literate-elisp--file-is-org-p
(with-current-buffer buffer (symbol-value 'elisp-refs--path)))
(funcall orig-fun buffer)))
(if swp-p
(funcall orig-fun buffer symbols-with-pos)
(funcall orig-fun buffer))))

(defun literate-elisp-refs--loaded-paths (rtn)
"Filter return advice to prevent it from ignoring Org files.
Expand Down