emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: emacs-orgmode@gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Bug: org-mode-map binds tab [9.4.6 (9.4.6-gab9f2a @ /home/user/.config/emacs/elpa/org-9.4.6/)]
Date: Sun, 27 Jun 2021 17:37:50 +0200	[thread overview]
Message-ID: <aea40f57-7f38-0dcd-4d43-c8662bba2a6d@daniel-mendler.de> (raw)
In-Reply-To: <3209a500-8654-2508-3b1a-34a73edc0053@daniel-mendler.de>

`org-mode-map` binds `[tab]` which is unnecessary and harmful, since it
takes precendence over bindings of TAB even in keymaps with higher
precedence.

Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.5, cairo version 1.16.0)
 of 2021-02-09, modified by Debian
Package: Org mode version 9.4.6 (9.4.6-gab9f2a @
/home/user/.config/emacs/elpa/org-9.4.6/)

----

I've observed this problem with my GNU ELPA package Corfu, which
installs a keymap with higher precedence than org-mode. In order to
override Org, it also has to bind [tab], which is undesired.

On 6/27/21 11:11 AM, Daniel Mendler wrote:
> On 6/26/21 4:02 PM, Stefan Monnier wrote:
>>> +    (define-key map [tab] #'corfu-complete)
>>
>> Please avoid binding `tab`: the `tab` event (only generated under GUIs)
>> is supposed to be remapped to the TAB char-event (aka `C-i`) and this is
>> what you should bind to if you want your binding to work both under ttys
>> and GUIs.
>>
>> More importantly, if you bind to `tab` than this binding will take
>> precedence over all other bindings to TAB, even those in keymaps that
>> have higher precedence.
>>
>> The same holds for `return` vs RET, and `escape` vs ESC.
> 
> Hello Stefan,
> 
> I am aware of the unfortunate implications of these bindings.
> Originally I avoided these bindings for the exact reasons you mention
> and I hoped I could do without those (only binding RET/TAB and
> remappings). However I have to use these keys since Org-mode seems to
> override these keys too. Otherwise my keymap will not take precedence
> over the Org-mode keymap.
> 
> Daniel
> 


      parent reply	other threads:[~2021-07-01 10:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210626095705.11804.96621@vcs0.savannah.gnu.org>
     [not found] ` <20210626095707.B514720D0A@vcs0.savannah.gnu.org>
     [not found]   ` <jwvo8bspw03.fsf-monnier+emacs@gnu.org>
     [not found]     ` <3209a500-8654-2508-3b1a-34a73edc0053@daniel-mendler.de>
2021-06-27 15:34       ` org-mode-map binds [tab] Daniel Mendler
2021-07-01 10:17         ` Nicolas Goaziou
2021-07-09  1:39         ` Barton, Mark
2021-07-09  3:01           ` Stefan Monnier
2021-06-27 15:37       ` Daniel Mendler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aea40f57-7f38-0dcd-4d43-c8662bba2a6d@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --subject='Re: Bug: org-mode-map binds tab [9.4.6 (9.4.6-gab9f2a @ /home/user/.config/emacs/elpa/org-9.4.6/)]' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).