Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
Cc: ding@gnus.org
Subject: Re: hashcash - buffer modification
Date: Wed, 15 Nov 2006 14:00:50 +0900	[thread overview]
Message-ID: <b4mbqn9uwvx.fsf@jpl.org> (raw)
In-Reply-To: <quack.20061114T1548.lthmz6tmvyk@roar.cs.berkeley.edu>

>>>>> In <quack.20061114T1548.lthmz6tmvyk@roar.cs.berkeley.edu>
>>>>>	Karl Chen wrote:

> Hi, I'm glad hashcash is now integrated and on by default.

> One thing that bothers me about the asynchronous payment
> insertion, which is otherwise awesome, is that it sets the message
> buffer modification bit.

> I use the advice below to get around it; how about integrating it
> into hashcash-insert-payment-async-2?

> (defadvice hashcash-insert-payment-async-2 (around kc-hashcash-set-notmodified
>                                                    (buffer &rest l)
>                                                    activate)
>   (let ((modified (buffer-modified-p buffer)))
>     ad-do-it
>     (save-excursion
>       (set-buffer buffer)
>       (set-buffer-modified-p modified))))

I see no oddness there.  I'll install the following change in
the trunk if no objection:

--8<---------------cut here---------------start------------->8---
--- hashcash.el~	2006-04-15 18:12:07 +0000
+++ hashcash.el	2006-11-15 04:57:42 +0000
@@ -247,7 +247,9 @@
 					hashcash-process-alist))
 	  (message-goto-eoh)
 	  (when pay
-	    (insert-before-markers "X-Hashcash: " pay)))))))
+	    (let ((modified (buffer-modified-p buffer)))
+	      (insert-before-markers "X-Hashcash: " pay)
+	      (set-buffer-modified-p modified))))))))
 
 (defun hashcash-cancel-async (&optional buffer)
   "Delete any hashcash processes associated with BUFFER.
--8<---------------cut here---------------end--------------->8---

BTW, how do you add hashcash headers when you write a mail from
scratch (i.e., the case where To and Cc have not been filled yet)?
I use `mail-add-payment', not `mail-add-payment-async'.

Regards,



  reply	other threads:[~2006-11-15  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 23:48 Karl Chen
2006-11-15  5:00 ` Katsumi Yamaoka [this message]
2006-11-15  8:37   ` Karl Chen
2006-11-15 14:22   ` gdt
2006-11-16  2:16     ` Katsumi Yamaoka

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=b4mbqn9uwvx.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --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).