unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* solution to gnus-alias problems?
@ 2012-10-01  0:57 David Bremner
  2012-10-01 15:56 ` Michal Nazarewicz
  0 siblings, 1 reply; 2+ messages in thread
From: David Bremner @ 2012-10-01  0:57 UTC (permalink / raw)
  To: 687390; +Cc: notmuch


Geoff writes:

   Hi David,

   I've found the source of the problem I was having. It seems to be due
   to some interference with the notmuch-mua-reply function and
   gnus-alias. In particular, there was a problem with the part of
   notmuch-mua-reply that inserted the newly setup message contents.

   Towards the end of the notmuch-mua-reply function, there is the following code:

       ;; insert the message body - but put it in front of the signature
       ;; if one is present
       (goto-char (point-max))
   *    (if (re-search-backward message-signature-separator nil t)
   *	  (forward-line -1)
	 (goto-char (point-max)))
       (insert body)
       (push-mark))
     (set-buffer-modified-p nil)

   The problem is with the two lines I've marked with a *. Suppose the
   main message reply buffer already contains a signature and looks like
   this

   [Headers]
   --text follows this line
   --
   [Signature text]

   The above goes goes to the end of buffer with (point-max), then
   searches back to the beginning of the signature separator, which is
   fine. But then it moves one line up to the beginning of '--text
   follows this line--" and then inserts the newly created message body,
   which means that it inserts it before the '--text follows this
   line--'.

   I've solved the problem (I think) by adjust the above code as follows:

       (if (re-search-backward message-signature-separator nil t)
	     (progn
	       (beginning-of-line)
	       (newline))
	 (goto-char (point-max)))

   Hope this helps!

   Best,

   Geoffrey

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: solution to gnus-alias problems?
  2012-10-01  0:57 solution to gnus-alias problems? David Bremner
@ 2012-10-01 15:56 ` Michal Nazarewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Nazarewicz @ 2012-10-01 15:56 UTC (permalink / raw)
  To: David Bremner, 687390; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 2164 bytes --]

On Mon, Oct 01 2012, David Bremner <bremner@debian.org> wrote:
> Geoff writes:
>
>    Hi David,
>
>    I've found the source of the problem I was having. It seems to be due
>    to some interference with the notmuch-mua-reply function and
>    gnus-alias. In particular, there was a problem with the part of
>    notmuch-mua-reply that inserted the newly setup message contents.
>
>    Towards the end of the notmuch-mua-reply function, there is the following code:
>
>        ;; insert the message body - but put it in front of the signature
>        ;; if one is present
>        (goto-char (point-max))
>    *    (if (re-search-backward message-signature-separator nil t)
>    *	  (forward-line -1)
> 	 (goto-char (point-max)))
>        (insert body)
>        (push-mark))
>      (set-buffer-modified-p nil)
>
>    The problem is with the two lines I've marked with a *. Suppose the
>    main message reply buffer already contains a signature and looks like
>    this
>
>    [Headers]
>    --text follows this line
>    --
>    [Signature text]
>
>    The above goes goes to the end of buffer with (point-max), then
>    searches back to the beginning of the signature separator, which is
>    fine. But then it moves one line up to the beginning of '--text
>    follows this line--" and then inserts the newly created message body,
>    which means that it inserts it before the '--text follows this
>    line--'.
>
>    I've solved the problem (I think) by adjust the above code as follows:
>
>        (if (re-search-backward message-signature-separator nil t)
> 	     (progn
> 	       (beginning-of-line)

Call to `beginning-of-line' seems redundant, `re-search-backward' should
move point to the beginning of the match which starts at the beginning
of a line.  Or am I missing something?

> 	       (newline))
> 	 (goto-char (point-max)))

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-01 15:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-01  0:57 solution to gnus-alias problems? David Bremner
2012-10-01 15:56 ` Michal Nazarewicz

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).