Subject: bug#16109: closed (Re: bug#16109: 24.3.50; <kp-delete> doesn't delete region in delete-selection-mode)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 11 Dec 2013 14:24:03 +0000

Your bug report

#16109: 24.3.50; <kp-delete> doesn't delete region in delete-selection-mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
16109: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16109
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#16109: 24.3.50; <kp-delete> doesn't delete region in delete-selection-mode
From: Stefan Monnier <[email-masked]>
To: Andreas Schwab <[email-masked]>
Cc: Juri Linkov <[email-masked]>, [email-masked]
Date: Wed, 11 Dec 2013 09:23:32 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

>> 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

Subject: 24.3.50; <kp-delete> doesn't delete region in delete-selection-mode
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Wed, 11 Dec 2013 03:28:57 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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.