Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-narrow-to-head, message-narrow-to-body?
@ 2003-04-07 13:55 Reiner Steib
  2003-04-07 14:27 ` Kai Großjohann
  0 siblings, 1 reply; 9+ messages in thread
From: Reiner Steib @ 2003-04-07 13:55 UTC (permalink / raw)


Hi,

we have `message-narrow-to-head*' and `gnus-narrow-to-body'.
What about `gnus-narrow-to-head' and `message-narrow-to-body'?

(defun gnus-narrow-to-head ()
  "Narrow to the head of an article."
  (goto-char (point-min))
  (narrow-to-region
   (point-min)
   (cond ((search-forward "\n\n" nil t)
	  (1+ (match-beginning 0)))
	 (t (point-max)))))

(defun message-narrow-to-body ()
  "Narrow the buffer to the body of the message."
  (widen)
  (narrow-to-region (message-goto-body) (point-max))
  (goto-char (point-min)))

Opinions?  Corrections?  Objections?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




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

* Re: gnus-narrow-to-head, message-narrow-to-body?
  2003-04-07 13:55 gnus-narrow-to-head, message-narrow-to-body? Reiner Steib
@ 2003-04-07 14:27 ` Kai Großjohann
  2003-04-07 14:43   ` Julien Avarre
  0 siblings, 1 reply; 9+ messages in thread
From: Kai Großjohann @ 2003-04-07 14:27 UTC (permalink / raw)


Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:

> What about `gnus-narrow-to-head' and `message-narrow-to-body'?

Are they needed?
-- 
A preposition is not a good thing to end a sentence with.



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

* Re: gnus-narrow-to-head, message-narrow-to-body?
  2003-04-07 14:27 ` Kai Großjohann
@ 2003-04-07 14:43   ` Julien Avarre
  2003-04-07 15:59     ` Kai Großjohann
  2003-04-07 16:33     ` Reiner Steib
  0 siblings, 2 replies; 9+ messages in thread
From: Julien Avarre @ 2003-04-07 14:43 UTC (permalink / raw)


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


kai.grossjohann@gmx.net (Kai Großjohann) disait récemment  :

> Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:
> 
> > What about `gnus-narrow-to-head' and `message-narrow-to-body'?
> 
> Are they needed?


They can be usesul for the pattern :

                  <#secure method=pgpmime mode=sign>

Actually It's pasted  at the end of quoted  replyied message. Which is
not very practical.  Reiner's functions should help us  for moving the
pgg pattern at the right place, am I right ?

-- 
Julien ``Eole'' Avarre
julien at avarre dot com

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: gnus-narrow-to-head, message-narrow-to-body?
  2003-04-07 14:43   ` Julien Avarre
@ 2003-04-07 15:59     ` Kai Großjohann
  2003-04-07 16:33     ` Reiner Steib
  1 sibling, 0 replies; 9+ messages in thread
From: Kai Großjohann @ 2003-04-07 15:59 UTC (permalink / raw)


Julien Avarre <julien@avarre.com> writes:

> kai.grossjohann@gmx.net (Kai Großjohann) disait récemment  :
>
>> Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:
>> 
>> > What about `gnus-narrow-to-head' and `message-narrow-to-body'?
>> 
>> Are they needed?
>
> They can be usesul for the pattern :
>
>                   <!#secure method=pgpmime mode=sign>

If you say so...  I can't see how, but certainly I won't object to a
patch that improves <!#secure method=pgpmime mode=sign> handling.

Btw, mml-quote-region didn't do anything, when invoked on the
previous paragraph.  I added the ! to quote manually.
-- 
A preposition is not a good thing to end a sentence with.



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

* Re: gnus-narrow-to-head, message-narrow-to-body?
  2003-04-07 14:43   ` Julien Avarre
  2003-04-07 15:59     ` Kai Großjohann
@ 2003-04-07 16:33     ` Reiner Steib
  2003-04-07 22:36       ` secure method (was: gnus-narrow-to-head, message-narrow-to-body?) Julien Avarre
  1 sibling, 1 reply; 9+ messages in thread
From: Reiner Steib @ 2003-04-07 16:33 UTC (permalink / raw)


On Mon, Apr 07 2003, Julien Avarre wrote:

> kai.grossjohann@gmx.net (Kai Großjohann) disait récemment  :
>
>> Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:
>> 
>> > What about `gnus-narrow-to-head' and `message-narrow-to-body'?
>> 
>> Are they needed?

I though that `message-narrow-to-body' would simplify the use of
`latin-unity-remap-region' or `latin-unity-sanity-check' on the
message body.  See the discussion on XEmacs+`latin-unity' in dcsg.

But as we can see, it might be useful in other places too:

> They can be usesul for the pattern [...]  Which is not very
> practical.  Reiner's functions should help us for moving the pgg
> pattern at the right place, am I right ?

I don't have an example for `gnus-narrow-to-head' at hand, but maybe
it should be added for completeness.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




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

* secure method (was: gnus-narrow-to-head, message-narrow-to-body?)
  2003-04-07 16:33     ` Reiner Steib
@ 2003-04-07 22:36       ` Julien Avarre
  2003-04-07 22:58         ` secure method Vasily Korytov
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Avarre @ 2003-04-07 22:36 UTC (permalink / raw)


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


Reiner Steib <4.uce.03.r.s@nurfuerspam.de> disait récemment  :

> On Mon, Apr 07 2003, Julien Avarre wrote:
> 
> > kai.grossjohann@gmx.net (Kai Großjohann) disait récemment  :
> >
> >> Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:
> >> 
> >> > What about `gnus-narrow-to-head' and `message-narrow-to-body'?
> >> 
> >> Are they needed?
> 
> I though that `message-narrow-to-body' would simplify the use of
> `latin-unity-remap-region' or `latin-unity-sanity-check' on the
> message body.  See the discussion on XEmacs+`latin-unity' in dcsg.
> 
> But as we can see, it might be useful in other places too:
> 
> > They can be usesul for the pattern [...]  Which is not very
> > practical.  Reiner's functions should help us for moving the pgg
> > pattern at the right place, am I right ?
> 
> I don't have an example for `gnus-narrow-to-head' at hand, but maybe
> it should be added for completeness.
> 
> Bye, Reiner.

Sorry, I've  probably misunderstood this thread. But  I still continue
to ask my question :-) 

Actually, I've put in my .gnus file :


   (add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime)


It allows me to automatically put the pattern in my message :

                  <#secure method=pgpmime mode=sign>

But when I reply  to a message, this pattern is written  at the end of
quoted text.  Gnus do not interpret  it. I have to move it manually to
the beginning of the body :-(

Is there a way to avoid that, automatize this ?

Thanks'

-- 
Julien ``Eole'' Avarre
julien at avarre dot com

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: secure method
  2003-04-07 22:36       ` secure method (was: gnus-narrow-to-head, message-narrow-to-body?) Julien Avarre
@ 2003-04-07 22:58         ` Vasily Korytov
  2003-04-08  0:01           ` Julien Avarre
  0 siblings, 1 reply; 9+ messages in thread
From: Vasily Korytov @ 2003-04-07 22:58 UTC (permalink / raw)


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

On Tue, 08 Apr 2003 00:36:13 +0200, Julien Avarre wrote:

>    (add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime)
>
>
> It allows me to automatically put the pattern in my message :
>
>                   <#secure method=pgpmime mode=sign>
>
> But when I reply  to a message, this pattern is written  at the end of
> quoted text.  Gnus do not interpret  it. I have to move it manually to
> the beginning of the body :-(
>
> Is there a way to avoid that, automatize this ?

Yup. There is gnus-message-setup-hook. Unless, you want to sign not all
the messages, it works. If it's not the case, huge constructions like
this appear:

(add-hook 'message-setup-hook 'mml-vk-maybe-sign)
(add-hook 'gnus-message-setup-hook 'mml-vk-maybe-sign)
(add-hook 'gnus-message-setup-hook 'mml-vk-remove-broken-sign)
(add-hook 'tc-pre-hook 'mml-unsecure-message) ;; or sc-pre-hook, or whatever

;; Should we sign the message
;;
(defun mml-vk-maybe-sign ()
  "Sign the message with PGP/MIME (if mml-vk-maybe-sign-pgpmime is bound
and returns anything, but nil) or PGP (same with mml-vk-maybe-sign-pgp)."
  (interactive)
  (cond ((and (fboundp 'mml-vk-maybe-sign-pgpmime) (mml-vk-maybe-sign-pgpmime))
	 (mml-secure-message-sign-pgpmime))
	((and (fboundp 'mml-vk-maybe-sign-pgp) (mml-vk-maybe-sign-pgp))
	 (mml-secure-message-sign-pgp))))

;; sign all the mail messages (gmane.* newsgroups are mailing lists)
(defun mml-vk-maybe-sign-pgpmime ()
  (cond ((message-mail-p)
	 t)
	((message-news-p)
	 (let ((groups (message-fetch-field "Newsgroups")))
	   (if (and groups (string= (substring groups 0 6) "gmane."))
	       t)))))

;; sign all the news messages, except fido7 hierarchy
;(defun mml-vk-maybe-sign-pgp ()
;  (if (message-news-p)
;      (let ((groups (message-fetch-field "Newsgroups")))
;	(if (and groups (not (string= (substring groups 0 6) "fido7.")))
;	    t))))

(defun mml-vk-remove-broken-sign ()
  "Remove a \"^<\#secure method=pgpmime mode=sign>$\" below the first line
of the message body."
  (interactive)
  (save-excursion
    (message-goto-body)
    (forward-line)
    (when (search-forward-regexp "^<\#secure method=pgpmime mode=sign>$" nil t)
      (delete-region (point-at-bol) (point-at-eol))
      (unless (eq (point) (point-max))
	(delete-char)))))

-- 
       I accept RFC3156 and RFC2440-compatible encrypted mail.
PGP key fingerprint: 123A 7CCE 6E26 6233 0D87 E01A A0F8 3524 FCD8 1841

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: secure method
  2003-04-07 22:58         ` secure method Vasily Korytov
@ 2003-04-08  0:01           ` Julien Avarre
  2003-04-08  0:08             ` Julien Avarre
  0 siblings, 1 reply; 9+ messages in thread
From: Julien Avarre @ 2003-04-08  0:01 UTC (permalink / raw)


deskpot@despammed.com (Vasily Korytov) disait récemment  :

> On Tue, 08 Apr 2003 00:36:13 +0200, Julien Avarre wrote:
> 
> >    (add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime)
> >
> >
> > It allows me to automatically put the pattern in my message :
> >
> >                   <#secure method=pgpmime mode=sign>
> >
> > But when I reply  to a message, this pattern is written  at the end of
> > quoted text.  Gnus do not interpret  it. I have to move it manually to
> > the beginning of the body :-(
> >
> > Is there a way to avoid that, automatize this ?
> 
> Yup. There is gnus-message-setup-hook. Unless, you want to sign not all
> the messages, it works. If it's not the case, huge constructions like
> this appear:
> 
> (add-hook 'message-setup-hook 'mml-vk-maybe-sign)
> (add-hook 'gnus-message-setup-hook 'mml-vk-maybe-sign)
> (add-hook 'gnus-message-setup-hook 'mml-vk-remove-broken-sign)
> (add-hook 'tc-pre-hook 'mml-unsecure-message) ;; or sc-pre-hook, or whatever
> 
> ;; Should we sign the message
> ;;
> (defun mml-vk-maybe-sign ()
>   "Sign the message with PGP/MIME (if mml-vk-maybe-sign-pgpmime is bound
> and returns anything, but nil) or PGP (same with mml-vk-maybe-sign-pgp)."
>   (interactive)
>   (cond ((and (fboundp 'mml-vk-maybe-sign-pgpmime) (mml-vk-maybe-sign-pgpmime))
> 	 (mml-secure-message-sign-pgpmime))
> 	((and (fboundp 'mml-vk-maybe-sign-pgp) (mml-vk-maybe-sign-pgp))
> 	 (mml-secure-message-sign-pgp))))
> 
> ;; sign all the mail messages (gmane.* newsgroups are mailing lists)
> (defun mml-vk-maybe-sign-pgpmime ()
>   (cond ((message-mail-p)
> 	 t)
> 	((message-news-p)
> 	 (let ((groups (message-fetch-field "Newsgroups")))
> 	   (if (and groups (string= (substring groups 0 6) "gmane."))
> 	       t)))))
> 
> ;; sign all the news messages, except fido7 hierarchy
> ;(defun mml-vk-maybe-sign-pgp ()
> ;  (if (message-news-p)
> ;      (let ((groups (message-fetch-field "Newsgroups")))
> ;	(if (and groups (not (string= (substring groups 0 6) "fido7.")))
> ;	    t))))
> 
> (defun mml-vk-remove-broken-sign ()
>   "Remove a \"^<\#secure method=pgpmime mode=sign>$\" below the first line
> of the message body."
>   (interactive)
>   (save-excursion
>     (message-goto-body)
>     (forward-line)
>     (when (search-forward-regexp "^<\#secure method=pgpmime mode=sign>$" nil t)
>       (delete-region (point-at-bol) (point-at-eol))
>       (unless (eq (point) (point-max))
> 	(delete-char)))))


Salut,   voilà   ce   qui   est   sensé   régler   nos   problème   de
mml-sign-truc-muche.   J'ai testé, mais  je ne  suis pas  convaincu du
tout. Mais peut-être que j'ai pas  fait tout comme il faut, où bien il
y a une coquille, mais je ne l'ai pas vue.

Fais moi part de tes commentaire.

-- 
Julien ``Eole'' Avarre
julien at avarre dot com




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

* Re: secure method
  2003-04-08  0:01           ` Julien Avarre
@ 2003-04-08  0:08             ` Julien Avarre
  0 siblings, 0 replies; 9+ messages in thread
From: Julien Avarre @ 2003-04-08  0:08 UTC (permalink / raw)


Julien Avarre <julien@avarre.com> was mistaking  :

[...]

I'm sorry, it's late :-(, I've forwarded this mail to the wrong persons.


                  All my apologizes for this annoyance.



-- 
Julien ``Eole'' Avarre
julien at avarre dot com




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

end of thread, other threads:[~2003-04-08  0:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07 13:55 gnus-narrow-to-head, message-narrow-to-body? Reiner Steib
2003-04-07 14:27 ` Kai Großjohann
2003-04-07 14:43   ` Julien Avarre
2003-04-07 15:59     ` Kai Großjohann
2003-04-07 16:33     ` Reiner Steib
2003-04-07 22:36       ` secure method (was: gnus-narrow-to-head, message-narrow-to-body?) Julien Avarre
2003-04-07 22:58         ` secure method Vasily Korytov
2003-04-08  0:01           ` Julien Avarre
2003-04-08  0:08             ` Julien Avarre

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