aboutsummaryrefslogtreecommitdiff
path: root/email/utils.scm
AgeCommit message (Collapse)Author
2020-05-25utils: Do not match sequence byte by byte in read-bytes-till.Arun Isaac
* email/utils.scm (bytevector-match, bytevector-overlap, lookahead-bytevector-n): New functions. (read-bytes-till): Do not match sequence byte by byte. Process blocks of bytes at a time.
2020-05-25utils: Introduce the not-end-let utility.Arun Isaac
* email/utils.scm (not-end-let): New macro. * .dir-locals.el (scheme-mode): Indent not-end-let correctly.
2020-05-25utils: Do not return eof if matched at beginning.Arun Isaac
* email/utils.scm (read-while, read-bytes-till): Do not return eof if matched at beginning. Return empty string or bytevector respectively. * tests/utils.scm ("read-bytes-till returns empty bytevector on match at beginning", "read-while returns empty string on match at beginning"): New tests.
2019-10-08email: Introduce alist union utility.Arun Isaac
* email/utils.scm (alist-combine): New function. (alist-delete*): Delete function. * email/email.scm (add-default-headers, add-default-mime-entity-headers): Use alist-combine.
2019-08-07utils: Clarify read-while docstring.Arun Isaac
* email/utils.scm (read-while): Clarify docstring.
2019-07-28utils: Return eof-object from read-bytes-till on end of file.Arun Isaac
* email/utils.scm (read-bytes-till): Return eof-object, not #vu8(), on end of file. * tests/utils.scm: New file. * Makefile.am (SCM_TESTS): Register it.
2019-07-28email: Support email with mixed encoding of characters.Arun Isaac
Prior to this, parse-email would accept email in the form of a string. A string is constrained to use the same encoding for all its characters whereas an email can have characters encoded using different encoding schemes. Therefore, it is more correct that parse-email deals with bytevectors instead of strings. * email/utils.scm (read-bytes-till): New function. * email/email.scm (body->mime-entities, email->headers+body, decode-body): Deal with emails as bytevectors instead of strings. (parse-mime-entity): Rename text argument to bv. (parse-email, parse-email-body): Overload to handle input in the form of a string or bytevector. * doc/guile-email.texi (Parsing e-mail): Document overloading of parse-email and parse-email-body. * tests/email.scm ("handle truncated multipart message gracefully"): Deal in bytevectors instead of strings. ("email with 8 bit encoding and non UTF-8 charset", "multipart email with a 8 bit encoding and non UTF-8 charset part"): New tests. * tests/email-with-8bit-encoding-and-non-utf8-charset, tests/multipart-email-with-a-8bit-encoding-and-non-utf8-charset-part: New files. Reported-by: Jack Hill <jackhill@jackhill.us>
2018-10-02utils: Use else for the default cond clause.Arun Isaac
* email/utils.scm (read-while)[read-while-loop]: Use else, instead of #t, for the default cond clause.
2018-09-12Untabify and re-indent all sources.Arun Isaac
* build-aux/test-driver.scm, email/base64.scm, email/email.scm, email/quoted-printable.scm, email/utils.scm, tests/quoted-printable.scm: Untabify and re-indent.
2018-09-08Initial commit.Arun Isaac