From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#33808: Date: Fri, 29 Mar 2019 11:56:08 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="226353"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 33808@debbugs.gnu.org To: Spenser Truex Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 29 16:57:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9tsW-000wmH-Ve for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Mar 2019 16:57:13 +0100 Original-Received: from localhost ([127.0.0.1]:56222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9tsW-0000cO-0G for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Mar 2019 11:57:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9tsN-0000b6-Pl for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 11:57:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9tsM-0005P8-KT for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 11:57:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50677) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h9tsM-0005Or-EO for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 11:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h9tsM-0004GU-3s for bug-gnu-emacs@gnu.org; Fri, 29 Mar 2019 11:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Mar 2019 15:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33808 X-GNU-PR-Package: emacs Original-Received: via spool by 33808-submit@debbugs.gnu.org id=B33808.155387498816350 (code B ref 33808); Fri, 29 Mar 2019 15:57:02 +0000 Original-Received: (at 33808) by debbugs.gnu.org; 29 Mar 2019 15:56:28 +0000 Original-Received: from localhost ([127.0.0.1]:35988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h9trn-0004Fe-KQ for submit@debbugs.gnu.org; Fri, 29 Mar 2019 11:56:27 -0400 Original-Received: from mail-ot1-f53.google.com ([209.85.210.53]:41488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h9trl-0004FR-9y for 33808@debbugs.gnu.org; Fri, 29 Mar 2019 11:56:25 -0400 Original-Received: by mail-ot1-f53.google.com with SMTP id 64so2445755otb.8 for <33808@debbugs.gnu.org>; Fri, 29 Mar 2019 08:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=/NDtj/3KYv1XqHoESbDC19lxrhSIHwWpAkSUi21QeTI=; b=IR71XvAyJJZxa9tRhQZFBIlkmYZCGKhRj0TOkv1+Htu58zeCaxGkDvzzqIDJr4XG4d /RNLPxNOncfJzbdeWzH+7DpDDiiBLl4p78ZdnDuWvlBOrjWUabnH0OfBtNrKz5rrfOYX ad99HwbSXVS80JPYlYlyENzPWXZMh5N484siBavag6HCZnCon1LjUTCg/osnL2JdeB07 kDQayDyjturZFWQYIjqWxdFP6/R3MobggC5b/Gy3JAXZDKwdQNHfI+G2sl//GtQG7wqX hkj3mQJJSxDPMKUF4714YS/EQSRPZiLAqAbIj0SY9jKqUSHBBHyb0H61C3qNerH7Knav 28ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=/NDtj/3KYv1XqHoESbDC19lxrhSIHwWpAkSUi21QeTI=; b=au9KJKIOJO2FhDfSbeQ8J8mD1bfiHXG1mEUP+UsZQhUHbmRuCwHlgFXcfVs2Z/EnEx PFSBTUlzt5aIpuWA1JkGwRMpDbcj03/mYWKEJ2vR00sV2stiQXYP4M44Meo5/hgaA6yS RC86EOzStd1ZbvtEscX2CGy+SwJsHpLEqlRdCNk8rw0SQidtCCYY0UnReDzj3Ttv1pOs Dowc00+1BSXvGBzed/9Or6E3uEQ+tgOWq2oCUvI1WMJMwqm6HmFodgQKXLcbuHCGpBwO e7Baxz4kV2vOga4jOQOoVZabcGFAroWDIZwOa1xpDmu1byeaBbELk/PYHyBJrRt2r/tE /HXA== X-Gm-Message-State: APjAAAWXATF6LC39AfyEraZi/pKKhKqPvIvwy9OaenLcEA5fqg6eKk3X 2KJugj3PVgl1idAr4Uqo0MTvsoqjnYYB91k3UxI= X-Google-Smtp-Source: APXvYqwxTSAvn5H0hxa8XEawanKmPVaU7jXY7IE/fWYDVdbae2ZQo+BPdVJ1ITajekq7+cZv11eHdwWn3+bjA52LrHk= X-Received: by 2002:a9d:3d03:: with SMTP id a3mr22498904otc.72.1553874978365; Fri, 29 Mar 2019 08:56:18 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156926 Archived-At: On Wed, 19 Dec 2018 at 19:39, Spenser Truex wrote: > >It isn't possible to bind keys to eshell-mode-map using define-keys like= this: > >(define-key eshell-mode-map (kbd "") 'other-window) > >instead a user must use an add-hook > >(add-hook 'eshell-mode-hook (lambda () (define-key eshell-mode-map (kbd = "") 'other-window) > >The cause of this can be seen in the patch: eshell-mode-map is set to ni= l initially "for the byte compiler," then made buffer local (amusingly comm= ented out with FIXME: What the hell?!). This patch resolves the issue and m= anages to byte compile. > > > >What is the benefit to setting it to nil initially with respect to the b= yte compiler? The comment above the defvar Also what is the benefit of sett= ing it locally when it is already defined globally? The new version byte co= mpiles okay, and the above test cases work. It's not quite enough, because eshell-mode defines some more keys, so settings like (define-key eshell-command-map [(control ?a)] 'my-eshell-bol) would still get overridden every time eshell starts. And there are additional key definitions in other eshell files. The definitions set up by eshell-command seem the most tricky to fix (probably requires splitting out to a separate keymap): (defun eshell-return-exits-minibuffer () (define-key eshell-mode-map [(control ?g)] 'abort-recursive-edit) (define-key eshell-mode-map [return] 'exit-minibuffer) ...) (defun eshell-command (&optional command arg) ... ;; Enable `eshell-mode' only in this minibuffer. (minibuffer-with-setup-hook #'(lambda () (eshell-mode) (eshell-return-exits-minibuffer)) > And my recommended edit (to be put under the "5.4 Key rebinding" heading)= : > Eshell currently suffers (version 27) from a bug concerning keybinding su= ch that > >(define-key eshell-mode-map (kbd "key") 'command) > cannot be used before the hooks are run. We don't document bugs in the manual.