Bug 186698 - ctrl+k doesn't delete the line anymore
Summary: ctrl+k doesn't delete the line anymore
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: composer (show other bugs)
Version: SVN trunk (KDE 4)
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: triaged
: 186082 197889 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-03-09 20:27 UTC by Salvo "LtWorf" Tomaselli
Modified: 2010-08-16 21:47 UTC (History)
8 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 Salvo "LtWorf" Tomaselli 2009-03-09 20:27:35 UTC
Version:           1.11.1 (using 4.2.1 (KDE 4.2.1), Debian packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.29-rc6-sidux-686

ctrl+k deletes only the content of the line, not the line itself, so the number of lines is still the same and i have to use another key to delete the \n.

I've tried in kate and ctrl+k behaves as expected.
Comment 1 José Manuel Santamaría Lema 2009-03-15 18:47:37 UTC
I can reproduce it with kmail 1.11.1, KDE 4.2.1 installed from debian
experimental packages too:
$ apt-show-versions kdepim
kdepim/experimental uptodate 4:4.2.1-1

I just click on "new message button" and typed some lines. Then, I press crtl+k, what kmail's editor do is 1 or 2:

1. If no text selected removes the text between the cursor and the end of the line, but not the line itself.

2. Deletes selected text.
Comment 2 Jaime Torres 2009-03-18 13:18:40 UTC
Confirmed in svn trunk r939757.
Comment 3 Lars Behrens 2009-06-25 21:47:01 UTC
Confirmed in 1.11.2, Debian Squeeze, KDE 4.2.2
Please give me back my ctrl+k
Comment 4 Thomas McGuire 2009-06-26 00:10:15 UTC
*** Bug 197889 has been marked as a duplicate of this bug. ***
Comment 5 Thomas McGuire 2009-06-26 00:12:18 UTC
SVN commit 987367 by tmcguire:

Add an action to delete a line and make Ctrl+K the default shortcut, like in Kate.
This overrides Qt's own QKeySequence::DeleteEndOfLine.
BUG: 186698


 M  +56 -0     tests/textedittest.cpp  
 M  +2 -0      tests/textedittest.h  
 M  +60 -1     textedit.cpp  
 M  +8 -0      textedit.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=987367
Comment 6 Lars Behrens 2009-06-26 01:27:18 UTC
How do I add an action?

And why is that bug considered fixed? I mean, no offense, but requiring users to act upon s.th. which is not provided by the application anymore doesn't seem to be a propper solution to me. Why can't kmail "add the action"?
Comment 7 Marc Mutz 2009-06-26 06:44:01 UTC
Please confirm that behaviour changed in KDE 4.2 from a previous version. CTRL-K is delete-to-end-of-line, not delete-line. In addition, it adds the deleted content to the kill buffer, so a CTRL-Y pastes it back. This has been the case since before KDE was born. To delete a line, just press CTRL-K twice. This is a well-established standard, I use this shortcut more often than cut&paste, and KMail would do good to not break it. If anything, it's Kate that needs fixing.
Comment 8 Marc Mutz 2009-06-26 06:52:06 UTC
CTRL-K from Qt behaves as is standard (try any lineedit in any Unix application except OOo), so this is not a bug, but a wishlist item.

On top of that, it's one we should reject, for the following reason:
Fact: CTRL-K is delete-to-eol in all line edits in all of Unix and in many multi-line text edits, too.
Changing the behaviour in just one widget makes that widget inconsistent with the rest of KDE (and Unix).
Consistency across a vast majority of text entry fields is more important than compatibility with a single app's shortcuts, even if said app happens to be a KDE one.
Comment 9 Salvo "LtWorf" Tomaselli 2009-06-26 08:59:11 UTC
Standard?
I've tried "nano" and it behaves exactly like kate. "Vim" and "joe" didn't recognize the shortcut.
What kind of standard are you talking about? One app makes a standard for you?
Comment 10 Thomas McGuire 2009-06-26 11:03:07 UTC
> How do I add an action?

It is done automatically, you don't need to do anything at all.

@Marc
The shortcut is configurable, you can set that to something different. I actually use Ctrl+K a lot in KWrite/Kate, so I added that to KMail/KNode.

I'll ask the Kate guys if they change their shortcut to something else.
Comment 11 Lars Behrens 2009-06-26 22:35:06 UTC
(In reply to comment #7)
> Please confirm that behaviour changed in KDE 4.2 from a previous version.
> CTRL-K is delete-to-end-of-line, not delete-line. In addition, it adds the
> deleted content to the kill buffer, so a CTRL-Y pastes it back. 

Are we living in the same universe? :-) As a  long time emacs user I wish it would, but ctrl + y doesn't and didn't ever work out of the box in any of the kmail versions I ever used, kmail always used the windows-world ctrl + v

> This has been
> the case since before KDE was born. To delete a line, just press CTRL-K twice.

But that is what does not work, it only deletes till the end of line, it obviously doesn't delete '\n' because the cursor stays in the actual line forever no matter how often I press ctrl + k.

> This is a well-established standard, I use this shortcut more often than
> cut&paste, and KMail would do good to not break it. 

Fully ack.

> If anything, it's Kate that
> needs fixing.

???
Comment 12 Lars Behrens 2009-06-26 22:47:08 UTC
(In reply to comment #10)
> > How do I add an action?
> 
> It is done automatically, you don't need to do anything at all.

??
I'm afraid I don't understand what you are talking about.

> @Marc
> The shortcut is configurable, you can set that to something different. I
> actually use Ctrl+K a lot in KWrite/Kate, so I added that to KMail/KNode.

But how do you do that? I can't find a way in kmail

> I'll ask the Kate guys if they change their shortcut to something else.

Why should they? in Kate it behaves as it should, like e.g in emacs.
Comment 13 Jari Laamanen 2009-11-07 15:56:57 UTC
I use KMail Version 1.12.3, from KDE 4.3.3 and I still can't change the ctrl-K keybinding to anything, i.e., it is not configurable. It behaves like kill-end-of-line but does not remove the newline character, no matter how many times I hit the combination. I would prefer the emacs type behavior, where 1st hit deletes until the end of the line, next would delete the newline char.

The KMail "configure scortcuts" option does not give a chance to configure any delete-(end-of-)line etc. type commands. (In Kate there is an option to change delete-line shortcut.)

Btw., in the old days (maybe also now) Pico used ctrl-k to delete a line, so a large number of Pine users were definitely accustomed to use that binding to get rid of a line. I also don't find the ctrl-k binding not to delete the newline char any standard. In fact, I see this behavior only in KMail's composer.

I wonder why this is a wishlist item. I face this every time I write an email, which can be several times per day. Every time I want to kill a line I have to hit ctrl-K AND move my hand to press the delete key or select a textblock with mouse. I haven't found a combination that would perform the full delete-line in todays KMail composer. It's sad.
Comment 14 Salvo "LtWorf" Tomaselli 2009-11-07 19:10:51 UTC
We better edit our emails with vim :-D
Comment 15 Björn Ruberg 2010-02-15 02:14:25 UTC
You know that you can indeed use an external editor with kmail?
Comment 16 Salvo "LtWorf" Tomaselli 2010-02-15 07:48:56 UTC
That is not a reason for not fixing a bug!
Comment 17 Björn Ruberg 2010-02-15 10:49:15 UTC
I didn't say that. You self wrote joikingly, that you should write your mails with vim - and I tell you that that is actually possible as a workaround.
Comment 18 FiNeX 2010-08-16 21:42:41 UTC
*** Bug 186082 has been marked as a duplicate of this bug. ***
Comment 19 FiNeX 2010-08-16 21:47:34 UTC
I've just tried CTRL+K on Kmail 1.13.5 (KDE 4.4.5).

It deletes the entire line WITH \n too (and this could be sufficient to close the bug which asks exactly this).


Kmail behaves like kate/kwrite but NOT like konqueror textboxes/lineedit, konsole (bash). Probably a "default" should be decided and used in all the programs.


If someone wants to change kate/kmail behaviour of CTRL+K, a new report should be opened.

Thanks all for the collaboration!