* message-newline-and-reformat and supercite @ 1999-09-26 19:51 Vladimir Volovich 1999-10-04 22:41 ` François Pinard 0 siblings, 1 reply; 18+ messages in thread From: Vladimir Volovich @ 1999-09-26 19:51 UTC (permalink / raw) Lars, message-newline-and-reformat (M-RET) does not work with supercited messages, which is very inconvenient: i find this function VERY useful in general, so it would be great to make it SC-aware. i modified it as follows, and it "works for me" (c): (defun message-newline-and-reformat () "Insert four newlines, and then reformat if inside quoted text." (interactive) (let ((point (point)) quoted) (save-excursion (beginning-of-line) (if (looking-at (sc-cite-regexp)) (setq quoted (buffer-substring (match-beginning 0) (match-end 0))))) (insert "\n\n\n\n") (delete-region (point) (re-search-forward "[ \t]*")) (when quoted (insert quoted)) (fill-paragraph nil) (goto-char point) (forward-line 2))) The line (delete-region (point) (re-search-forward "[ \t]*")) is in general useful (not only for SC), as it removes extra spaces at the beginning of the recited message, preserving good indentation. Could you please merge something like the above into the mainstream gnus? Best regards, -- Vladimir. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-09-26 19:51 message-newline-and-reformat and supercite Vladimir Volovich @ 1999-10-04 22:41 ` François Pinard 1999-10-05 6:45 ` Vladimir Volovich 0 siblings, 1 reply; 18+ messages in thread From: François Pinard @ 1999-10-04 22:41 UTC (permalink / raw) Cc: ding Vladimir Volovich <vvv@vvv.vsu.ru> writes: > message-newline-and-reformat (M-RET) does not work with supercited > messages, which is very inconvenient: i find this function VERY useful > in general, so it would be great to make it SC-aware. How do you use it? I just tried it, and it seems be convenient for inserting comments within a reply, maybe. Yet, it leaves two white lines before point, which is surely one too much. Also, it does not seem to properly discover the fill prefix for the following paragraph, at least in my little tries. The amount of extra work needed to repair these things, even if tiny, outweighs the benefits of using the command, at first glance. But since you underlined `VERY', above, I guess I may be missing something? :-) -- François Pinard http://www.iro.umontreal.ca/~pinard ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-10-04 22:41 ` François Pinard @ 1999-10-05 6:45 ` Vladimir Volovich 1999-10-05 18:50 ` Christophe Cuq 0 siblings, 1 reply; 18+ messages in thread From: Vladimir Volovich @ 1999-10-05 6:45 UTC (permalink / raw) "FP" == Francois Pinard writes: >> message-newline-and-reformat (M-RET) does not work with supercited >> messages, which is very inconvenient: i find this function VERY >> useful in general, so it would be great to make it SC-aware. FP> How do you use it? well, i just put cursor to the place where i wish to break the quote, and press M-RET (as i did just now ;). Then gnus automagically inserts a prefix (` FP> ' in this case) behind the first line, and re-formats the rest of the quoted paragraph (making it both look beautigul and reserving a bit of space :), and puts the point in the convenient place, so i can type an answer immediately without moving cursor. FP> I just tried it, and it seems be convenient for inserting FP> comments within a reply, maybe. Yet, it leaves two white lines FP> before point, which is surely one too much. Also, it does not FP> seem to properly discover the fill prefix for the following FP> paragraph, at least in my little tries. The amount of extra work FP> needed to repair these things, even if tiny, outweighs the FP> benefits of using the command, at first glance. But since you FP> underlined `VERY', above, I guess I may be missing something? FP> :-) Well, did you re-defined the message-newline-and-reformat function before trying? Let me give an example of how it works for me. 1) the quoted paragraph, as it looked after following up (prepared by supercite). Cursor is shown by `_' (at the first line, just after the question sign), and is at the place where i wished to insert a reply: FP> How do you use it?_ I just tried it, and it seems be convenient FP> for inserting comments within a reply, maybe. Yet, it leaves two FP> white lines before point, which is surely one too much. Also, it FP> does not seem to properly discover the fill prefix for the FP> following paragraph, at least in my little tries. The amount of FP> extra work needed to repair these things, even if tiny, outweighs FP> the benefits of using the command, at first glance. But since FP> you underlined `VERY', above, I guess I may be missing something? FP> :-) 2) when i press M-RET, the paragraph looks like: FP> How do you use it? _ FP> I just tried it, and it seems be convenient for inserting FP> comments within a reply, maybe. Yet, it leaves two white lines FP> before point, which is surely one too much. Also, it does not FP> seem to properly discover the fill prefix for the following FP> paragraph, at least in my little tries. The amount of extra work FP> needed to repair these things, even if tiny, outweighs the FP> benefits of using the command, at first glance. But since you FP> underlined `VERY', above, I guess I may be missing something? FP> :-) Note that the rest of the quote was micely reformatted, and cursor was put at the convenient place. Doesn't this work for you? Best regards, -- Vladimir. -- "What terrible way to die." "There are no good ways." -- Sulu and Kirk, "That Which Survives", stardate unknown ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-10-05 6:45 ` Vladimir Volovich @ 1999-10-05 18:50 ` Christophe Cuq 1999-10-05 20:25 ` David S. Goldberg 1999-10-06 4:38 ` Vladimir Volovich 0 siblings, 2 replies; 18+ messages in thread From: Christophe Cuq @ 1999-10-05 18:50 UTC (permalink / raw) Cc: ding >> "VV" == Vladimir Volovich <vvv@vvv.vsu.ru> writes: VV> Note that the rest of the quote was micely reformatted, and cursor VV> was put at the convenient place. Doesn't this work for you? I have the same problem as François. When I use M-RET it does not reformat the quoted material. The first line appears without the quote mark. Do you have a workaround ? Best Regards -- CHC ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 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 1 sibling, 1 reply; 18+ messages in thread From: David S. Goldberg @ 1999-10-05 20:25 UTC (permalink / raw) > I have the same problem as François. When I use M-RET it does not > reformat the quoted material. The first line appears without the > quote mark. Did you use Vladimir's definition or the default? Vladimir's works great for me; this is something I'd wanted for quite some time. I'd meant to send him a "thank you" in private email but since I forgot, Thanks Vladimir. -- Dave Goldberg Post: The Mitre Corporation\MS B325\202 Burlington Rd.\Bedford, MA 01730 Phone: 781-271-3887 Email: dsg@mitre.org ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-10-05 20:25 ` David S. Goldberg @ 1999-10-05 21:22 ` Christophe Cuq 0 siblings, 0 replies; 18+ messages in thread From: Christophe Cuq @ 1999-10-05 21:22 UTC (permalink / raw) >> "DSG" == David S Goldberg <dsg@mitre.org> writes: DSG> Did you use Vladimir's definition or the default? Vladimir's works DSG> great for me; this is something I'd wanted for quite some time. DSG> I'd meant to send him a "thank you" in private email but since I DSG> forgot, Thanks Vladimir. I didn't see his message, and so I didn't apply his func and use the default :( Sorry for the noise And thanks to Vladimir and you. -- CHC ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-10-05 18:50 ` Christophe Cuq 1999-10-05 20:25 ` David S. Goldberg @ 1999-10-06 4:38 ` Vladimir Volovich 1999-10-06 8:29 ` Kai Großjohann 1999-10-06 13:25 ` Laura Conrad 1 sibling, 2 replies; 18+ messages in thread From: Vladimir Volovich @ 1999-10-06 4:38 UTC (permalink / raw) Cc: ding "CC" == Christophe Cuq writes: VV> Note that the rest of the quote was micely reformatted, and VV> cursor was put at the convenient place. Doesn't this work for VV> you? CC> I have the same problem as François. When I use M-RET it does not CC> reformat the quoted material. The first line appears without the CC> quote mark. CC> Do you have a workaround ? the current message-newline-and-reformat in gnus 0.97 behaves like you said. i already posted the corrected function. here is it again: (defun message-newline-and-reformat () "Insert four newlines, and then reformat if inside quoted text." (interactive) (let ((point (point)) quoted) (save-excursion (beginning-of-line) (if (looking-at (sc-cite-regexp)) (setq quoted (buffer-substring (match-beginning 0) (match-end 0))))) (insert "\n\n\n\n") (delete-region (point) (re-search-forward "[ \t]*")) (when quoted (insert quoted)) (fill-paragraph nil) (goto-char point) (forward-line 2))) does it work for you, or is *the above* function behaving buggy? Best regards, -- Vladimir. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-10-06 4:38 ` Vladimir Volovich @ 1999-10-06 8:29 ` Kai Großjohann 1999-10-07 0:22 ` Francisco Solsona 1999-10-06 13:25 ` Laura Conrad 1 sibling, 1 reply; 18+ messages in thread From: Kai Großjohann @ 1999-10-06 8:29 UTC (permalink / raw) 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. So, maybe we should lobby Barry to provide such a function, and maybe we should lobby Barry and Lars to find some way for Message and Supercite to better interoperate. Maybe it is sufficient to introduce a variable message-newline-function which is called when non-nil, and Barry provides one which is Supercite aware? What do you think? (I don't use Supercite now and the standard definition for M-RET does rather well for me. I still need to do M-q on the second paragraph, and whitespace isn't deleted, but I don't perceive this as a real problem.) kai -- Life is hard and then you die. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-10-06 8:29 ` Kai Großjohann @ 1999-10-07 0:22 ` Francisco Solsona 1999-11-06 3:13 ` Lars Magne Ingebrigtsen 0 siblings, 1 reply; 18+ messages in thread From: Francisco Solsona @ 1999-10-07 0:22 UTC (permalink / raw) Cc: ding 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. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-10-07 0:22 ` Francisco Solsona @ 1999-11-06 3:13 ` Lars Magne Ingebrigtsen 0 siblings, 0 replies; 18+ messages in thread From: Lars Magne Ingebrigtsen @ 1999-11-06 3:13 UTC (permalink / raw) Francisco Solsona <flsc@hp.fciencias.unam.mx> writes: > I don't use supercite either, though I found M-RET useful, so > what about this modified version (based on Vladimir's): I've taken bits of your and Vladimirs versions and rolled a slightly different version. It's in the CVS. -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-10-06 4:38 ` Vladimir Volovich 1999-10-06 8:29 ` Kai Großjohann @ 1999-10-06 13:25 ` Laura Conrad 1999-10-06 17:52 ` Vladimir Volovich 1 sibling, 1 reply; 18+ messages in thread From: Laura Conrad @ 1999-10-06 13:25 UTC (permalink / raw) >>>>> "Vladimir" == Vladimir Volovich <vvv@vvv.vsu.ru> writes: CC> Do you have a workaround ? Vladimir> the current message-newline-and-reformat in gnus 0.97 Vladimir> behaves like you said. i already posted the corrected Vladimir> function. here is it again: ... Vladimir> does it work for you, or is *the above* function behaving buggy? It seems to work some of the time, for instance, on the above, correctly filled text, I can do: <begin test 1> Vladimir> the current message-newline-and-reformat in gnus 0.97 Vladimir> behaves like you said. Here I have inserted a break, and the next paragraph displays correctly. Vladimir> i already posted the corrected function. here is it Vladimir> again: <end test 1> However, if there are spaces at the ends of lines, the attributions don't get removed: <begin test 2> Vladimir> (defun message-newline-and-reformat () Vladimir> "Insert four newlines, and then reformat if inside quoted text." Vladimir> (interactive) Vladimir> (let ((point (point)) Here's where I inserted the break. Vladimir> Vladimir> quoted) Vladimir> (save-excursion Vladimir> Vladimir> (beginning-of-line) Vladimir> (if (looking-at Vladimir> (sc-cite-regexp)) (setq quoted (buffer-substring Vladimir> (match-beginning 0) (match-end 0))))) Vladimir> Vladimir> (insert "\n\n\n\n") Vladimir> (delete-region (point) 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. -- Laura (mailto:lconrad@world.std.com , http://www.world.std.com/~lconrad/ ) (617) 661-8097 fax: (801) 365-6574 233 Broadway, Cambridge, MA 02139 ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1999-10-06 13:25 ` Laura Conrad @ 1999-10-06 17:52 ` Vladimir Volovich 0 siblings, 0 replies; 18+ messages in thread From: Vladimir Volovich @ 1999-10-06 17:52 UTC (permalink / raw) "LC" == Laura Conrad writes: LC> However, if there are spaces at the ends of lines, the LC> attributions don't get removed: i have to agree. the current implementation of reformatting should be made a bit more robust... it relies on fill-paragraph, which works not perfect in some situations. Best regards, -- Vladimir. ^ permalink raw reply [flat|nested] 18+ messages in thread
* message-newline-and-reformat and supercite @ 1997-12-20 21:10 Michael R Cook 1998-01-04 9:29 ` Lars Magne Ingebrigtsen 0 siblings, 1 reply; 18+ messages in thread From: Michael R Cook @ 1997-12-20 21:10 UTC (permalink / raw) If I do M-RET (message-newline-and-reformat) in a Supercite context, such as: +----- | FOO> hello_world +----- (the underscore `_' represents point), the result is +----- | FOO> hello | |_ | | world +----- I was expecting +----- | FOO> hello | |_ | | FOO> world +----- Is this a bug in message.el? Or is my supercite installation misconfigured? Michael. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1997-12-20 21:10 Michael R Cook @ 1998-01-04 9:29 ` Lars Magne Ingebrigtsen 1998-01-04 16:08 ` Wes Hardaker 0 siblings, 1 reply; 18+ messages in thread From: Lars Magne Ingebrigtsen @ 1998-01-04 9:29 UTC (permalink / raw) Michael R Cook <mcook@cognex.com> writes: > If I do M-RET (message-newline-and-reformat) in a Supercite context, > such as: That command doesn't know anything about Supercite, so it won't do anything useful there... -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1998-01-04 9:29 ` Lars Magne Ingebrigtsen @ 1998-01-04 16:08 ` Wes Hardaker 1998-01-05 4:05 ` Lars Magne Ingebrigtsen 0 siblings, 1 reply; 18+ messages in thread From: Wes Hardaker @ 1998-01-04 16:08 UTC (permalink / raw) >>>>> On 04 Jan 1998 10:29:46 +0100, Lars Magne Ingebrigtsen <larsi@gnus.org> said: Cook> If I do M-RET (message-newline-and-reformat) in a Supercite Cook> context, such as: Lars> That command doesn't know anything about Supercite, so it won't Lars> do anything useful there... I think the point was to change the regex used to do the inserting of ">"s to something that would recognize text in front of the '>'? IE, replace message-yank-prefix with a regexp. That way it would catch ">> " as well. A bit more complex of a function, but worth it. -- "Ninjas aren't dangerous. They're more afraid of you than you are of them." ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1998-01-04 16:08 ` Wes Hardaker @ 1998-01-05 4:05 ` Lars Magne Ingebrigtsen 1998-01-05 10:21 ` Kai Grossjohann 0 siblings, 1 reply; 18+ messages in thread From: Lars Magne Ingebrigtsen @ 1998-01-05 4:05 UTC (permalink / raw) Wes Hardaker <wjhardaker@ucdavis.edu> writes: > I think the point was to change the regex used to do the inserting of > ">"s to something that would recognize text in front of the '>'? IE, > replace message-yank-prefix with a regexp. That way it would catch > ">> " as well. A bit more complex of a function, but worth it. Yes, but I think this should be up to Supercite, if possible. -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1998-01-05 4:05 ` Lars Magne Ingebrigtsen @ 1998-01-05 10:21 ` Kai Grossjohann 1998-01-12 22:11 ` Lars Magne Ingebrigtsen 0 siblings, 1 reply; 18+ messages in thread From: Kai Grossjohann @ 1998-01-05 10:21 UTC (permalink / raw) >>>>> Wes Hardaker <wjhardaker@ucdavis.edu> writes: >> I think the point was to change the regex used to do the inserting of >> ">"s to something that would recognize text in front of the '>'? IE, >> replace message-yank-prefix with a regexp. That way it would catch >> ">> " as well. A bit more complex of a function, but worth it. >>>>> On 05 Jan 1998, Lars Magne Ingebrigtsen said: Lars> Yes, but I think this should be up to Supercite, if possible. Well, Supercite has C-c C-p o already. It is more like C-o than RET, but it comes close... Do we need a hook for doing an intelligent newline so that SC can provide a function and message-mode can provide a function and the user can decide which one to use? kai -- Kai Grossjohann, Informatik VI grossjohann@ls6.cs.uni-dortmund.de Uni Dortmund, D-44221 Dortmund http://ls6-www.cs.uni-dortmund.de/ Vox +49 231 755 5670, Fax -2405 I like both kinds of music. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: message-newline-and-reformat and supercite 1998-01-05 10:21 ` Kai Grossjohann @ 1998-01-12 22:11 ` Lars Magne Ingebrigtsen 0 siblings, 0 replies; 18+ messages in thread From: Lars Magne Ingebrigtsen @ 1998-01-12 22:11 UTC (permalink / raw) Kai Grossjohann <grossjohann@charly.cs.uni-dortmund.de> writes: > >>>>> On 05 Jan 1998, Lars Magne Ingebrigtsen said: > Lars> Yes, but I think this should be up to Supercite, if possible. > > Well, Supercite has C-c C-p o already. It is more like C-o than RET, > but it comes close... > > Do we need a hook for doing an intelligent newline so that SC can > provide a function and message-mode can provide a function and the > user can decide which one to use? I think Supercite should just bind `M-RET' to its intelligent newline. -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~1999-11-06 3:13 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 1999-09-26 19:51 message-newline-and-reformat and supercite 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 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
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).