all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Universal Prefix Argument using M-1..9 and C-1..9
@ 2020-11-02 19:32 jai-bholeki via Users list for the GNU Emacs text editor
  2020-11-02 19:39 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: jai-bholeki via Users list for the GNU Emacs text editor @ 2020-11-02 19:32 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

I am going through the documentation regarding the Universal Prefix Argument.

For instance, one can quickly set a prefix using M-1 to M-9 which call 'digit-argument'.
One can also use C-1 to C-9, which also call 'digit-argument'. That is, C-0, C-1, etc. act the same as M-0, M-1, etc.

I am writing a software that could use C-1, C-2, and C-3 but I have now started having reservations on whether it is a good idea. How often do people use M-1..9 and C-1..9
to set the Universal Prefix Argument?

A related question is why Emacs uses different keybindings (e.g. M-1..9 and C-1..9)
to do exactly the same thing, with the repercussion that users have less availability
to set keybindings themselves without affecting other users using their software
to conflict from Emacs Built-In Key Shortcuts.

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

* Re: Universal Prefix Argument using M-1..9 and C-1..9
  2020-11-02 19:32 Universal Prefix Argument using M-1..9 and C-1..9 jai-bholeki via Users list for the GNU Emacs text editor
@ 2020-11-02 19:39 ` Eli Zaretskii
  2020-11-02 20:01   ` jai-bholeki
  2020-11-02 21:01   ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Eli Zaretskii @ 2020-11-02 19:39 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 02 Nov 2020 19:32:41 +0000
> From: jai-bholeki via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
> 
> A related question is why Emacs uses different keybindings (e.g. M-1..9 and C-1..9)
> to do exactly the same thing

Because, depending on the command to which you want to give an
argument, it can be very convenient.  For example, if the command is
C-f, it is much easier to type "C-8 C-f" than "M-8 C-f", because for
the former you can press and hold Ctrl, then type 8 followed by f.  By
contrast, if the command you need to type is M-f, it is easier to type
"M-8 M-f", for the same reasons.



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

* Re: Universal Prefix Argument using M-1..9 and C-1..9
  2020-11-02 19:39 ` Eli Zaretskii
@ 2020-11-02 20:01   ` jai-bholeki
  2020-11-02 21:01   ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: jai-bholeki @ 2020-11-02 20:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs@gnu.org

That's a good enough argument not to mess those keybindings.  Would it be
possible for the maintainers to write a section for Users and Designers
of Elisp Software on the KeyBindings which absolutely they should not mess
with if they intend to release their Elisp Software.  Have no doubt it would
be an extremely helpful section.



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, 2 November 2020 20:39, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Mon, 02 Nov 2020 19:32:41 +0000
> > From: jai-bholeki via Users list for the GNU Emacs text editor help-gnu-emacs@gnu.org
> > A related question is why Emacs uses different keybindings (e.g. M-1..9 and C-1..9)
> > to do exactly the same thing
>
> Because, depending on the command to which you want to give an
> argument, it can be very convenient. For example, if the command is
> C-f, it is much easier to type "C-8 C-f" than "M-8 C-f", because for
> the former you can press and hold Ctrl, then type 8 followed by f. By
> contrast, if the command you need to type is M-f, it is easier to type
> "M-8 M-f", for the same reasons.





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

* Re: Universal Prefix Argument using M-1..9 and C-1..9
  2020-11-02 19:39 ` Eli Zaretskii
  2020-11-02 20:01   ` jai-bholeki
@ 2020-11-02 21:01   ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2020-11-02 21:01 UTC (permalink / raw)
  To: help-gnu-emacs

jai-bholeki wrote:
>> A related question is why Emacs uses different keybindings
>> (e.g. M-1..9 and C-1..9) to do exactly the same thing
>> with the repercussion that users have less availability to set
>> keybindings themselves without affecting other users using their
>> software to conflict from Emacs Built-In Key Shortcuts.

Actually, users can freely bind `C-<digit>` or `M-<digit>` to anything else
they like and it probably won't conflict with anything.

Personally, I use such numerical prefixes rarely enough that I find `C-u
<number>` sufficient.

Eli wrote:
> Because, depending on the command to which you want to give an
> argument, it can be very convenient.  For example, if the command is
> C-f, it is much easier to type "C-8 C-f" than "M-8 C-f", because for
> the former you can press and hold Ctrl, then type 8 followed by f.  By
> contrast, if the command you need to type is M-f, it is easier to type
> "M-8 M-f", for the same reasons.

Also, in text terminals, `C-<digit>` usually sends "unrelated"
byte-sequences, so it can't be used for a numerical prefix.


        Stefan




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

end of thread, other threads:[~2020-11-02 21:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-02 19:32 Universal Prefix Argument using M-1..9 and C-1..9 jai-bholeki via Users list for the GNU Emacs text editor
2020-11-02 19:39 ` Eli Zaretskii
2020-11-02 20:01   ` jai-bholeki
2020-11-02 21:01   ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.