From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Spenser Truex Newsgroups: gmane.emacs.bugs Subject: bug#33808: Date: Wed, 19 Dec 2018 15:32:50 -0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1545266233 13112 195.159.176.226 (20 Dec 2018 00:37:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Dec 2018 00:37:13 +0000 (UTC) To: 33808@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 20 01:37:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZmKn-0003DB-9S for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Dec 2018 01:37:05 +0100 Original-Received: from localhost ([::1]:34772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZmMt-0006NH-E3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Dec 2018 19:39:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZmMi-0006LF-3t for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 19:39:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZmMg-0006f8-Pg for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 19:39:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51053) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZmMg-0006eg-Fj for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 19:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gZmMg-0000t9-BK for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 19:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Spenser Truex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Dec 2018 00:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33808 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15452663093363 (code B ref -1); Thu, 20 Dec 2018 00:39:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Dec 2018 00:38:29 +0000 Original-Received: from localhost ([127.0.0.1]:55311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZmM8-0000sB-Ho for submit@debbugs.gnu.org; Wed, 19 Dec 2018 19:38:28 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZlLW-0007dJ-8v for submit@debbugs.gnu.org; Wed, 19 Dec 2018 18:33:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZlLN-0006Sz-3k for submit@debbugs.gnu.org; Wed, 19 Dec 2018 18:33:39 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:45280) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZlLK-0006Rn-CC for submit@debbugs.gnu.org; Wed, 19 Dec 2018 18:33:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZlLJ-0004aZ-G5 for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 18:33:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZlLF-0006MK-BI for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 18:33:31 -0500 Original-Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:44011) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZlLE-0006KW-S0 for bug-gnu-emacs@gnu.org; Wed, 19 Dec 2018 18:33:29 -0500 Original-Received: by mail-lj1-x233.google.com with SMTP id q2-v6so7788989lji.10 for ; Wed, 19 Dec 2018 15:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=Y12xXhJ6qnP1vZsPz/UDra0UoIDJU3Lzh17t/uIUn80=; b=VP5xivs8CPVtjRSQAhreYjywgumPu0i+EhaApS2ybaAVhPKWuZ7ZKJc7mGxefET7BN Puu221aMt/hpDkm/wz9zAGIhZdH9no7LS88c1aHO1NzDFioV4bN7DaFEIkBkobJ6KbpH 7rltDkcC7T4pSEb12VLq8v0r7/GkYBwitpiQFTXJR0fQKbP/ReEG0+zzYVUxnW2+g0k9 Y59NdNhBi0MtWvBJzEyVRz1cQRNy3am5CQy5uO75xajDqKHYLicVxAjONih5Y6Uol8wW AaL3tngLwfa94E5/6zgY5b4sbTzFNvb3Yc/gxDPnjE7jinqDOmTuEGKw3+ShZeHhGtlv 2wbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=Y12xXhJ6qnP1vZsPz/UDra0UoIDJU3Lzh17t/uIUn80=; b=VUZEsxQfc8XTYJzi/VuRFSHe7wdhNwfa48RznOkCLxy9pzw/xZvTCgY1k7sbMiC+c9 ErmYsiM0LjInuFYcr3H5mqM6KWU4jZGfXoAtaBgQm+IyG2qRkXEWL4imGHqw31qN6DIJ LWDYdN1xlyXgRBDpTPJK2xOHA23h+LkVKH+0oJxxzmHw3/oCyciV5JmBkcUbFDJrDrIg O2k0f5y5ImSH4UOAQ+5l+I91LAX1Au/E5BHKUZiIxCVYjbf6JFwfOhidqtSErJxDNLjH JsZtP5N20p0tvnxbobVhh65Kyv8IFZF1llZ1vDM0DjUERfFrGAy6Xs0dH41irDiDdAx3 7sVQ== X-Gm-Message-State: AA+aEWbk0cbmgvv7f713rdvQauT1xjryQdh75+roOp662Is5oe6iZyIQ 3M2Q8Ow2xVMrw5RjpnZQecaqC72h2pS9XSj0lrASF2mx X-Google-Smtp-Source: AFSGD/X4xvRlc+TqDx7Rhozg9TSNJS4G5HatJZ3QtTUf+LV1/btsiMtroztcIWlE+lGXye3UW+GMzqpsQnVxrLjANmg= X-Received: by 2002:a2e:9ad0:: with SMTP id p16-v6mr15059149ljj.102.1545262407090; Wed, 19 Dec 2018 15:33:27 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Wed, 19 Dec 2018 19:38:27 -0500 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: 208.118.235.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:153631 Archived-At: Here I reproduce an email sent to emacs-devel@gnu.org and I suggest edits to the eshell manual https://www.gnu.org/software/emacs/manual/eshell.html which currently lacks information on keybinding. This is unfortunate as eshell suffers from a major bug related to keybinding. >Hello, >It isn't possible to bind keys to eshell-mode-map using define-keys like t= his: >(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 "<= C-f12>") 'other-window) >The cause of this can be seen in the patch: eshell-mode-map is set to nil = initially "for the byte compiler," then made buffer local (amusingly commen= ted out with FIXME: What the hell?!). This patch resolves the issue and man= ages to byte compile. > >What is the benefit to setting it to nil initially with respect to the byt= e compiler? The comment above the defvar Also what is the benefit of settin= g it locally when it is already defined globally? The new version byte comp= iles okay, and the above test cases work. The following also runs without i= ssue: >M-x emacs-byte-compile-and-load ;in the new esh-mode.el buffer >(require 'esh-mode) > > >I am skeptical that any performance benefit here is worth breaking the sta= ndard keybinding mechanism. And my recommended edit (to be put under the "5.4 Key rebinding" heading): Eshell currently suffers (version 27) from a bug concerning keybinding such= that >(define-key eshell-mode-map (kbd "key") 'command) cannot be used before the hooks are run. Use >(add-hook 'eshell-mode-hook > (lambda () > (define-key eshell-mode-map (kbd "key1") 'command1) > (define-key eshell-mode-map (kbd "key2") 'command2)) instead.