From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#40725: 27.0.91; Tutorial reports false positive key rebindings Date: Mon, 20 Apr 2020 00:31:25 +0100 Message-ID: <87eesj59yq.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="3744"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: 40725@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 20 01:32:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQJQ4-0000rm-SN for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Apr 2020 01:32:12 +0200 Original-Received: from localhost ([::1]:54598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQJQ3-0007NL-L3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Apr 2020 19:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40604 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQJPv-0007Mj-4L for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 19:32:03 -0400 Original-Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQJPu-0007D5-Hj for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 19:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34683) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQJPu-0007Cv-4p for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 19:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jQJPu-00042h-0U for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 19:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Apr 2020 23:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40725 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.158733909415504 (code B ref -1); Sun, 19 Apr 2020 23:32:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Apr 2020 23:31:34 +0000 Original-Received: from localhost ([127.0.0.1]:46229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQJPS-00041z-9t for submit@debbugs.gnu.org; Sun, 19 Apr 2020 19:31:34 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQJPQ-00041r-8B for submit@debbugs.gnu.org; Sun, 19 Apr 2020 19:31:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40400 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQJPP-0007JA-Ga for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 19:31:32 -0400 Original-Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQJPO-0006fu-8g for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 19:31:31 -0400 Original-Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:37341) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQJPN-0006ep-No for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 19:31:29 -0400 Original-Received: by mail-wr1-x443.google.com with SMTP id k1so9963283wrx.4 for ; Sun, 19 Apr 2020 16:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:user-agent:mime-version; bh=hh+wlAazdeHxLifMtpMs6lEh8A1sy0737uVaLYxyW7c=; b=q0ou670M5T/jF09bvjM/QyZvuG02XP1cJHfppjRHhQVFMm9foJnhbGD26YTT/pSTDg xgZRx5gnj83OsKasMs0TwDBq83ovzcnIcOB3QzQ9JLSeqTGThFKPGX1EqKq5jehRn7h6 TrNxjYd04N6hBgpQFKx+oIRZQJ9odjHWs9NfYisFYRM4TFHMvOLFZz9tExfiojwtGlxa ZWIrCmNCxCNCBjEEVCnADzM29s0OD2bza2F7tP9Ujnt4DF7UJARR1rT9j3DtN/+MBMbY dvCAZkNfWW/YjiQJ38igs3QER78A0Ohf59zpHpqKuUFuVBZ7E7TOiN6tRspMDZYCVrbG oJIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=hh+wlAazdeHxLifMtpMs6lEh8A1sy0737uVaLYxyW7c=; b=MmFKiOOv6hiCdRejT9cjExTIjsJ7UJtnCBDuFe4buvCfiKq8ts1H0/2lgo1w0g4uoK FQwWIGV6UPTMxteuLwNd+auAbkOr032aorkNghRneoE01K1MgVRgejJPUtnbKGmKRsb6 20YosL8xn6TT02vLCoRqBXfO/dD7J2KW4VfyWk2jqNXw50MtOrWUzEiQ7WAkwEzkpuM9 TojOToK2NN3C+vAdaivXDMG0vz0fZhgYNCrCESLAXQ7ngqB2/RqRQ/22VSF/wtJ4Rf9o QBCFV3sIZIs7zye0uR8TnUNxUagtOz5Ah/tXMoBgwuDOL1GE5RVCp7LBju1BknnCiG+U V+fA== X-Gm-Message-State: AGi0PuYRoD9Z8muectz923MJCaV4jFyIXaE9OORN57mteCU85u72P7BD xo6dwshzuIU0ORqRYbZUBPagC6tAL8o= X-Google-Smtp-Source: APiQypIJfINOvFPRskEzihufFf6KBTwoecW0taA6mQD5J7ZFSew2asNzdCk9oprRgWPTP8QKo6owEg== X-Received: by 2002:a5d:4248:: with SMTP id s8mr15331519wrr.216.1587339087212; Sun, 19 Apr 2020 16:31:27 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:1f68:7ff5:120d:64e]) by smtp.gmail.com with ESMTPSA id n7sm4898413wmd.11.2020.04.19.16.31.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2020 16:31:26 -0700 (PDT) Received-SPF: none client-ip=2a00:1450:4864:20::443; envelope-from=contovob@tcd.ie; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs1p.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178682 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Severity: minor Tags: patch In some cases the tutorial can falsely claim that a user's modified key bindings no longer correspond to the tutorial's text: 0. emacs -Q 1. M-x winner-mode RET 2. C-h t The user is then presented with the following: NOTICE: The main purpose of the Emacs tutorial is to teach you the most important standard Emacs commands (key bindings). However, your Emacs has been customized by changing some of these basic editing commands, so it doesn't correspond to the tutorial. We have inserted colored notices where the altered commands have been introduced. [More] Yet no such coloured notices are to be found in TUTORIAL, since winner-mode binds only 'C-c ' and 'C-c ', neither of which is mentioned in the tutorial. Pushing the "More" button gives the following *Help* buffer contents: --8<---------------cut here---------------start------------->8--- The following key bindings used in the tutorial have been changed from the Emacs default: Standard Key Command In Your Emacs=20=20=20 C-c mode-specific-command-prefix M-x mode-specific-command-prefix mo= re info It is OK to change key bindings, but changed bindings do not correspond to what the tutorial says. --8<---------------cut here---------------end--------------->8--- Pushing the "more info" button in turn gives the following *Help* text: --8<---------------cut here---------------start------------->8--- Your Emacs customizations override the default binding for this key: The default Emacs binding for the key C-c is the command =E2=80=98mode-specific-command-prefix=E2=80=99. However, your customizatio= ns have rebound it to the command =E2=80=98(keymap (keymap (right . winner-redo) (l= eft . winner-undo)) mode-specific-command-prefix)=E2=80=99. --8<---------------cut here---------------end--------------->8--- The following patch fixes this: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-handling-of-changed-prefix-keys-in-tutorial.patch >From 1d607f275458e14d36d00cccdcfb7b7bae55933b Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sat, 28 Mar 2020 22:26:25 +0000 Subject: [PATCH] Fix handling of changed prefix keys in tutorial * lisp/tutorial.el (tutorial--find-changed-keys): Use keymapp to detect prefix definitions rather than hard-coding them. A notable omission from the hard-coded list was mode-specific-command-prefix, whose subcommands are often rebound. --- lisp/tutorial.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/tutorial.el b/lisp/tutorial.el index d07737e333..a906af3b5a 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -427,11 +427,9 @@ tutorial--find-changed-keys ;; Handle prefix definitions specially ;; so that a mode that rebinds some subcommands ;; won't make it appear that the whole prefix is gone. - (key-fun (if (eq def-fun 'ESC-prefix) - (lookup-key global-map [27]) - (if (eq def-fun 'Control-X-prefix) - (lookup-key global-map [24]) - (key-binding key)))) + (key-fun (if (keymapp def-fun) + (lookup-key global-map key) + (key-binding key))) (where (where-is-internal (if rem-fun rem-fun def-fun))) cwhere) -- 2.25.1 --=-=-= Content-Type: text/plain I don't think this qualifies as urgent enough for inclusion in emacs-27, but I think the fix is harmless enough if desired. WDYT? Thanks, -- Basil In GNU Emacs 27.0.91 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2020-04-17 built on thunk Repository revision: c36c5a3dedbb2e0349be1b6c3b7567ea7b594f1c Repository branch: emacs-27 Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Debian GNU/Linux bullseye/sid Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Winner mode enabled Preparing tutorial ... Configured using: 'configure 'CC=ccache gcc' 'CFLAGS=-O0 -g3 -ggdb -gdwarf-4' --config-cache --prefix=/home/blc/.local --program-suffix=27 --enable-checking=yes,glyphs --enable-check-lisp-object-type --with-x-toolkit=lucid --with-file-notification=yes --with-x' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: en_IE.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: winner-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tutorial help-mode easymenu cl-loaddefs cl-lib cus-start cus-load winner ring tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 53148 6793) (symbols 48 7187 1) (strings 32 18206 1076) (string-bytes 1 550231) (vectors 16 9603) (vector-slots 8 128508 8846) (floats 8 22 33) (intervals 56 228 0) (buffers 1000 12)) --=-=-=--