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

Make # reader customizable #2

Open
sellout opened this issue May 18, 2023 · 0 comments
Open

Make # reader customizable #2

sellout opened this issue May 18, 2023 · 0 comments

Comments

@sellout
Copy link

sellout commented May 18, 2023

E.g., something like

(defconst er-standard-sharpsign-dispatcher-alist
  (concat (er-enumerate-sharpsign-digit-dispatchers)
          (er-enumerate-original-sharpsign-dispatchers)
          '((?\' . (lambda (in x) (list 'function (er-read-datum in)))))))

(defcustom er-sharpsign-dispatcher-alist er-standard-sharpsign-dispatcher-alist
  "An alist mapping characters following ?# to reader functions.")

;; This regexp reader can now be conditionally enabled
(add-to-list er-sharpsign-dispatcher-alist
             '(?\/ . (lambda (in x) (er-read-regexp in))))

Or, to prevent users from breaking the elisp reader completely, the alist could start empty and only be used before er-croak in the catchall of your existing dispatcher.

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

No branches or pull requests

1 participant