emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 01ce70cea9b 5/5: Revert "Avoid header line with some empty non-ni


From: Eli Zaretskii
Subject: master 01ce70cea9b 5/5: Revert "Avoid header line with some empty non-nil formats"
Date: Fri, 23 Jun 2023 06:52:34 -0400 (EDT)

branch: master
commit 01ce70cea9b62185beb9b7a8c52381ea148d98d0
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Revert "Avoid header line with some empty non-nil formats"
    
    This reverts commit 4f66cbbfe520ee31ef26676e09a926217d9736fe.
    This is part of removing the recently-added feature whereby
    certain non-nil values of 'header-line-format' could signal
    that the header line shall not be displayed.  The feature is
    being reverted because its advantages are very minor, whereas
    the complications it causes are serious.
---
 doc/lispref/modes.texi |  9 ---------
 etc/NEWS               |  8 --------
 src/lisp.h             |  1 -
 src/window.c           | 50 ++------------------------------------------------
 src/xdisp.c            |  6 ------
 5 files changed, 2 insertions(+), 72 deletions(-)

diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 3bb3ae9b939..cdbda5503b7 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2597,15 +2597,6 @@ It is normally @code{nil}, so that ordinary buffers have 
no header
 line.
 @end defvar
 
-Emacs displays the header line for a window unless
-@code{header-line-format} is either @code{nil}, or it's a list whose
-@sc{car} is a symbol, and either that symbol is @code{:eval} and the
-second list element evaluates to @code{nil} or the symbol's value as a
-variable is @code{nil} or void.  Note that there are other possible
-values @code{header-line-format} that result in an empty header line
-(for example, @code{""}), but all other values tell Emacs to display a
-header line, whether or not it is empty.
-
 If @code{display-line-numbers-mode} is turned on in a buffer
 (@pxref{Display Custom, display-line-numbers-mode,, emacs, The GNU
 Emacs Manual}), the buffer text is indented on display by the amount
diff --git a/etc/NEWS b/etc/NEWS
index 422e1ec585e..b37b9877d79 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -476,14 +476,6 @@ hooks named after the feature name, like 
'esh-mode-unload-hook'.
 +++
 ** 'copy-tree' now copies records when its optional 2nd argument is non-nil.
 
-+++
-** Certain values of 'header-line-format' now inhibit empty header line.
-Emacs now avoids displaying a header line, instead of displaying an
-empty one, when 'header-line-format' is a list whose 'car' is a
-symbol, and either that symbol is ':eval' and the second element of
-the list evaluates to 'nil' or the symbol's value as a variable is
-'nil' or void.
-
 +++
 ** Regexp zero-width assertions followed by operators are better defined.
 Previously, regexps such as "xy\\B*" would have ill-defined behaviour.
diff --git a/src/lisp.h b/src/lisp.h
index 2978de962d9..2bfcd1a1983 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4174,7 +4174,6 @@ void set_frame_cursor_types (struct frame *, Lisp_Object);
 extern void syms_of_xdisp (void);
 extern void init_xdisp (void);
 extern Lisp_Object safe_eval (Lisp_Object);
-extern Lisp_Object safe_eval_inhibit_quit (Lisp_Object);
 extern bool pos_visible_p (struct window *, ptrdiff_t, int *,
                           int *, int *, int *, int *, int *);
 
diff --git a/src/window.c b/src/window.c
index 164af6f67f0..1a53e466dfb 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5470,48 +5470,6 @@ window_wants_mode_line (struct window *w)
 }
 
 
-/**
- * null_header_line_format:
- *
- * Return non-zero when header line format FMT indicates that the
- * header line should not be displayed at all.
- *
- * This is when FMT is nil, or if FMT is a cons cell and either its
- * car is a symbol whose value as a variable is nil or void, or its
- * car is the symbol ':eval' and its cadr evaluates to nil.
- */
-static bool
-null_header_line_format (Lisp_Object fmt, struct frame * f)
-{
-  Lisp_Object car;
-  Lisp_Object val;
-
-  if (NILP (fmt))
-    return true;
-
-  if (CONSP (fmt))
-    {
-      car = XCAR (fmt);
-      if (SYMBOLP (car))
-       {
-         if (EQ (car, QCeval))
-           {
-             val = safe_eval_inhibit_quit (XCAR (XCDR (fmt)));
-             if (!FRAME_LIVE_P (f))
-               signal_error (":eval deleted the frame being displayed", fmt);
-             return NILP (val);
-           }
-         val = find_symbol_value (car);
-         return (SYMBOLP (car)
-                 && (EQ (val, Qunbound)
-                     || NILP (val)));
-       }
-    }
-
-  return false;
-}
-
-
 /**
  * window_wants_header_line:
  *
@@ -5532,16 +5490,12 @@ window_wants_header_line (struct window *w)
   Lisp_Object window_header_line_format =
     window_parameter (w, Qheader_line_format);
 
-  struct frame * f = WINDOW_XFRAME(w);
-
   return (WINDOW_LEAF_P (w)
          && !MINI_WINDOW_P (w)
          && !WINDOW_PSEUDO_P (w)
          && !EQ (window_header_line_format, Qnone)
-         && (!null_header_line_format (window_header_line_format, f)
-             || !null_header_line_format (BVAR (XBUFFER (WINDOW_BUFFER (w)),
-                                                header_line_format),
-                                          f))
+         && (!NILP (window_header_line_format)
+             || !NILP (BVAR (XBUFFER (WINDOW_BUFFER (w)), header_line_format)))
          && (WINDOW_PIXEL_HEIGHT (w)
              > (window_wants_mode_line (w)
                 ? 2 * WINDOW_FRAME_LINE_HEIGHT (w)
diff --git a/src/xdisp.c b/src/xdisp.c
index 4a48b93b29e..85ece901111 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3074,12 +3074,6 @@ safe__eval (bool inhibit_quit, Lisp_Object sexpr)
   return safe__call1 (inhibit_quit, Qeval, sexpr);
 }
 
-Lisp_Object
-safe_eval_inhibit_quit (Lisp_Object sexpr)
-{
-  return safe__eval (true, sexpr);
-}
-
 /* Call function FN with two arguments ARG1 and ARG2.
    Return the result, or nil if something went wrong.  */
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]