GNU bug report logs - #16109
24.3.50; <kp-delete> doesn't delete region in delete-selection-mode

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Wed, 11 Dec 2013 01:33:01 UTC

Severity: normal

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16109 in the body.
You can then email your comments to 16109 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#16109; Package emacs. (Wed, 11 Dec 2013 01:33:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 11 Dec 2013 01:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; <kp-delete> doesn't delete region in delete-selection-mode
Date: Wed, 11 Dec 2013 03:28:57 +0200
In delete-selection-mode, <delete> deletes the region, but
its keypad counterpart <kp-delete> doesn't delete the region.

This is what `C-h k <delete>' displays:

    <deletechar> (translated from <delete>) runs the command
    delete-forward-char, which is an interactive compiled Lisp function in
    `simple.el'.

And this is displayed by `C-h k <kp-delete>':

    C-d (translated from <kp-delete>) runs the command
    delete-char, which is an interactive built-in function in
    `cmds.c'.

What could be done:

1. Change `delete-char' to delete the active region (might need a poll
since I recall some disagreements about this default).

2. Bind <kp-delete> to the same command `delete-forward-char'
as for <delete>.

3. Add `delete-char' back to delsel.el since typing `C-d' is handy
anyway to delete the region.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16109; Package emacs. (Wed, 11 Dec 2013 05:00:03 GMT) Full text and rfc822 format available.

Message #8 received at 16109 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Juri Linkov <juri <at> jurta.org>
Cc: 16109 <at> debbugs.gnu.org
Subject: Re: bug#16109: 24.3.50;
 <kp-delete> doesn't delete region in delete-selection-mode
Date: Tue, 10 Dec 2013 23:58:57 -0500
> What could be done:

> 1. Change `delete-char' to delete the active region (might need a poll
> since I recall some disagreements about this default).

> 2. Bind <kp-delete> to the same command `delete-forward-char'
> as for <delete>.

> 3. Add `delete-char' back to delsel.el since typing `C-d' is handy
> anyway to delete the region.

Shouldn't `kp-delete' be remapped to `delete'?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16109; Package emacs. (Wed, 11 Dec 2013 08:50:02 GMT) Full text and rfc822 format available.

Message #11 received at 16109 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> suse.de>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Juri Linkov <juri <at> jurta.org>, 16109 <at> debbugs.gnu.org
Subject: Re: bug#16109: 24.3.50;
 <kp-delete> doesn't delete region in delete-selection-mode
Date: Wed, 11 Dec 2013 09:49:18 +0100
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

> Shouldn't `kp-delete' be remapped to `delete'?

It is mapped to ?\C-d in local-function-key-map (if
normal-erase-is-backspace).

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Reply sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
You have taken responsibility. (Wed, 11 Dec 2013 14:24:01 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> jurta.org>:
bug acknowledged by developer. (Wed, 11 Dec 2013 14:24:03 GMT) Full text and rfc822 format available.

Message #16 received at 16109-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Andreas Schwab <schwab <at> suse.de>
Cc: Juri Linkov <juri <at> jurta.org>, 16109-done <at> debbugs.gnu.org
Subject: Re: bug#16109: 24.3.50;
 <kp-delete> doesn't delete region in delete-selection-mode
Date: Wed, 11 Dec 2013 09:23:32 -0500
>> Shouldn't `kp-delete' be remapped to `delete'?
> It is mapped to ?\C-d in local-function-key-map (if
> normal-erase-is-backspace).

Oh, right, now I remember: we don't apply function-key-map repeatedly so
if we have a remapping from kp-delete to delete, it's not combined with
the mapping from delete to deletechar.

I installed the patch below instead which should fix the problem.


        Stefan


--- lisp/simple.el	2013-12-03 01:19:24 +0000
+++ lisp/simple.el	2013-12-11 14:20:27 +0000
@@ -7435,7 +7435,7 @@
 	     (if enabled
 		 (progn
 		   (define-key local-function-key-map [delete] [deletechar])
-		   (define-key local-function-key-map [kp-delete] [?\C-d])
+		   (define-key local-function-key-map [kp-delete] [deletechar])
 		   (define-key local-function-key-map [backspace] [?\C-?])
                    (dolist (b bindings)
                      ;; Not sure if input-decode-map is really right, but





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16109; Package emacs. (Thu, 12 Dec 2013 00:15:02 GMT) Full text and rfc822 format available.

Message #19 received at 16109 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 16109 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> suse.de>
Subject: Re: bug#16109: 24.3.50;
 <kp-delete> doesn't delete region in delete-selection-mode
Date: Thu, 12 Dec 2013 02:07:35 +0200
>>> Shouldn't `kp-delete' be remapped to `delete'?
>> It is mapped to ?\C-d in local-function-key-map (if
>> normal-erase-is-backspace).
>
> Oh, right, now I remember: we don't apply function-key-map repeatedly so
> if we have a remapping from kp-delete to delete, it's not combined with
> the mapping from delete to deletechar.

Thanks.  I discovered another case: in delete-selection-mode it's handy
to select the region of unnecessary shell output and delete with <delete>
(without putting to the kill ring).  But now neither <delete> nor <kp-delete>
delete the active region in shell.  comint.el has these lines:

    ;; The following two are standardly aliased to C-d,
    ;; but they should never do EOF, just delete.
    (define-key map [delete] 	  'delete-char)
    (define-key map [kp-delete]	  'delete-char)

It seems `delete-char' needs to be replaced with `delete-forward-char'
like in their global bindings?  The comment is also wrong because
globally [delete] and [kp-delete] are not aliased to C-d now.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16109; Package emacs. (Thu, 12 Dec 2013 18:32:01 GMT) Full text and rfc822 format available.

Message #22 received at 16109 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Juri Linkov <juri <at> jurta.org>
Cc: 16109 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> suse.de>
Subject: Re: bug#16109: 24.3.50;
 <kp-delete> doesn't delete region in delete-selection-mode
Date: Thu, 12 Dec 2013 13:31:15 -0500
>     ;; The following two are standardly aliased to C-d,
>     ;; but they should never do EOF, just delete.
>     (define-key map [delete] 	  'delete-char)
>     (define-key map [kp-delete]	  'delete-char)

> It seems `delete-char' needs to be replaced with `delete-forward-char'
> like in their global bindings?

Indeed.


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 10 Jan 2014 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 129 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.