diff options
| author | Po Lu | 2023-06-06 21:01:56 +0800 |
|---|---|---|
| committer | Po Lu | 2023-06-06 21:01:56 +0800 |
| commit | 1263531b9a267ee024264b8aee2d616935969030 (patch) | |
| tree | 5292086be30bc4ce6663916d632a98f5c68e32d1 /src | |
| parent | 5b4dea0fc781fe40548e7b58fe5bd201a05f3913 (diff) | |
| parent | bf28b019a85fcc4e16bc7ecad6304c30e48a3223 (diff) | |
| download | emacs-1263531b9a267ee024264b8aee2d616935969030.tar.gz emacs-1263531b9a267ee024264b8aee2d616935969030.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 1 | ||||
| -rw-r--r-- | src/window.c | 49 | ||||
| -rw-r--r-- | src/xdisp.c | 6 |
3 files changed, 54 insertions, 2 deletions
diff --git a/src/lisp.h b/src/lisp.h index e8cfda1be6e..cb46487358e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4179,6 +4179,7 @@ void set_frame_cursor_types (struct frame *, Lisp_Object); | |||
| 4179 | extern void syms_of_xdisp (void); | 4179 | extern void syms_of_xdisp (void); |
| 4180 | extern void init_xdisp (void); | 4180 | extern void init_xdisp (void); |
| 4181 | extern Lisp_Object safe_eval (Lisp_Object); | 4181 | extern Lisp_Object safe_eval (Lisp_Object); |
| 4182 | extern Lisp_Object safe_eval_inhibit_quit (Lisp_Object); | ||
| 4182 | extern bool pos_visible_p (struct window *, ptrdiff_t, int *, | 4183 | extern bool pos_visible_p (struct window *, ptrdiff_t, int *, |
| 4183 | int *, int *, int *, int *, int *); | 4184 | int *, int *, int *, int *, int *); |
| 4184 | 4185 | ||
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 | */ | ||
| 5487 | static bool | ||
| 5488 | null_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) |
diff --git a/src/xdisp.c b/src/xdisp.c index 543dcba5fee..442a5aa7836 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3074,6 +3074,12 @@ safe__eval (bool inhibit_quit, Lisp_Object sexpr) | |||
| 3074 | return safe__call1 (inhibit_quit, Qeval, sexpr); | 3074 | return safe__call1 (inhibit_quit, Qeval, sexpr); |
| 3075 | } | 3075 | } |
| 3076 | 3076 | ||
| 3077 | Lisp_Object | ||
| 3078 | safe_eval_inhibit_quit (Lisp_Object sexpr) | ||
| 3079 | { | ||
| 3080 | return safe__eval (true, sexpr); | ||
| 3081 | } | ||
| 3082 | |||
| 3077 | /* Call function FN with two arguments ARG1 and ARG2. | 3083 | /* Call function FN with two arguments ARG1 and ARG2. |
| 3078 | Return the result, or nil if something went wrong. */ | 3084 | Return the result, or nil if something went wrong. */ |
| 3079 | 3085 | ||