assess icon indicating copy to clipboard operation
assess copied to clipboard

assess with file contents literally?

Open alphapapa opened this issue 8 years ago • 2 comments

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.

alphapapa avatar Apr 14 '17 21:04 alphapapa

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 avatar Apr 14 '17 22:04 phillord

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.

phillord avatar Jan 02 '19 10:01 phillord