GNU bug report logs - #64344
[PATCH] Make calculator work with customized mode-line

Previous Next

Package: emacs;

Reported by: john muhl <jm <at> pub.pink>

Date: Thu, 29 Jun 2023 06:44:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: john muhl <jm <at> pub.pink>, 64344 <at> debbugs.gnu.org
Subject: Re: bug#64344: [PATCH] Make calculator work with customized mode-line
Date: Thu, 29 Jun 2023 10:46:11 +0200
On Thu, 29 Jun 2023 10:49:38 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> Date: Wed, 28 Jun 2023 13:23:45 -0500
>> From:  john muhl via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> calculator.el doesn’t work after customizing the mode-line. It assumes
>> the line-width is always an integer but after using customize it is a
>> dotted list.
>> 
>>   - emacs -Q
>>   - M-x customize-apropos-faces RET mode-line RET
>>   - Ensure ‘mode-line-face’ has a box property with vertical and
>>     horizontal widths. The default config includes these already.
>>   - Set for current session
>>   - M-x calculator RET
>>   => calculator: Wrong type argument: number-or-marker-p, (1 . -1)
>
> Thanks.
>
>> diff --git a/lisp/calculator.el b/lisp/calculator.el
>> index bf2ac9b6215..6af6464d2f4 100644
>> --- a/lisp/calculator.el
>> +++ b/lisp/calculator.el
>> @@ -746,7 +746,7 @@ calculator-need-3-lines
>>               ;; use 3 lines
>>               (let* ((bx (face-attribute 'mode-line :box))
>>                      (lh (plist-get bx :line-width)))
>> -               (and bx (or (not lh) (> lh 0))))
>> +               (and bx (or (not lh) (> (if (listp lh) (cdr lh) lh) 0))))

Why is the state of the mode-line face shown as "EDITED, shown value
does not take effect until you set or save it." before setting it in the
above recipe?  In fact, I see nine such faces in the buffer *Customize
Faces* with -Q (the state of all other faces is shown as "STANDARD").

Steve Berman




This bug report was last modified 1 year and 331 days ago.

Previous Next


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