GNU bug report logs - #52907
28.0.90; M-X is broken if (current-local-map)=nil

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Thu, 30 Dec 2021 23:31:02 UTC

Severity: normal

Tags: moreinfo

Found in version 28.0.90

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52907 in the body.
You can then email your comments to 52907 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52907; Package emacs. (Thu, 30 Dec 2021 23:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Mendler <mail <at> daniel-mendler.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 30 Dec 2021 23:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.90; M-X is broken if (current-local-map)=nil
Date: Fri, 31 Dec 2021 00:29:49 +0100
1. Start emacs -Q

2. Define in the scratch buffer
   (defun broken-command ()
     (interactive fundamental-mode))

3. Switch to fundamental mode
   (fundamental-mode)

4. M-X brok TAB ===> Error (see below)

The problem is that the (current-local-map) is nil. This breaks
the predicate of execute-extended-command-for-buffer.

Debugger entered--Lisp error: (wrong-type-argument keymapp (nil))
  where-is-internal(pr-ps-file-preview (nil))
  #f(compiled-function (symbol buffer) #<bytecode
-0xfe888ceef865b96>)(pr-ps-file-preview #<buffer *scratch*>)
  #f(compiled-function (sym) #<bytecode
-0xe7f2f8368079eff>)(pr-ps-file-preview)
  #f(compiled-function (sym) #<bytecode
0x1b9587ed05cbdcf8>)(pr-ps-file-preview)
  try-completion("" ...)
  funcall-interactively(minibuffer-complete)
  command-execute(minibuffer-complete)
  completing-read-default("M-X " #<subr
F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_49>
#f(compiled-function (sym) #<bytecode -0xe7f2f8368079eff>) t nil
extended-command-history nil nil)
  read-extended-command()
  byte-code("\304\30\305 \306\307\310\311\11\"\"B\312\313\2\"\32\13\314
\10E*\207" [execute-extended-command--last-typed minor-mode-map-alist
read-extended-command-predicate current-prefix-arg nil current-local-map
mapcar cdr seq-filter #f(compiled-function (elem) #<bytecode
0x11708780893b0c99>) make-closure #f(compiled-function (symbol buffer)
#<bytecode -0x7e5012e94bc5b96>) read-extended-command] 6)
  command-execute(execute-extended-command-for-buffer)


In GNU Emacs 28.0.90 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5,
cairo version 1.16.0)
 of 2021-12-23 built on projects
Repository revision: 1e578267fb19208504d28253e0c892ceb9a34fb4
Repository branch: emacs-28
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
 'configure --prefix=/home/user/emacs/install --with-cairo --with-json
 --with-native-compilation --with-xwidgets'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM
XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-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
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source eieio eieio-core eieio-loaddefs
password-cache json map text-property-search time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail comp comp-cstr warnings subr-x rx cl-seq cl-macs cl-extra
help-mode cl-loaddefs cl-lib rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils seq byte-opt gv bytecomp byte-compile cconv
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode 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 lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax 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 emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads
xwidget-internal dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 86561 9432)
 (symbols 48 7859 1)
 (strings 32 21679 3028)
 (string-bytes 1 755602)
 (vectors 16 16666)
 (vector-slots 8 312728 15391)
 (floats 8 28 33)
 (intervals 56 242 0)
 (buffers 992 12))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52907; Package emacs. (Sat, 15 Jan 2022 09:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 52907 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Daniel Mendler <mail <at> daniel-mendler.de>
Cc: 52907 <at> debbugs.gnu.org
Subject: Re: bug#52907: 28.0.90; M-X is broken if (current-local-map)=nil
Date: Sat, 15 Jan 2022 10:48:31 +0100
Daniel Mendler <mail <at> daniel-mendler.de> writes:

> 1. Start emacs -Q
>
> 2. Define in the scratch buffer
>    (defun broken-command ()
>      (interactive fundamental-mode))
>
> 3. Switch to fundamental mode
>    (fundamental-mode)
>
> 4. M-X brok TAB ===> Error (see below)
>
> The problem is that the (current-local-map) is nil. This breaks
> the predicate of execute-extended-command-for-buffer.

I'm unable to reproduce this problem in either Emacs 28 or 29.  Are
there additional steps needed to reproduce the bug (or has this been
fixed since this was reported)?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 15 Jan 2022 09:49:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52907; Package emacs. (Sat, 15 Jan 2022 14:31:02 GMT) Full text and rfc822 format available.

Message #13 received at 52907 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 52907 <at> debbugs.gnu.org
Subject: Re: bug#52907: 28.0.90; M-X is broken if (current-local-map)=nil
Date: Sat, 15 Jan 2022 15:29:54 +0100
On 1/15/22 10:48, Lars Ingebrigtsen wrote:
>> 1. Start emacs -Q
>>
>> 2. Define in the scratch buffer
>>    (defun broken-command ()
>>      (interactive fundamental-mode))
>>
>> 3. Switch to fundamental mode
>>    (fundamental-mode)
>>
>> 4. M-X brok TAB ===> Error (see below)
>>
>> The problem is that the (current-local-map) is nil. This breaks
>> the predicate of execute-extended-command-for-buffer.

There are no additional steps. I can still reproduce this in Emacs 28.
The problematic definition is:

          (keymaps
           ;; The major mode's keymap and any active minor modes.
           (cons
            (current-local-map) ;; can be nil!
            (mapcar
             #'cdr
             (seq-filter
              (lambda (elem)
                (symbol-value (car elem)))
              minor-mode-map-alist))))

The map is nil, when I evaluate in the scratch buffer:

1. (fundamental-mode)
2. (current-local-map) -> returns nil

I haven't tried 29 yet, but the problematic definition is still present
there. However maybe where-is-internal has been changed to accept nil
keymaps?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52907; Package emacs. (Sat, 15 Jan 2022 21:31:01 GMT) Full text and rfc822 format available.

Message #16 received at 52907 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Daniel Mendler <mail <at> daniel-mendler.de>, 52907 <at> debbugs.gnu.org
Subject: Re: bug#52907: 28.0.90; M-X is broken if (current-local-map)=nil
Date: Sat, 15 Jan 2022 22:30:27 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Daniel Mendler <mail <at> daniel-mendler.de> writes:
>
> > 1. Start emacs -Q
> >
> > 2. Define in the scratch buffer
> >    (defun broken-command ()
> >      (interactive fundamental-mode))
> >
> > 3. Switch to fundamental mode
> >    (fundamental-mode)
> >
> > 4. M-X brok TAB ===> Error (see below)
> >
> > The problem is that the (current-local-map) is nil. This breaks
> > the predicate of execute-extended-command-for-buffer.
>
> I'm unable to reproduce this problem in either Emacs 28 or 29.  Are
> there additional steps needed to reproduce the bug (or has this been
> fixed since this was reported)?

I can reproduce with a master built from today.

I need to enable `debug-on-error', otherwise I only see a minibuffer
message indicating the error, the minibuffer survives.

Lars, be sure to follow the recipe with all details right - no M-x
instead of M-X, not "bro" instead of "brok" etc - then the recipe
"works" for me (and the analysis given by the OP makes sense to me).

HTH,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52907; Package emacs. (Thu, 20 Jan 2022 10:02:01 GMT) Full text and rfc822 format available.

Message #19 received at 52907 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Daniel Mendler <mail <at> daniel-mendler.de>, 52907 <at> debbugs.gnu.org
Subject: Re: bug#52907: 28.0.90; M-X is broken if (current-local-map)=nil
Date: Thu, 20 Jan 2022 11:01:14 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Lars, be sure to follow the recipe with all details right - no M-x
> instead of M-X, not "bro" instead of "brok" etc - then the recipe
> "works" for me (and the analysis given by the OP makes sense to me).

Ah, I think I didn't type "brok" exactly.  I can reproduce the problem
now, and have fixed it in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 52907 <at> debbugs.gnu.org and Daniel Mendler <mail <at> daniel-mendler.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 20 Jan 2022 10:02:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 17 Feb 2022 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 62 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.