From: Francisco Solsona <flsc@hp.fciencias.unam.mx>
Cc: ding@gnus.org
Subject: Re: message-newline-and-reformat and supercite
Date: 06 Oct 1999 19:22:20 -0500 [thread overview]
Message-ID: <m3ogecow8z.fsf@hp.fciencias.unam.mx> (raw)
In-Reply-To: Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "06 Oct 1999 10:29:29 +0200"
Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
> Vladimir Volovich <vvv@vvv.vsu.ru> writes:
>
> > (if (looking-at (sc-cite-regexp))
>
> One potential problem with this is that it depends on Supercite.
> Supercite already offers C-c C-p o which I used to use a lot when I
> used Supercite.
I don't use supercite either, though I found M-RET useful, so
what about this modified version (based on Vladimir's):
,--------------------
| (defun message-newline-and-reformat (&optional no-fill)
| "Insert four newlines, and then reformat if inside quoted text. If
| called with a prefix argument it avoids filling the paragraph."
| (interactive "P")
| (let ((point (point))
| (gnus-prefix "[]>»|:}+ \t]*") ;; gnus-cite-prefix-regexp is more than we need.
| (gnus-supercite-thing "[-._a-zA-Z0-9]*[>]+[ \t]*")
| quoted)
| (save-excursion
| (beginning-of-line)
| (if (looking-at (concat gnus-prefix
| gnus-supercite-thing)) ;; (sc-cite-regexp)
| (setq quoted (buffer-substring (match-beginning 0) (match-end 0)))))
| (insert "\n\n\n\n")
| (when (null no-fill) ;; No filling.
| (delete-region (point) (re-search-forward "[ \t]*")))
| (when quoted
| (insert quoted))
| (when (null no-fill) ;; I said: No filling!.. Thank you.
| (setq fill-prefix quoted) ;; For me fill-paragraph sucks without this. :-(
| (fill-paragraph nil))
| (goto-char point)
| (forward-line 2)))
`--------------------
which avoids using sc-cite-regexp (but mimics its functionality, of
course). It also tries to solve:
Laura Conrad <lconrad@world.std.com> writes:
[...]
> Vladimir> (re-search-forward "[ \t]*")) Vladimir> (when quoted
> Vladimir> Vladimir> (insert quoted)) Vladimir> (fill-paragraph
> Vladimir> nil) Vladimir> (goto-char point) Vladimir>
> Vladimir> (forward-line 2)))
>
>
> <end test 2>
>
> This is a bad example, since you wouldn't really want the lisp code
> reformatted, but I frequently reply to correspondents who haven't
> filled their lines any better than the lisp code did.
The new message-newline-and-reformat avoids filling the
paragraph if you pass it a prefix argument, like in: `C-u M-RET'.
works for me, so hth,
Francisco
P.S. Thank yuo Vladimir. :-)
--
Alcoholics Anonymous is when you get to drink under someone else's name.
next prev parent reply other threads:[~1999-10-07 0:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-26 19:51 Vladimir Volovich
1999-10-04 22:41 ` François Pinard
1999-10-05 6:45 ` Vladimir Volovich
1999-10-05 18:50 ` Christophe Cuq
1999-10-05 20:25 ` David S. Goldberg
1999-10-05 21:22 ` Christophe Cuq
1999-10-06 4:38 ` Vladimir Volovich
1999-10-06 8:29 ` Kai Großjohann
1999-10-07 0:22 ` Francisco Solsona [this message]
1999-11-06 3:13 ` Lars Magne Ingebrigtsen
1999-10-06 13:25 ` Laura Conrad
1999-10-06 17:52 ` Vladimir Volovich
-- strict thread matches above, loose matches on Subject: below --
1997-12-20 21:10 Michael R Cook
1998-01-04 9:29 ` Lars Magne Ingebrigtsen
1998-01-04 16:08 ` Wes Hardaker
1998-01-05 4:05 ` Lars Magne Ingebrigtsen
1998-01-05 10:21 ` Kai Grossjohann
1998-01-12 22:11 ` Lars Magne Ingebrigtsen
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=m3ogecow8z.fsf@hp.fciencias.unam.mx \
--to=flsc@hp.fciencias.unam.mx \
--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).