unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alexander Shukaev <emacs@Alexander.Shukaev.name>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 25189@debbugs.gnu.org
Subject: bug#25189: Use `current-global-map' in `comint-insert-input'
Date: Thu, 26 Dec 2019 01:32:00 +0100	[thread overview]
Message-ID: <51389711-b5b8-0d62-b18b-beae57d61bca@Alexander.Shukaev.name> (raw)
In-Reply-To: <874kxo3x08.fsf@gnus.org>

On 12/25/19 10:39 PM, Lars Ingebrigtsen wrote:
> Alexander Shukaev <emacs@Alexander.Shukaev.name> writes:
> 
>>> The value is a keymap that is usually (but not necessarily) Emacs’s
>>> global map.
>>
>> So it's not necessarily the current global keymap.  Hence, applying
>> `define-key' (or any other mutating function to it), may not take any
>> effect and do what is expected.  It is safer to always use
>> `current-global-map'.  At least that is my understanding why there are
>> special functions like `current-global-map' for accessing and
>> `use-global-map' for assignment.
> 
> I'm unable to read any such thing from the documentation (or usage) of
> those functions.  A handful of places use use-global-map to alter what
> global map is in usage, and I see no indication that functions like
> comint-insert-input would want to alter these other maps instead of
> (the real) global-map.
> 

There is no "real" global map.  There is only one current global map, 
any that can be chosen by user at any point in time.  Emacs is 
inconsistent in how it uses either `global-map' or 
`(current-global-map)' to assign key bindings.  I would guess this is 
due to historical reasons of `current-global-map' appearing later than 
`global-map'.  This is more of a call to review the Emacs code base 
and/or documentation with respect to this inconsistency in order to 
decide what is the conventional/consistent approach to bind keys to a 
global map as both have advantages and disadvantages.





      reply	other threads:[~2019-12-26  0:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13  0:36 bug#25189: Use `current-global-map' in `comint-insert-input' Alexander Shukaev
2019-07-27 11:29 ` Lars Ingebrigtsen
2019-12-16  1:58   ` Alexander Shukaev
     [not found]   ` <45ae521c-6f37-292e-c169-9ed591cb0504@Alexander.Shukaev.name>
2019-12-24 16:25     ` Lars Ingebrigtsen
2019-12-25  9:59       ` Alexander Shukaev
2019-12-25 21:39         ` Lars Ingebrigtsen
2019-12-26  0:32           ` Alexander Shukaev [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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=51389711-b5b8-0d62-b18b-beae57d61bca@Alexander.Shukaev.name \
    --to=emacs@alexander.shukaev.name \
    --cc=25189@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).