Gnus development mailing list
 help / color / mirror / Atom feed
* removing signatures when using supercite
@ 2010-06-08 22:14 Sebastian P. Luque
  2010-06-09  3:46 ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian P. Luque @ 2010-06-08 22:14 UTC (permalink / raw)
  To: ding

Hi,

I'd like to remove signatures when replying/following-up while using
`sc-cite-original' for `message-cite-function' (i.e. Supercite).  I
thought the following would do:

(add-hook 'mail-citation-hook 'message-remove-signature)

so that:

,-----[ C-h v mail-citation-hook RET ]
| mail-citation-hook is a variable defined in `sendmail.el'.
| Its value is 
| (sc-cite-original message-remove-signature)
| 
| 
|   This variable is potentially risky when used as a file local variable.
| 
| Documentation:
| Hook for modifying a citation just inserted in the mail buffer.
| Each hook function can find the citation between (point) and (mark t),
| and should leave point and mark around the citation text as modified.
| The hook functions can find the header of the cited message
| in the variable `mail-citation-header', whether or not this is included
| in the cited portion of the message.
| 
| If this hook is entirely empty (nil), a default action is taken
| instead of no action.
| 
| You can customize this variable.
`-----

It seems `message-remove-signature' should work here.  Should it be
placed in some other hook?


Cheers,

-- 
Seb



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

* Re: removing signatures when using supercite
  2010-06-08 22:14 removing signatures when using supercite Sebastian P. Luque
@ 2010-06-09  3:46 ` Katsumi Yamaoka
  2010-06-09  4:04   ` Sebastian P. Luque
  2010-06-09  6:31   ` Citation line (was: removing signatures when using supercite) Teemu Likonen
  0 siblings, 2 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2010-06-09  3:46 UTC (permalink / raw)
  To: ding

>>>>> Sebastian P. Luque wrote:
> I'd like to remove signatures when replying/following-up while using
> `sc-cite-original' for `message-cite-function' (i.e. Supercite).  I
> thought the following would do:

> (add-hook 'mail-citation-hook 'message-remove-signature)

I don't use Supercite but it doesn't seem to call mail-citation-hook.
So,

> so that:

> ,-----[ C-h v mail-citation-hook RET ]
>| mail-citation-hook is a variable defined in `sendmail.el'.
>| Its value is
>| (sc-cite-original message-remove-signature)

those two functions seem not to be used.

[...]

> Should it be placed in some other hook?

I guess `sc-pre-hook' is what you look for.



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

* Re: removing signatures when using supercite
  2010-06-09  3:46 ` Katsumi Yamaoka
@ 2010-06-09  4:04   ` Sebastian P. Luque
  2010-06-09  5:13     ` Sebastian P. Luque
  2010-06-09  6:09     ` Katsumi Yamaoka
  2010-06-09  6:31   ` Citation line (was: removing signatures when using supercite) Teemu Likonen
  1 sibling, 2 replies; 8+ messages in thread
From: Sebastian P. Luque @ 2010-06-09  4:04 UTC (permalink / raw)
  To: ding

On Wed, 09 Jun 2010 12:46:32 +0900,
Katsumi Yamaoka <yamaoka@jpl.org> wrote:

>>>>>> Sebastian P. Luque wrote:
>> I'd like to remove signatures when replying/following-up while using
>> `sc-cite-original' for `message-cite-function' (i.e. Supercite).  I
>> thought the following would do:

>> (add-hook 'mail-citation-hook 'message-remove-signature)

> I don't use Supercite but it doesn't seem to call mail-citation-hook.

Yet the Supercite manual says:

,-----[ (info "(sc)Getting Connected") lines: 576 - 580 ]
| In most cases, all that is necessary to begin using Supercite is to add
| the following to `~.emacs':
| 
|      (add-hook 'mail-citation-hook 'sc-cite-original)
`-----


> I guess `sc-pre-hook' is what you look for.

I've actually tried both this and `sc-post-hook', and something seems to
clash, as I'm popped to a message composition buffer, with mark and
point around the cited message, and then lines like the one below start
flashing every second or so in the minibuffer (and stored in
*Messages*):

Mail header "> Hi Sebas..." doesn't conform to RFC 822. skipping...
No mail headers found! Restoring old information.

starting from the first line in the cited message, down to the last
one.  I've tried adding `message-remove-signature' to both the end and
beginning of the hook to no avail:

,-----[ C-h v sc-pre-hook RET ]
| sc-pre-hook is a variable defined in `supercite.el'.
| Its value is shown below.
| 
|   This variable is potentially risky when used as a file local variable.
| 
| Documentation:
| Hook which gets run before each invocation of `sc-cite-original'.
| 
| You can customize this variable.
| 
| Value: 
| ((lambda nil
|    (save-excursion
|      (let
| 	 ((citexp
| 	   (format "^[%s %s]+ *$" sc-citation-leader sc-citation-delimiter)))
|        (while
| 	   (re-search-forward citexp nil t)
| 	 (replace-match "")))))
|  message-remove-signature)
| 
| [back]
`-----

The lambda hook above was installed by Supercite.

-- 
Seb



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

* Re: removing signatures when using supercite
  2010-06-09  4:04   ` Sebastian P. Luque
@ 2010-06-09  5:13     ` Sebastian P. Luque
  2010-06-09  6:09     ` Katsumi Yamaoka
  1 sibling, 0 replies; 8+ messages in thread
From: Sebastian P. Luque @ 2010-06-09  5:13 UTC (permalink / raw)
  To: ding

On Tue, 08 Jun 2010 23:04:23 -0500,
"Sebastian P. Luque" <spluque@gmail.com> wrote:

> The lambda hook above was installed by Supercite.

Sorry, that's not true, it's a function I forgot I had in ~/.gnus.el to
remove empty cited lines.  At any rate, it doesn't make a difference if
I remove it completely and just have `message-remove-signature'.  It
seems as if this function is not useable at all with Supercite.


-- 
Seb



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

* Re: removing signatures when using supercite
  2010-06-09  4:04   ` Sebastian P. Luque
  2010-06-09  5:13     ` Sebastian P. Luque
@ 2010-06-09  6:09     ` Katsumi Yamaoka
  2010-06-09 12:32       ` Sebastian P. Luque
  1 sibling, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2010-06-09  6:09 UTC (permalink / raw)
  To: ding

>>>>> Sebastian P. Luque wrote:
> On Wed, 09 Jun 2010 12:46:32 +0900,
> Katsumi Yamaoka <yamaoka@jpl.org> wrote:
[...]
>> I guess `sc-pre-hook' is what you look for.

> I've actually tried both this and `sc-post-hook', and something seems to
> clash, as I'm popped to a message composition buffer, with mark and
> point around the cited message, and then lines like the one below start
> flashing every second or so in the minibuffer (and stored in
> *Messages*):

> Mail header "> Hi Sebas..." doesn't conform to RFC 822. skipping...
> No mail headers found! Restoring old information.

Oops, I found the cause of this is that `message-remove-signature'
does the citation (i.e. remove headers, add '> ' to lines, etc.)
using the function `message-indent-citation'.  Hmm,
`message-remove-signature' may be the function for exclusive use
of a certain person.  Here's a workaround (it makes
`message-indent-citation' NOP temporarily):

(add-hook 'sc-pre-hook
	  (lambda ()
	    (let ((m-i-c (symbol-function 'message-indent-citation)))
	      (fset 'message-indent-citation 'ignore)
	      (unwind-protect
		  (message-remove-signature)
		(fset 'message-indent-citation m-i-c)))))



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

* Citation line (was: removing signatures when using supercite)
  2010-06-09  3:46 ` Katsumi Yamaoka
  2010-06-09  4:04   ` Sebastian P. Luque
@ 2010-06-09  6:31   ` Teemu Likonen
  2010-06-09  8:08     ` Citation line Katsumi Yamaoka
  1 sibling, 1 reply; 8+ messages in thread
From: Teemu Likonen @ 2010-06-09  6:31 UTC (permalink / raw)
  To: ding

* 2010-06-09 12:46 (+0900), Katsumi Yamaoka wrote:

>>>>>> Sebastian P. Luque wrote:

I suggest that you don't use ">" characters in the attribution line (in
Gnus it's called citation line). Usually Gnus can fontify attributions
with the same color as the actual quotation and that makes it easy to
see which attribution refers to which quotations. There are also other
features (like "W W c") which don't work correctly when Gnus can't
connect attribution with the appropriate quotation level.

I'm sorry if this sounds too much like an attack to your personal
preferences.




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

* Re: Citation line
  2010-06-09  6:31   ` Citation line (was: removing signatures when using supercite) Teemu Likonen
@ 2010-06-09  8:08     ` Katsumi Yamaoka
  0 siblings, 0 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2010-06-09  8:08 UTC (permalink / raw)
  To: ding

Teemu Likonen wrote:
> * 2010-06-09 12:46 (+0900), Katsumi Yamaoka wrote:

>>>>>>> Sebastian P. Luque wrote:

> I suggest that you don't use ">" characters in the attribution line (in
> Gnus it's called citation line). Usually Gnus can fontify attributions
> with the same color as the actual quotation and that makes it easy to
> see which attribution refers to which quotations. There are also other
> features (like "W W c") which don't work correctly when Gnus can't
> connect attribution with the appropriate quotation level.

Ok.  Though ">>>>> " is the default in Supercite (and MU-CITE I use),
I've changed it.  Maybe this is the best for Gnus.  Thanks.



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

* Re: removing signatures when using supercite
  2010-06-09  6:09     ` Katsumi Yamaoka
@ 2010-06-09 12:32       ` Sebastian P. Luque
  0 siblings, 0 replies; 8+ messages in thread
From: Sebastian P. Luque @ 2010-06-09 12:32 UTC (permalink / raw)
  To: ding

On Wed, 09 Jun 2010 15:09:58 +0900,
Katsumi Yamaoka <yamaoka@jpl.org> wrote:

> Oops, I found the cause of this is that `message-remove-signature'
> does the citation (i.e. remove headers, add '> ' to lines, etc.)
> using the function `message-indent-citation'.  Hmm,
> `message-remove-signature' may be the function for exclusive use of a
> certain person.  Here's a workaround (it makes
> `message-indent-citation' NOP temporarily):

Thanks very much Katsumi!

-- 
Seb



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

end of thread, other threads:[~2010-06-09 12:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-08 22:14 removing signatures when using supercite Sebastian P. Luque
2010-06-09  3:46 ` Katsumi Yamaoka
2010-06-09  4:04   ` Sebastian P. Luque
2010-06-09  5:13     ` Sebastian P. Luque
2010-06-09  6:09     ` Katsumi Yamaoka
2010-06-09 12:32       ` Sebastian P. Luque
2010-06-09  6:31   ` Citation line (was: removing signatures when using supercite) Teemu Likonen
2010-06-09  8:08     ` Citation line Katsumi Yamaoka

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).