unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40725: 27.0.91; Tutorial reports false positive key rebindings
@ 2020-04-19 23:31 Basil L. Contovounesios
  2020-04-20 14:28 ` Eli Zaretskii
  2020-04-24  8:46 ` Mattias Engdegård
  0 siblings, 2 replies; 40+ messages in thread
From: Basil L. Contovounesios @ 2020-04-19 23:31 UTC (permalink / raw)
  To: 40725

[-- Attachment #1: Type: text/plain, Size: 1917 bytes --]

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 <left>' and 'C-c <right>', 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   
   C-c 		  mode-specific-command-prefix M-x mode-specific-command-prefix more 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
‘mode-specific-command-prefix’.  However, your customizations have
rebound it to the command ‘(keymap (keymap (right . winner-redo) (left
. winner-undo)) mode-specific-command-prefix)’.
--8<---------------cut here---------------end--------------->8---

The following patch fixes this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-handling-of-changed-prefix-keys-in-tutorial.patch --]
[-- Type: text/x-diff, Size: 1337 bytes --]

From 1d607f275458e14d36d00cccdcfb7b7bae55933b Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
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


[-- Attachment #3: Type: text/plain, Size: 3365 bytes --]


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))

^ permalink raw reply related	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2021-11-15  5:53 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-19 23:31 bug#40725: 27.0.91; Tutorial reports false positive key rebindings Basil L. Contovounesios
2020-04-20 14:28 ` Eli Zaretskii
2020-04-20 22:19   ` Basil L. Contovounesios
2020-04-21 13:39     ` Eli Zaretskii
2020-04-22 22:26       ` Basil L. Contovounesios
2020-04-23 14:33         ` Eli Zaretskii
2020-04-23 21:52         ` Juri Linkov
2020-04-24  6:55           ` Eli Zaretskii
2020-04-25  3:31           ` Richard Stallman
2020-04-25  8:54           ` Eli Zaretskii
2020-04-25 20:42             ` Juri Linkov
2020-08-18 13:54         ` Lars Ingebrigtsen
2020-08-18 18:52           ` Basil L. Contovounesios
2020-08-19 10:20             ` Lars Ingebrigtsen
2021-11-12  8:28               ` Lars Ingebrigtsen
2021-11-14 23:24                 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-15  5:53                   ` Lars Ingebrigtsen
2020-04-24  8:46 ` Mattias Engdegård
2020-04-24 10:20   ` Eli Zaretskii
2020-04-24 10:41     ` Mattias Engdegård
2020-04-24 11:21       ` Eli Zaretskii
2020-04-24 11:35         ` Mattias Engdegård
2020-04-24 12:13           ` Eli Zaretskii
2020-04-24 12:47             ` Mattias Engdegård
2020-04-24 13:32               ` Eli Zaretskii
2020-04-24 16:01                 ` Mattias Engdegård
2020-04-25  3:33                 ` Richard Stallman
2020-04-25  6:20                   ` Eli Zaretskii
2020-04-27  2:18                     ` Richard Stallman
2020-04-27  2:37                       ` Eli Zaretskii
2020-04-27  6:11                       ` Andreas Schwab
2020-04-28  2:49                         ` Richard Stallman
2020-04-28  7:02                           ` Andreas Schwab
2020-04-29  3:25                             ` Richard Stallman
2020-04-29  7:30                               ` Eli Zaretskii
2020-04-30  2:32                                 ` Richard Stallman
2020-04-24 19:48             ` Kévin Le Gouguec
2020-04-24 19:57               ` Eli Zaretskii
2020-04-24 15:38           ` Dmitry Gutov
2020-04-24 15:51             ` Eli Zaretskii

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).