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

Remove the restriction on printing for dirvish-data-for-dir #266

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

isamert
Copy link
Contributor

@isamert isamert commented May 17, 2024

The line

(format "%S" `(message "%s" ,(dirvish--dir-data-getter dir)))

Sometimes generates something like:

(with-temp-buffer (let ((hash ...) (bk ...)) (dolist (file ...) (let* ... ... ...)) (prin1 (cons bk hash) (current-buffer))) (buffer-substring-no-properties (point-min) (point-max)))

which is then sent to emacs -Q to run but of course it fails to run because of the ellipses all over the code. These ellipses are managed by print-length and print-level variables which are when set to nil never generates ellipses.

Possibly we need to set these variables to nil whenever we generate code using (format "%S") but I haven't had any problems with other parts so far.

The line

```elisp
(format "%S" `(message "%s" ,(dirvish--dir-data-getter dir)))
```

Sometimes generates something like:

```elisp
(with-temp-buffer (let ((hash ...) (bk ...)) (dolist (file ...) (let* ... ... ...)) (prin1 (cons bk hash) (current-buffer))) (buffer-substring-no-properties (point-min) (point-max)))
```

which is then sent to `emacs -Q` to run but of course it fails to run
because of the ellipses all over the code. These ellipses are managed
by `print-length` and `print-level` variables which are when set to
`nil` never generates ellipses.

Possibly we need to set these variables to `nil` whenever we generate
code using `(format "%S")` but I haven't had any problems with other
parts so far.
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.

None yet

1 participant