From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: john muhl via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64344: [PATCH] Make calculator work with customized mode-line Date: Thu, 29 Jun 2023 10:12:06 -0500 Message-ID: <87jzvmp9m8.fsf@pub.pink> References: <87jzvn4f4e.fsf@pub.pink> Reply-To: john muhl Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27806"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64344@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 29 18:45:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEuli-0006vH-Lx for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Jun 2023 18:45:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEulb-00005v-17; Thu, 29 Jun 2023 12:45:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEulU-0008OD-95 for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2023 12:45:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEulT-0000kh-4b for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2023 12:45:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEulT-0008HE-0h for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2023 12:45:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87jzvn4f4e.fsf@pub.pink> Resent-From: john muhl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Jun 2023 16:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64344 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64344-submit@debbugs.gnu.org id=B64344.168805709331755 (code B ref 64344); Thu, 29 Jun 2023 16:45:02 +0000 Original-Received: (at 64344) by debbugs.gnu.org; 29 Jun 2023 16:44:53 +0000 Original-Received: from localhost ([127.0.0.1]:53942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEulH-0008Fz-I5 for submit@debbugs.gnu.org; Thu, 29 Jun 2023 12:44:53 -0400 Original-Received: from out-11.mta1.migadu.com ([95.215.58.11]:34760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEtdK-0006Bv-2E for 64344@debbugs.gnu.org; Thu, 29 Jun 2023 11:32:34 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; s=key1; t=1688052753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=kAn1zsE3/Q7mMp5uTPp/WbXGCzJRMpmWSOFPmg5yrDw=; b=Yd0mgWYwqFhK3eFhDdIU+6/NWGl+VMWvw2z+BVHCeAJkUGY1RY8sJuPPjAu5XjFJCbcAFN SibHVPvK4S/LndQAO2bZDGKP4vzu8qUWsVrRp8j9o0/CJkwRPV43ygcXLHJKcAGnUqxApR u+UgVyeT/LT0BjZtmnLSfvD75hwRIJY= X-Migadu-Flow: FLOW_OUT X-Mailman-Approved-At: Thu, 29 Jun 2023 12:44:48 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264283 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> + (and bx (or (not lh) (> (if (listp lh) (cdr lh) lh) 0)))) > ^^^^^ > Shouldn't that be 'consp' instead? 'listp' returns non-nil for nil > argument. I=E2=80=99m not expert enough to say more than that either way works to fix= the issue. Originally I did the =E2=80=98(cdr lh)=E2=80=99 unconditionally and = got an error mentioning =E2=80=98listp=E2=80=99 so I just used that when I added the con= dition; if it had said =E2=80=98conps=E2=80=99 I would have used that. Here is the patch with =E2=80=98consp=E2=80=99 instead. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-calculator-el--calculator-need-3-lines---Ch.patch Content-Description: [PATCH] * lisp/calculator.el (calculator-need-3-lines): Check type >From 36ea9a67c9e559c490f2c5787a75b229772a97e4 Mon Sep 17 00:00:00 2001 From: john muhl Date: Wed, 28 Jun 2023 12:58:27 -0500 Subject: [PATCH] * lisp/calculator.el (calculator-need-3-lines): Check type Copyright-paperwork-exempt: yes --- lisp/calculator.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)))) ;; if the mode line has an overline, use 3 lines (not (memq (face-attribute 'mode-line :overline) '(nil unspecified))))))) -- 2.41.0 --=-=-=--