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

assess with file contents literally? #14

Open
alphapapa opened this issue Apr 14, 2017 · 2 comments
Open

assess with file contents literally? #14

alphapapa opened this issue Apr 14, 2017 · 2 comments

Comments

@alphapapa
Copy link

Hi again,

Thanks for the recent changes and new version.

I see that assess-file loads a file with insert-file-contents. In a test I'm working on, I need to test with normally-inserted file contents like this, but also with insert-file-contents-literally. Is there a way that this could be supported in assess?

Thanks.

@phillord
Copy link
Owner

With the implementation at the moment, this part of assess is not freely
extensible, which is something I need to think about it I guess, but you can
always convert the file itself.

(assess=
  "Hello"
  (with-temp-buffer
    (insert-file-contents-literally f)
    (buffer-string)))

Or:

(defun my-literal-file (filename)
  (with-temp-buffer
     (insert-file-contents-literally filename)
     (buffer-string)))

To be honest, my implementation at the moment is a bit
round-about. assess-file currently returns a list which is interpreted by
assess-to-string, which then makes a string. Probably makes more sense if
assess-file (and assess-buffer) just returned the string directly.

I shall think on this.

@phillord
Copy link
Owner

phillord commented Jan 2, 2019

Long delay! I've updated assess so that "assess-file" and the like so that they return strings directly. If you are still needing the "insert-file-contents-literally" it can be added easily now.

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

2 participants