Bug 78813 - emacslike: fill paragraph to auto-format a paragraph
Summary: emacslike: fill paragraph to auto-format a paragraph
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: scripting (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 93398 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-31 16:54 UTC by ronny_klein
Modified: 2012-10-28 21:48 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ronny_klein 2004-03-31 16:54:47 UTC
Version:            (using KDE KDE 3.2.1)
Installed from:    RedHat RPMs

Instead of generally complaining about missing emacs keybinding, I'm going to write a wish report for each one I have in mind:

Emacs has a very nice "fill paragraph" feature which is especially useful if one writes a text (LaTeX etc.). When pressing Alt-Q the paragraph gets reformated according to the selected word wrap style. This means a paragraph (one empty line above and below) like this:

"Please fill in a detailed description of the bug. 
Try to describe how to reproduce        the bug
 when possible.
 If we cannot reproduce your problem    we may have to close your bug without being able to fix it."

would change to:

"Please fill in a detailed description of the bug. Try to describe how to reproduce the bug when possible. If we cannot reproduce your problem we may have to close your bug without being able to fix it."

Important here is that more than one space between the words are also deleted. One can find this feature also in Evolution 1.4.5, so it might even be useful in general, i.e. every text widget.
Comment 1 Anders Lund 2004-03-31 17:49:43 UTC
What you describe here is not a key binding, it is a feature.
A nice one, though.

What you suggests seems to be a comnination of rewrapping the lines, and normalizing whitespace, we don't have the latter yet, and we don't suport wrapping "a paragraph" or the selection yet either.

Who the f*** cares about evolution? :o
Comment 2 Daniel Richard G. 2004-07-12 05:31:30 UTC
I would be happy just to have a "fill paragraph" function without the whitespace normalization (although that would be nice as well). From what I can tell in Bugs 48529 and 58401, the closest current practice is to select a run of text, and then execute "Apply Word Wrap." When the desired run of text is one blank-line-delimited paragraph---trivially recognizable by the editor---this procedure is quite cumbersome (*). Ideally, there would be a [single] keystroke that reformats whatever paragraph the cursor is in.

(*) - Cumbersome as it is described, but I can't get even that much relief. I don't see an "Apply Word Wrap" menu item anywhere, only "Word Wrap Document" under the Tools menu---and so far as I've fiddled around with it, it doesn't seem to have the same behavior. At the very least, the "select a run of text to limit the scope of re-wrapping" feature doesn't work for me.

I'm a longtime user of NEdit and pico/nano, and "fill/justify paragraph" has always been Ctrl-J for me. It's a _very_ common operation in my course of authoring LaTeX text---basically, every time that I edit an existing paragraph, the last thing done to it is a fill. It's a little disorienting for me not to be able to do this in Kate, especially when other text editors provide the functionality as a matter of course, and when Kate as a whole is already so far beyond most other text editors :-)
Comment 3 Jerome Quelin 2006-05-03 19:40:39 UTC
also available in vim with gqip key bindings.
definitely a nice-to-have feature.

see also bug #93398 which is the same.
Comment 4 Anders Lund 2006-05-03 22:46:02 UTC
On Wednesday 03 May 2006 19:40, Jerome Quelin wrote:
> also available in vim with gqip key bindings.
> definitely a nice-to-have feature.


So, use that. and, bugging us about what other editors do is 
counterproductive!!!!!!!!!!!!!!!!!
Comment 5 Daniel Richard G. 2006-05-04 05:34:40 UTC
This remains a shortcoming in Kate, however. Because of this, Kate is not [yet] suitable for general editing of statically-wrapped text. (If LaTeX isn't a compelling enough instance of this, try e-mail messages.)

Right now, if you have a paragraph with some too-short and too-long lines, you have to (1) invoke "Join Lines" enough times to get the entire paragraph on one line, and then (2) "Word Wrap Document." You're screwed if you want to preserve initial whitespace on each line (e.g. for indented paragraphs, or any kind of itemized list), or if you don't want long lines elsewhere in the document to be wrapped as well.

I don't understand why such a common "fill paragraph" function is not available in Kate. Personally, I suspect that the authors want to subtly discourage the use of statically-wrapped text in general, in favor of dynamic wrapping (with one newline per paragraph).
Comment 6 Jerome Quelin 2006-05-04 17:48:05 UTC
regarding comment 4: you speak about counter-productive?
in my post, i:
- spotted a duplicated bug,
- help describing the rfe with an analogy to vim,
- tell that this would be a nice feature (yes, i also voted for this bug).

this is a rfe. read: "request for enhancement". i'm not saying: "kate is bullshit, it can't do X". no, i'm saying: "there is a nice feature out there, check it here, what do you think about adding it to kate".

sorry if that bothers you. enough feeding the troll, i won't explain myself any further. period.
Comment 7 Dominik Haumann 2007-01-08 11:20:05 UTC
This is a perfect candidate for a jscript.
- go up until empty line
- join lines repeatedly until next empty line
Comment 8 Dominik Haumann 2011-07-11 20:06:31 UTC
This can now be very easily implemented by using our scripting api, and you can even bind shortcuts to it:
http://docs.kde.org/stable/en/kdesdk/kate/advanced-editing-tools-scripting.html

It would be nice, if anyone of you volunteer to implement it!
Comment 9 Dominik Haumann 2011-07-11 20:08:19 UTC
*** Bug 93398 has been marked as a duplicate of this bug. ***
Comment 10 Christoph Cullmann 2012-10-28 21:48:14 UTC
Kate is extensible via javascript now, if you want such a feature, please send in some script we can bundle.
See http://kate-editor.org/2009/10/29/extending-kate-with-scripts/ for documentation about scripting.