unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64344: [PATCH] Make calculator work with customized mode-line
@ 2023-06-28 18:23 john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-06-29  7:49 ` Eli Zaretskii
  2023-06-29 15:12 ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 12+ messages in thread
From: john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-06-28 18:23 UTC (permalink / raw)
  To: 64344

[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

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)

In GNU Emacs 30.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-06-28 built on localhost
Repository revision: c5d6102313076b83526dc79bfb563621671fb70b
Repository branch: master
System Description: Fedora Linux 38 (Workstation Edition)

Configured using:
 'configure --with-native-compilation --with-pgtk'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] * lisp/calculator.el (calculator-need-3-lines): Check type --]
[-- Type: text/x-patch, Size: 965 bytes --]

From 54cd9fe40d954231a6be822d9ea448902e12c60c Mon Sep 17 00:00:00 2001
From: john muhl <jm@pub.pink>
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


[-- Attachment #3.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 503 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-06-29 18:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-28 18:23 bug#64344: [PATCH] Make calculator work with customized mode-line john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-29  7:49 ` Eli Zaretskii
2023-06-29  8:22   ` Andreas Schwab
2023-06-29  9:28     ` Eli Zaretskii
2023-06-29  9:31       ` Andreas Schwab
2023-06-29  9:38         ` Eli Zaretskii
2023-06-29  9:43           ` Andreas Schwab
2023-06-29  8:46   ` Stephen Berman
2023-06-29  9:26     ` Eli Zaretskii
2023-06-29 10:17       ` Stephen Berman
2023-06-29 15:12 ` john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-29 18:22   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).