diff options
| author | Po Lu | 2023-06-24 09:20:14 +0800 |
|---|---|---|
| committer | Po Lu | 2023-06-24 09:20:14 +0800 |
| commit | f5d142f66370b29af58360faeea90d1112756bc5 (patch) | |
| tree | 13704d442b57b9785201ccf623a56e19922e2736 /src | |
| parent | a5ee9a69ae73843bf3e620dbe474d5cdaaff5f3a (diff) | |
| parent | 77c2f05d773271cb59ebfd994b06a4075cacbfa8 (diff) | |
| download | emacs-f5d142f66370b29af58360faeea90d1112756bc5.tar.gz emacs-f5d142f66370b29af58360faeea90d1112756bc5.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 | 66 | ||||
| -rw-r--r-- | src/xdisp.c | 6 |
3 files changed, 5 insertions, 68 deletions
diff --git a/src/lisp.h b/src/lisp.h index cb46487358e..e8cfda1be6e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4179,7 +4179,6 @@ 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); | ||
| 4183 | extern bool pos_visible_p (struct window *, ptrdiff_t, int *, | 4182 | extern bool pos_visible_p (struct window *, ptrdiff_t, int *, |
| 4184 | int *, int *, int *, int *, int *); | 4183 | int *, int *, int *, int *, int *); |
| 4185 | 4184 | ||
diff --git a/src/window.c b/src/window.c index ea27fdda2a6..482db5dbed4 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -5472,58 +5472,6 @@ window_wants_mode_line (struct window *w) | |||
| 5472 | && WINDOW_PIXEL_HEIGHT (w) > WINDOW_FRAME_LINE_HEIGHT (w)); | 5472 | && WINDOW_PIXEL_HEIGHT (w) > WINDOW_FRAME_LINE_HEIGHT (w)); |
| 5473 | } | 5473 | } |
| 5474 | 5474 | ||
| 5475 | static int header_line_eval_called = 0; | ||
| 5476 | |||
| 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 | if (header_line_eval_called > 0) | ||
| 5504 | return false; | ||
| 5505 | eassert (header_line_eval_called == 0); | ||
| 5506 | header_line_eval_called++; | ||
| 5507 | val = safe_eval_inhibit_quit (XCAR (XCDR (fmt))); | ||
| 5508 | header_line_eval_called--; | ||
| 5509 | eassert (header_line_eval_called == 0); | ||
| 5510 | if (!FRAME_LIVE_P (f)) | ||
| 5511 | { | ||
| 5512 | header_line_eval_called = 0; | ||
| 5513 | signal_error (":eval deleted the frame being displayed", fmt); | ||
| 5514 | } | ||
| 5515 | return NILP (val); | ||
| 5516 | } | ||
| 5517 | val = find_symbol_value (car); | ||
| 5518 | return (SYMBOLP (car) | ||
| 5519 | && (EQ (val, Qunbound) | ||
| 5520 | || NILP (val))); | ||
| 5521 | } | ||
| 5522 | } | ||
| 5523 | |||
| 5524 | return false; | ||
| 5525 | } | ||
| 5526 | |||
| 5527 | 5475 | ||
| 5528 | /** | 5476 | /** |
| 5529 | * window_wants_header_line: | 5477 | * window_wants_header_line: |
| @@ -5542,19 +5490,15 @@ null_header_line_format (Lisp_Object fmt, struct frame *f) | |||
| 5542 | bool | 5490 | bool |
| 5543 | window_wants_header_line (struct window *w) | 5491 | window_wants_header_line (struct window *w) |
| 5544 | { | 5492 | { |
| 5545 | Lisp_Object window_header_line_format | 5493 | Lisp_Object window_header_line_format = |
| 5546 | = window_parameter (w, Qheader_line_format); | 5494 | window_parameter (w, Qheader_line_format); |
| 5547 | |||
| 5548 | struct frame *f = WINDOW_XFRAME (w); | ||
| 5549 | Lisp_Object wbuffer = WINDOW_BUFFER (w); | ||
| 5550 | 5495 | ||
| 5551 | return (BUFFERP (wbuffer) | 5496 | return (WINDOW_LEAF_P (w) |
| 5552 | && !MINI_WINDOW_P (w) | 5497 | && !MINI_WINDOW_P (w) |
| 5553 | && !WINDOW_PSEUDO_P (w) | 5498 | && !WINDOW_PSEUDO_P (w) |
| 5554 | && !EQ (window_header_line_format, Qnone) | 5499 | && !EQ (window_header_line_format, Qnone) |
| 5555 | && (!null_header_line_format (window_header_line_format, f) | 5500 | && (!NILP (window_header_line_format) |
| 5556 | || !null_header_line_format (BVAR (XBUFFER (wbuffer), | 5501 | || !NILP (BVAR (XBUFFER (WINDOW_BUFFER (w)), header_line_format))) |
| 5557 | header_line_format), f)) | ||
| 5558 | && (WINDOW_PIXEL_HEIGHT (w) | 5502 | && (WINDOW_PIXEL_HEIGHT (w) |
| 5559 | > (window_wants_mode_line (w) | 5503 | > (window_wants_mode_line (w) |
| 5560 | ? 2 * WINDOW_FRAME_LINE_HEIGHT (w) | 5504 | ? 2 * WINDOW_FRAME_LINE_HEIGHT (w) |
diff --git a/src/xdisp.c b/src/xdisp.c index 679f937a9c7..d928e9562d2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3074,12 +3074,6 @@ 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 | |||
| 3083 | /* Call function FN with two arguments ARG1 and ARG2. | 3077 | /* Call function FN with two arguments ARG1 and ARG2. |
| 3084 | Return the result, or nil if something went wrong. */ | 3078 | Return the result, or nil if something went wrong. */ |
| 3085 | 3079 | ||