-
Notifications
You must be signed in to change notification settings - Fork 7
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
Make use of the reader customizable #4
Comments
Unfortunately, disabling of the reader is still sometimes needed yet. For example, when I attempt to inspect the variable To add to your functions above, I did: (defun er-enabled-p ()
(eq (symbol-function 'read) (symbol-function 'er-read)))
(defun without-er-reader-a (orig-fn &rest args)
"An advice to disable elisp-reader for this function only.
To be used with `advice-add' and `:around'."
(let ((was-enabled (er-enabled-p)))
(unwind-protect
(progn
(when was-enabled (er-disable))
(apply orig-fn args))
(when was-enabled (er-enable)))))
;; `helpful-update' has some problems with the new elisp reader.
(advice-add 'helpful-update :around #'without-er-reader-a) This disables the reader only for this particular function. Just for reference, this is the stacktrace, that I receive but this is unrelated to this bug report: StacktraceDebugger entered--Lisp error: (error "Unexpected error whilst reading /nix/store/rajkyxn1ssi2pi17wf0imw7s289f3bg5-emacs-gtk3-29.3/share/emacs/29.3/lisp/net/browse-url.el.gz position 69913: (error End of file during parsing)") (error "Unexpected error whilst reading %s position %s: %s" "/nix/store/rajkyxn1ssi2pi17wf0imw7s289f3bg5-emacs-gtk3-29.3/share/emacs/29.3/lisp/net/browse-url.el.gz" 69913 (error "End of file during parsing")) (elisp-refs--read-all-buffer-forms # nil) (elisp-refs--read-and-find # browse-url-handlers elisp-refs--variable-p) (#f(compiled-function (buf) #) #) (elisp-refs--search-1 (#) #f(compiled-function (buf) #)) (helpful--reference-positions browse-url-handlers nil #) (helpful--calculate-references browse-url-handlers nil "/nix/store/rajkyxn1ssi2pi17wf0imw7s289f3bg5-emacs-gtk3-29.3/share/emacs/29.3/lisp/net/browse-url.el.gz") (#) (apply # nil) (progn (apply orig-fn args)) (unwind-protect (progn (apply orig-fn args))) (let ((was-enabled (er-enabled-p))) (unwind-protect (progn (apply orig-fn args)))) (without-er-reader #) (apply without-er-reader # nil) (helpful-update) (helpful--update-and-switch-buffer browse-url-handlers nil) (helpful-variable browse-url-handlers) (funcall-interactively helpful-variable browse-url-handlers) (command-execute helpful-variable) |
Rather than simply a
progn
at the end of elisp-reader, how about making it possible to enable/disable, then it could maybe be scoped for reading certain things.The text was updated successfully, but these errors were encountered: