From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: Trying to use gnus-cloud: what's the pinentry dialog? (and how can I get rid of it?)
Date: Sat, 02 Oct 2021 08:49:57 -0700 [thread overview]
Message-ID: <87o887l93u.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <86y27b4gmk.fsf@dod.no>
Steinar Bang <sb@dod.no> writes:
>>>>>> Steinar Bang <sb@dod.no>:
>
>>> The .gnus.el file is 487 lines and (- 16241 487) is 15754 and taking the
>>> 15754 ends the file in the correct place, so that seems right.
>
>>> What would be the best way to make this less fragile, I wonder...?
>
>>> The current value is just the size of the buffer:
>>> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/gnus/gnus-cloud.el#n98
>
>> To take the length of data in bytes, instead of the size of the buffer,
>> should be always correct, without changing any of the other assumptions
>> of the code.
>
> I tried this, but it didn't work (still had 16241 bytes, rather than
> 15754 for the .gnus.el chunk in the sync data):
>
> diff --git a/lisp/gnus/gnus-cloud.el b/lisp/gnus/gnus-cloud.el
> index e6cf39c..48653bd 100644
> --- a/lisp/gnus/gnus-cloud.el
> +++ b/lisp/gnus/gnus-cloud.el
> @@ -97,11 +97,11 @@ easy interactive way to set this from the Server buffer."
> (dolist (elem elems)
> (cond
> ((eq (plist-get elem :type) :file)
> - (let (length data)
> + (let (data length)
> (mm-with-unibyte-buffer
> (insert-file-contents-literally (plist-get elem :file-name))
> - (setq length (buffer-size)
> - data (buffer-string)))
> + (setq data (buffer-string)
> + length (length data)))
> (insert (format "(:type :file :file-name %S :timestamp %S :length %d)\n"
> (plist-get elem :file-name)
> (plist-get elem :timestamp)
>
> Where are the CRLF characters turned into LF, I wonder?
> Apparently not in buffer-string...?
My understanding is that conversion would have happened if you weren't
using a unibyte buffer, and were using `insert-file-contents' rather
than `insert-file-contents-literally'. Ie, the code is specifically set
up to not do conversion.
next prev parent reply other threads:[~2021-10-02 15:50 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-19 13:50 Steinar Bang
2021-09-19 14:16 ` Steinar Bang
2021-09-19 14:30 ` Steinar Bang
2021-09-19 14:47 ` Steinar Bang
2021-09-23 15:07 ` Steinar Bang
2021-09-23 15:25 ` Steinar Bang
2021-09-23 17:17 ` Steinar Bang
2021-09-23 17:42 ` Steinar Bang
2021-09-23 17:58 ` dick
2021-09-24 8:40 ` Eric S Fraga
2021-09-24 20:18 ` Steinar Bang
2021-09-26 15:44 ` Eric S Fraga
2021-09-26 16:52 ` Steinar Bang
2021-09-27 14:54 ` Eric S Fraga
2021-10-02 11:27 ` Steinar Bang
2021-10-02 11:39 ` Steinar Bang
2021-10-02 14:59 ` Steinar Bang
2021-10-02 15:49 ` Eric Abrahamsen [this message]
2021-10-02 16:19 ` Steinar Bang
2021-10-03 8:46 ` Steinar Bang
2021-10-03 17:30 ` Steinar Bang
2021-10-04 14:43 ` Steinar Bang
2021-10-04 18:00 ` Steinar Bang
2021-10-04 19:19 ` Steinar Bang
2021-10-04 19:42 ` Steinar Bang
2021-10-04 20:09 ` Adam Sjøgren
2021-10-04 21:26 ` Steinar Bang
2021-10-05 8:41 ` Robert Pluim
2021-10-05 15:02 ` Adam Sjøgren
2021-10-05 15:41 ` Robert Pluim
2021-10-05 16:20 ` Adam Sjøgren
2021-10-05 15:14 ` Eric Abrahamsen
2021-10-05 16:17 ` Adam Sjøgren
2021-10-05 17:46 ` Eric Abrahamsen
2021-10-05 17:52 ` Adam Sjøgren
2021-09-23 17:14 ` Steinar Bang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o887l93u.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).