开发者

How can one combine fill-paragraph with supercite?

开发者 https://www.devze.com 2023-02-13 07:57 出处:网络
I am using Emacs 23 and VM 8.1 to write and read email. I am using Supercite 3.1 to get fancy citations in my replies such as

I am using Emacs 23 and VM 8.1 to write and read email. I am using Supercite 3.1 to get fancy citations in my replies such as

Foo> bla bla bla ... When are you
Foo> resuming the work on our paper?

I would like to get the same features as fill-paragraph but on the citation. I see it working on commented parts in LaTeX-mode (with the same function fill-paragraph)q, so I assume that I just have to set-up the correct regular expression for fill-paragraph to do the job, but which one and through which hook?


EXAMPLE

I would like that, after editing out "bla bla bla ..." to get the following

Foo> When are you
Foo> resuming the work on our paper?

and pressing M-q, to get a correctly filled citation such as

Foo> When are you resuming the work on 
Foo> our paper?

In LaTeX-mode, the equivalent would be to go from

% When are you
% resuming the work on our paper?

to

% When are you resuming the 开发者_StackOverflow社区work on our paper?

Later Addition

Supercite documentation suggests the use of filladapt or gin-mode. (http://www.delorie.com/gnu/docs/emacs/sc_4.html)

It is mentioned that "filladapt.el needs a bit rewriting to fit into Emacs today." on http://www.emacswiki.org/emacs/FillAdapt I tried it anyway without success.

Its alternative, gin-mode.el (http://www.gaertner.de/~neitzel/sw.html) is not available on the cvs server of its author.


See set-fill-prefix (bound to C-x . by default). In brief, move the point to the end of the fill-prefix ("Foo> " in your case) and press C-x .; subsequent fill-paragraph (M-q) will have the desired effect.

Edit(2011-02-27):

It works for me in text-mode, without any customization (i.e., I started emacs with "emacs -Q"). After C-x ., can you check if the fill-prefix is set correctly? Pressing C-h v fill-prefix should show its value as the string "Foo> ".


You may have to use FillAdapt as suggested in the docs.

0

精彩评论

暂无评论...
验证码 换一张
取 消