Ihor Radchenko <[email protected]> writes:

Morgan Smith <[email protected]> writes:

Ihor Radchenko <[email protected]> writes:
I think the right fix is changing `org-scroll'

Adding support for the key 'backspace in `org-scroll' would be very easy to do but I wonder if it's actually correct. ...

We already do something similar in `org-export--dispatch-action' and nobody complains.


I mean this bug report is someone complaining about `org-export--dispatch-action'. We are talking about adjusting `org-scroll' to fix `org-export--dispatch-action'.

Backspace seems to correspond the ASCII escape ?\b which also corresponds to "C-h". I wonder if there is the possibility of a user trying to send "C-h" for help but we interpret it as DEL.

The docstring of "read-event" seems to imply it's a pretty low level function and that we should consider using "read-key" instead as that decodes events using "input-decode-map".

I can't quite follow the logic but I think using "read-key" would respect user settings like "normal-erase-is-backspace" whereas "read-event" would not.

On my system running the following and then hitting my backspace key results in the following:

(read-event "blah:") => backspace

(read-key "blah:") => 127

So at least on my system, switching from "read-event" to "read-key" would fix this.

AFAIK, read-key will intercept even more:

Also in contrast to read-event, input method text conversion will be disabled while the key sequence is read, so that character input events will always be generated for keyboard input.

I honestly have no idea how those functions will differ. I've tried to dig into input method stuff a few times over the years and I always leave with more questions then answers.

Maybe I'm overthinking this. IDK. What do you think?

I think we can follow the existing patterns. If those turn out to be problematic, we change them everywhere. Before that, we should aim for more consistent handling of menus across Org.

`org-clock-resolve` uses 'read-char-exclusive' and has no way of scrolling the buffer

`org-sparse-tree` uses `read-char-exclusive` and doesn't have a buffer to scroll

`org-agenda' uses `read-char-exclusive` and doesn't allow scrolling with DEL or SPC

`org-attach` uses `read-char-exclusive` and suffers from the same bug we are currently solving (it sets ADDITIONAL-KEYS as t but never gives org-scroll those keys)

`org--mks-read-key` uses `read-char-exclusive` and doesn't allow scrolling with DEL or SPC

If we follow existing patterns then we would use `read-char-exclusive` and not allow scrolling using DEL or SPC.

Now `read-char-exclusive` is probably not a good solution as it eats `mouse-up`.

So I think what I've learned from this exercise is there are no existing patterns in our menus and they kind of suck (no mouse-up support).

Do you want me to just push the attached patch, close this issue, and walk away? That's what I'm leaning towards.

>From 306d10c2259e55b35d023ea5fbc8398bac78def8 Mon Sep 17 00:00:00 2001
From: Morgan Smith <[email protected]>
Date: Tue, 13 Oct 2026 15:26:52 -0400
Subject: [PATCH] org-export--dispatch-action: Treat backspace as DEL

* lisp/ox.el (org-export--dispatch-action): Treat a 'backspace' event
as DEL for the purpose of scrolling the dispatch-ui.

Reported-by: cpj <[email protected]>
Link: https://list.orgmode.org/[email protected]
---
 lisp/ox.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ox.el b/lisp/ox.el
index 16b021b26..d3df029c1 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -7531,6 +7531,7 @@ org-export--dispatch-action
                              `(double-wheel-down . ,_)
                              `(triple-wheel-down . ,_))
                          ?\C-n)
+                        ('backspace ?\d)
                         (event event)))
 		(not expertp)
 		;; FIXME: Don't use C-v (22) here, as it is used as a
-- 
2.54.0

Reply via email to