unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#66386: 28.2; RFE: Provide global key bindings for increasing/decreasing numbers at point
@ 2023-10-07 10:57 Tim Landscheidt
  2023-10-07 11:03 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Landscheidt @ 2023-10-07 10:57 UTC (permalink / raw)
  To: 66386

Package: emacs
Version: 28.2
Severity: wishlist

When entering a number with read-number or skeleton-read or
just editing text, it can be very useful to increase/de-
crease the number at point.  For Org, Emacs ships the func-
tions org-increase-number-at-point and
org-decrease-number-at-point for this purpose and binds them
to C-M-S-<right> and C-M-S-<left>, respectively, in
org-mode-map.

It would be nice if these functions or some variant could be
bound to global key bindings that are active by default in
all modes.





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

* bug#66386: 28.2; RFE: Provide global key bindings for increasing/decreasing numbers at point
  2023-10-07 10:57 bug#66386: 28.2; RFE: Provide global key bindings for increasing/decreasing numbers at point Tim Landscheidt
@ 2023-10-07 11:03 ` Eli Zaretskii
  2023-10-07 14:28   ` Tim Landscheidt
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2023-10-07 11:03 UTC (permalink / raw)
  To: Tim Landscheidt; +Cc: 66386

> From: Tim Landscheidt <tim@tim-landscheidt.de>
> Date: Sat, 07 Oct 2023 10:57:34 +0000
> 
> Package: emacs
> Version: 28.2
> Severity: wishlist
> 
> When entering a number with read-number or skeleton-read or
> just editing text, it can be very useful to increase/de-
> crease the number at point.  For Org, Emacs ships the func-
> tions org-increase-number-at-point and
> org-decrease-number-at-point for this purpose and binds them
> to C-M-S-<right> and C-M-S-<left>, respectively, in
> org-mode-map.
> 
> It would be nice if these functions or some variant could be
> bound to global key bindings that are active by default in
> all modes.

These are trivial functions that everyone who needs them can easily
code, and bind to any keys they want.  For example, I'd prefer to bind
them to S-<kp-add> and S-<kp-subtract> instead.  Is it really
justified to have these in Emacs by default, let alone usurp some
global key bindings for them?  Why not keep them available only in
modes where they are really needed?





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

* bug#66386: 28.2; RFE: Provide global key bindings for increasing/decreasing numbers at point
  2023-10-07 11:03 ` Eli Zaretskii
@ 2023-10-07 14:28   ` Tim Landscheidt
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Landscheidt @ 2023-10-07 14:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66386

Eli Zaretskii <eliz@gnu.org> wrote:

>> When entering a number with read-number or skeleton-read or
>> just editing text, it can be very useful to increase/de-
>> crease the number at point.  For Org, Emacs ships the func-
>> tions org-increase-number-at-point and
>> org-decrease-number-at-point for this purpose and binds them
>> to C-M-S-<right> and C-M-S-<left>, respectively, in
>> org-mode-map.

>> It would be nice if these functions or some variant could be
>> bound to global key bindings that are active by default in
>> all modes.

> These are trivial functions that everyone who needs them can easily
> code, and bind to any keys they want.  For example, I'd prefer to bind
> them to S-<kp-add> and S-<kp-subtract> instead.  Is it really
> justified to have these in Emacs by default, let alone usurp some
> global key bindings for them?  Why not keep them available only in
> modes where they are really needed?

For me, part of the charm of Emacs is that some concepts are
"universal".  For example, forward-sexp (C-M-<right>) will
move forward one "balanced expression" in an Emacs Lisp buf-
fer, and it will do so in a Python buffer as well.  I do not
have to learn different key bindings (or look them up) be-
cause a "balanced expression" is something that exists in
many/most modes.

I probably would have missed that the Python mode had such a
function if I had not known it from Emacs Lisp mode and just
intuitively used it.  I would neither have written and main-
tained some code to add this functionality just for Python
mode.

The same reasoning applies to the concept of "numbers": They
exist in many/most modes, writing personal code is a dupli-
cation of effort, and I had never realized that org-mode
provides such functions because I have never had the need to
increase/decrease numbers in Org buffers, but instead at
prompts and in (other) programming languages.





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

end of thread, other threads:[~2023-10-07 14:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-07 10:57 bug#66386: 28.2; RFE: Provide global key bindings for increasing/decreasing numbers at point Tim Landscheidt
2023-10-07 11:03 ` Eli Zaretskii
2023-10-07 14:28   ` Tim Landscheidt

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