aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorPo Lu2023-06-06 21:01:56 +0800
committerPo Lu2023-06-06 21:01:56 +0800
commit1263531b9a267ee024264b8aee2d616935969030 (patch)
tree5292086be30bc4ce6663916d632a98f5c68e32d1 /src/window.c
parent5b4dea0fc781fe40548e7b58fe5bd201a05f3913 (diff)
parentbf28b019a85fcc4e16bc7ecad6304c30e48a3223 (diff)
downloademacs-1263531b9a267ee024264b8aee2d616935969030.tar.gz
emacs-1263531b9a267ee024264b8aee2d616935969030.zip
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c49
1 files changed, 47 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c
index 8c42d3cdd0c..6423060b985 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5475,6 +5475,48 @@ window_wants_mode_line (struct window *w)
5475 5475
5476 5476
5477/** 5477/**
5478 * null_header_line_format:
5479 *
5480 * Return non-zero when header line format FMT indicates that the
5481 * header line should not be displayed at all, for windows on frame F.
5482 *
5483 * This is when FMT is nil, or if FMT is a cons cell and either its
5484 * car is a symbol whose value as a variable is nil or void, or its
5485 * car is the symbol ':eval' and its cadr evaluates to nil.
5486 */
5487static bool
5488null_header_line_format (Lisp_Object fmt, struct frame *f)
5489{
5490 Lisp_Object car;
5491 Lisp_Object val;
5492
5493 if (NILP (fmt))
5494 return true;
5495
5496 if (CONSP (fmt))
5497 {
5498 car = XCAR (fmt);
5499 if (SYMBOLP (car))
5500 {
5501 if (EQ (car, QCeval))
5502 {
5503 val = safe_eval_inhibit_quit (XCAR (XCDR (fmt)));
5504 if (!FRAME_LIVE_P (f))
5505 signal_error (":eval deleted the frame being displayed", fmt);
5506 return NILP (val);
5507 }
5508 val = find_symbol_value (car);
5509 return (SYMBOLP (car)
5510 && (EQ (val, Qunbound)
5511 || NILP (val)));
5512 }
5513 }
5514
5515 return false;
5516}
5517
5518
5519/**
5478 * window_wants_header_line: 5520 * window_wants_header_line:
5479 * 5521 *
5480 * Return 1 if window W wants a header line and is high enough to 5522 * Return 1 if window W wants a header line and is high enough to
@@ -5494,12 +5536,15 @@ window_wants_header_line (struct window *w)
5494 Lisp_Object window_header_line_format = 5536 Lisp_Object window_header_line_format =
5495 window_parameter (w, Qheader_line_format); 5537 window_parameter (w, Qheader_line_format);
5496 5538
5539 struct frame *f = WINDOW_XFRAME(w);
5540
5497 return (WINDOW_LEAF_P (w) 5541 return (WINDOW_LEAF_P (w)
5498 && !MINI_WINDOW_P (w) 5542 && !MINI_WINDOW_P (w)
5499 && !WINDOW_PSEUDO_P (w) 5543 && !WINDOW_PSEUDO_P (w)
5500 && !EQ (window_header_line_format, Qnone) 5544 && !EQ (window_header_line_format, Qnone)
5501 && (!NILP (window_header_line_format) 5545 && (!null_header_line_format (window_header_line_format, f)
5502 || !NILP (BVAR (XBUFFER (WINDOW_BUFFER (w)), header_line_format))) 5546 || !null_header_line_format (BVAR (XBUFFER (WINDOW_BUFFER (w)),
5547 header_line_format), f))
5503 && (WINDOW_PIXEL_HEIGHT (w) 5548 && (WINDOW_PIXEL_HEIGHT (w)
5504 > (window_wants_mode_line (w) 5549 > (window_wants_mode_line (w)
5505 ? 2 * WINDOW_FRAME_LINE_HEIGHT (w) 5550 ? 2 * WINDOW_FRAME_LINE_HEIGHT (w)