GNU bug report logs - #75765
30.0.92; which-key-setup-side-window-right causes which-key to fail

Previous Next

Package: emacs;

Reported by: Reindert-Jan Ekker <info <at> codesensei.nl>

Date: Wed, 22 Jan 2025 16:04:01 UTC

Severity: normal

Found in version 30.0.92

To reply to this bug, email your comments to 75765 AT debbugs.gnu.org.

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#75765; Package emacs. (Wed, 22 Jan 2025 16:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Reindert-Jan Ekker <info <at> codesensei.nl>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 22 Jan 2025 16:04:02 GMT) Full text and rfc822 format available.

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

From: Reindert-Jan Ekker <info <at> codesensei.nl>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.92; which-key-setup-side-window-right causes which-key to fail
Date: Wed, 22 Jan 2025 14:23:31 +0000
Run the following:
(which-key-mode 1)
(which-key-setup-side-window-right)

Then press a key that would show a which-key overview (like M-s or
M-g). This causes the error:

Error running timer ‘which-key--update’: (wrong-type-argument wholenump
-15)

This error sometimes seems to go away, so on later key presses which-key
may or may not work.


In GNU Emacs 30.0.92 (build 1, aarch64-apple-darwin24.0.0, NS
 appkit-2566.00 Version 15.0 (Build 24A8332)) of 2024-11-23 built on
 ReindertJansMBP
Windowing system distributor 'Apple', version 10.3.2566
System Description:  macOS 15.0

Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
 --infodir=/opt/homebrew/Cellar/emacs-plus <at> 30/30.0.92/share/info/emacs
 --prefix=/opt/homebrew/Cellar/emacs-plus <at> 30/30.0.92 --with-xml2
 --with-gnutls --without-compress-install --without-dbus
 --without-imagemagick --with-modules --with-rsvg --with-webp --with-ns
 --disable-ns-self-contained 'CFLAGS=-O2 -DFD_SETSIZE=10000
 -DDARWIN_UNLIMITED_SELECT -I/opt/homebrew/opt/sqlite/include'
 LDFLAGS=-L/opt/homebrew/opt/sqlite/lib'

Configured features:
ACL GIF GLIB GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS
PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
WEBP XIM ZLIB

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

Major mode: Lisp Interaction

Minor modes in effect:
  which-key-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  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
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils thingatpt help-fns
radix-tree time-date subr-x cl-seq cl-extra help-mode which-key
cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win 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 nadvice seq simple cl-generic
indonesian philippine 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 abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads kqueue cocoa ns lcms2
multi-tty make-network-process emacs)

Memory information:
((conses 16 47333 19399) (symbols 48 5866 0) (strings 32 14816 1831)
 (string-bytes 1 374576) (vectors 16 10793)
 (vector-slots 8 126166 7296) (floats 8 38 11) (intervals 56 459 0)
 (buffers 992 12))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75765; Package emacs. (Wed, 22 Jan 2025 17:44:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Reindert-Jan Ekker <info <at> codesensei.nl>
Cc: Thomas Voss <mail <at> thomasvoss.com>, 75765 <at> debbugs.gnu.org
Subject: Re: bug#75765: 30.0.92; which-key-setup-side-window-right causes
 which-key to fail
Date: Wed, 22 Jan 2025 18:42:53 +0100
>>>>> On Wed, 22 Jan 2025 14:23:31 +0000, Reindert-Jan Ekker <info <at> codesensei.nl> said:

    Reindert-Jan> Run the following:
    Reindert-Jan> (which-key-mode 1)
    Reindert-Jan> (which-key-setup-side-window-right)

    Reindert-Jan> Then press a key that would show a which-key overview (like M-s or
    Reindert-Jan> M-g). This causes the error:

    Reindert-Jan> Error running timer ‘which-key--update’: (wrong-type-argument wholenump
    Reindert-Jan> -15)

    Reindert-Jan> This error sometimes seems to go away, so on later key presses which-key
    Reindert-Jan> may or may not work.

`which-key--pad-column' is not accounting for the case where the
length of the string itʼs padding is greater than the number of
available columns. This fixes it for me:

Robert
-- 

diff --git a/lisp/which-key.el b/lisp/which-key.el
index 45a02955e11..bfeb9da7422 100644
--- a/lisp/which-key.el
+++ b/lisp/which-key.el
@@ -2038,7 +2038,7 @@ which-key--pad-column
           (mapcar (pcase-lambda (`(,key ,sep ,desc ,_doc))
                     (concat
                      (format col-format key sep desc)
-                     (make-string (- col-desc-width (string-width desc)) ?\s)))
+                     (make-string (max (- col-desc-width (string-width desc)) 0) ?\s)))
                   col-keys))))
 
 (defun which-key--partition-list (n list)




This bug report was last modified 8 days ago.

Previous Next


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