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

Tags: fixed

Found in version 30.0.92

Fixed in version 30.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

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: 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 107 days ago.

Previous Next


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