unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* proposal: bind C-x r DEL to #'delete-rectangle
@ 2016-10-06  5:02 Zachary Kanfer
  2016-10-06 16:18 ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Zachary Kanfer @ 2016-10-06  5:02 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

Rectangle bindings are off `C-x r`. Currently, #'delete-rectangle can
be ran with `C-x r d`. I think it's intuitive to bind `C-x r DEL` to
#'delete-rectangle also. This patch does not touch `C-x r d`; that
keybinding still calls #'delete-rectangle.

[-- Attachment #2: 0001-Make-C-x-r-DEL-call-delete-rectangle.patch --]
[-- Type: text/x-patch, Size: 746 bytes --]

From fada67a7640c4a0d015bdbd1b3b39a64286dfc69 Mon Sep 17 00:00:00 2001
From: Zachary Kanfer <zkanfer@gmail.com>
Date: Wed, 5 Oct 2016 00:15:34 -0400
Subject: [PATCH] Make C-x r DEL call #'delete-rectangle

---
 lisp/bindings.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/bindings.el b/lisp/bindings.el
index c13f4b1..3f87945 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1212,6 +1212,7 @@ ctl-x-r-map
     (define-key map "c" 'clear-rectangle)
     (define-key map "k" 'kill-rectangle)
     (define-key map "d" 'delete-rectangle)
+    (define-key map [backspace] 'delete-rectangle)
     (define-key map "y" 'yank-rectangle)
     (define-key map "o" 'open-rectangle)
     (define-key map "t" 'string-rectangle)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: proposal: bind C-x r DEL to #'delete-rectangle
  2016-10-06  5:02 proposal: bind C-x r DEL to #'delete-rectangle Zachary Kanfer
@ 2016-10-06 16:18 ` Drew Adams
  2016-10-10  4:20   ` Zachary Kanfer
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2016-10-06 16:18 UTC (permalink / raw)
  To: Zachary Kanfer, emacs-devel

> Rectangle bindings are off `C-x r`. Currently, #'delete-rectangle can
> be ran with `C-x r d`. I think it's intuitive to bind `C-x r DEL` to
> #'delete-rectangle also. This patch does not touch `C-x r d`; that
> keybinding still calls #'delete-rectangle.

I'd say no.  `C-x r' has a mix of different kinds of commands
(bookmarks, registers, rectangles), and it has had such a mix
since about forever.  `C-x r' is not the place to be defining
alternative keys for the same command, IMHO.

(It's bad enough that we have three keys for `point-to-register'.
But those alternative `point-to-register' keys have been there
since at least Emacs 20.)

This is what `C-x r C-h' shows:

C-x r C-@	point-to-register
C-x r ESC	Prefix Command
C-x r SPC	point-to-register
C-x r +		increment-register
C-x r M		bookmark-set-no-overwrite
C-x r N		rectangle-number-lines
C-x r b		bookmark-jump
C-x r c		clear-rectangle
C-x r d		delete-rectangle
C-x r f		frameset-to-register
C-x r g		insert-register
C-x r i		insert-register
C-x r j		jump-to-register
C-x r k		kill-rectangle
C-x r l		bookmark-bmenu-list
C-x r m		bookmark-set
C-x r n		number-to-register
C-x r o		open-rectangle
C-x r r		copy-rectangle-to-register
C-x r s		copy-to-register
C-x r t		string-rectangle
C-x r w		window-configuration-to-register
C-x r x		copy-to-register
C-x r y		yank-rectangle
C-x r C-SPC	point-to-register
C-x r M-w	copy-rectangle-as-kill



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: proposal: bind C-x r DEL to #'delete-rectangle
  2016-10-06 16:18 ` Drew Adams
@ 2016-10-10  4:20   ` Zachary Kanfer
  2016-10-10  5:03     ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Zachary Kanfer @ 2016-10-10  4:20 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel

Well, fair enough. I'll just keep it in my init file, then.

On Thu, Oct 6, 2016 at 12:18 PM, Drew Adams <drew.adams@oracle.com> wrote:
>> Rectangle bindings are off `C-x r`. Currently, #'delete-rectangle can
>> be ran with `C-x r d`. I think it's intuitive to bind `C-x r DEL` to
>> #'delete-rectangle also. This patch does not touch `C-x r d`; that
>> keybinding still calls #'delete-rectangle.
>
> I'd say no.  `C-x r' has a mix of different kinds of commands
> (bookmarks, registers, rectangles), and it has had such a mix
> since about forever.  `C-x r' is not the place to be defining
> alternative keys for the same command, IMHO.
>
> (It's bad enough that we have three keys for `point-to-register'.
> But those alternative `point-to-register' keys have been there
> since at least Emacs 20.)
>
> This is what `C-x r C-h' shows:
>
> C-x r C-@       point-to-register
> C-x r ESC       Prefix Command
> C-x r SPC       point-to-register
> C-x r +         increment-register
> C-x r M         bookmark-set-no-overwrite
> C-x r N         rectangle-number-lines
> C-x r b         bookmark-jump
> C-x r c         clear-rectangle
> C-x r d         delete-rectangle
> C-x r f         frameset-to-register
> C-x r g         insert-register
> C-x r i         insert-register
> C-x r j         jump-to-register
> C-x r k         kill-rectangle
> C-x r l         bookmark-bmenu-list
> C-x r m         bookmark-set
> C-x r n         number-to-register
> C-x r o         open-rectangle
> C-x r r         copy-rectangle-to-register
> C-x r s         copy-to-register
> C-x r t         string-rectangle
> C-x r w         window-configuration-to-register
> C-x r x         copy-to-register
> C-x r y         yank-rectangle
> C-x r C-SPC     point-to-register
> C-x r M-w       copy-rectangle-as-kill



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: proposal: bind C-x r DEL to #'delete-rectangle
  2016-10-10  4:20   ` Zachary Kanfer
@ 2016-10-10  5:03     ` Drew Adams
  2016-10-10  5:17       ` John Wiegley
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2016-10-10  5:03 UTC (permalink / raw)
  To: Zachary Kanfer; +Cc: emacs-devel

> >> Rectangle bindings are off `C-x r`. Currently, #'delete-rectangle can
> >> be ran with `C-x r d`. I think it's intuitive to bind `C-x r DEL` to
> >> #'delete-rectangle also. This patch does not touch `C-x r d`; that
> >> keybinding still calls #'delete-rectangle.
> >
> > I'd say no.  `C-x r' has a mix of different kinds of commands
> > (bookmarks, registers, rectangles), and it has had such a mix
> > since about forever.  `C-x r' is not the place to be defining
> > alternative keys for the same command, IMHO. ...
>
> Well, fair enough. I'll just keep it in my init file, then.

Just to be sure you know: I was giving my opinion - one opinion
only.  I don't speak for Emacs development, at all.  You need
not give up on your suggestion just because of my opinion. :-)
Sorry if my reply gave you an impression that your suggestion
was being shot down.

---

FWIW, I think it might be a good idea to split the key bindings
that are currently on prefix `C-x r'.  In my library Bookmark+,
I support the usual bookmark keys on `C-x r', but I also put
keymap `bookmark-map' on prefix key `C-x p', by default.

For example, these standard bookmark commands also have `C-x p'
bindings in Bookmark+, by default:

C-x p I         bookmark-insert-location
C-x p d         bookmark-delete
C-x p e         edit-bookmarks
C-x p g         bookmark-jump
C-x p l         bookmark-load
C-x p o         bookmark-jump-other-window
C-x p q         bookmark-jump-other-window
C-x p s         bookmark-save
C-x p w         bookmark-write
C-x p c M       bookmark-set

(By default, `C-x p c' is a prefix key for bookmark create/set
commands, and `C-x p t' is a prefix key for bookmark tagging
commands.)

Emacs could do reasonably do something similar.  And it could
similarly choose to move the register (alternatively, rectangle)
commands to a different prefix key from `C-x r'.  It really
makes little sense at this point (except for habit) to put
such different things on the same prefix key (IMO).



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: proposal: bind C-x r DEL to #'delete-rectangle
  2016-10-10  5:03     ` Drew Adams
@ 2016-10-10  5:17       ` John Wiegley
  0 siblings, 0 replies; 5+ messages in thread
From: John Wiegley @ 2016-10-10  5:17 UTC (permalink / raw)
  To: Drew Adams; +Cc: Zachary Kanfer, emacs-devel

>>>>> "DA" == Drew Adams <drew.adams@oracle.com> writes:

>> and it has had such a mix > since about forever. `C-x r' is not the place
>> to be defining alternative keys for the same command, IMHO. ...
>> 
>> Well, fair enough. I'll just keep it in my init file, then.

DA> Just to be sure you know: I was giving my opinion - one opinion only. I
DA> don't speak for Emacs development, at all. You need not give up on your
DA> suggestion just because of my opinion. :-) Sorry if my reply gave you an
DA> impression that your suggestion was being shot down.

Just to give Drew some support here, I agree with his sentiment. Since C-x r
is a pretty crowded keyspace, it's probably better not to add more bindings to
it without a more compelling reason than "we could". I've found C-x r d to be
a handy enough mnemonic for deleting rectangles. But I can understand how C-x
r DEL would be nice, so the fact that you can define this in .emacs is, I
believe, the right answer.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-10  5:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-06  5:02 proposal: bind C-x r DEL to #'delete-rectangle Zachary Kanfer
2016-10-06 16:18 ` Drew Adams
2016-10-10  4:20   ` Zachary Kanfer
2016-10-10  5:03     ` Drew Adams
2016-10-10  5:17       ` John Wiegley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).