aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Rudalics2025-01-28 16:59:45 +0100
committerMartin Rudalics2025-01-28 16:59:45 +0100
commit7f01dd8906cbc8839ffecc55cfa7ff789f3fa298 (patch)
tree46f5bf6cf6f63a95e75e4c1438ecff10444df8eb /src
parentc400ac680f4db86686126876e2d709b1e6099544 (diff)
downloademacs-7f01dd8906cbc8839ffecc55cfa7ff789f3fa298.tar.gz
emacs-7f01dd8906cbc8839ffecc55cfa7ff789f3fa298.zip
New variable 'expose-hidden-buffer' (Bug#75828)
* src/frame.c (make_frame): Handle 'expose-hidden-buffer'. (expose-hidden-buffer): New variable to handle hidden buffers. * src/buffer.c (Fother_buffer): Mention that it does not return a hidden buffer. * lisp/frame.el (make-frame): In doc-string describe handling of hidden buffers. * doc/lispref/frames.texi (Creating Frames): Explain handling of hidden buffers in description of 'make-frame'.
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c3
-rw-r--r--src/frame.c19
2 files changed, 19 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 1b9092b107b..ed2f14ea9c0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1729,7 +1729,8 @@ Buffers not visible in windows are preferred to visible buffers, unless
1729optional second argument VISIBLE-OK is non-nil. Ignore the argument 1729optional second argument VISIBLE-OK is non-nil. Ignore the argument
1730BUFFER unless it denotes a live buffer. If the optional third argument 1730BUFFER unless it denotes a live buffer. If the optional third argument
1731FRAME specifies a live frame, then use that frame's buffer list instead 1731FRAME specifies a live frame, then use that frame's buffer list instead
1732of the selected frame's buffer list. 1732of the selected frame's buffer list. Do not return a hidden buffer - a
1733buffer whose name starts with a space.
1733 1734
1734The buffer is found by scanning the selected or specified frame's buffer 1735The buffer is found by scanning the selected or specified frame's buffer
1735list first, followed by the list of all buffers. If no other buffer 1736list first, followed by the list of all buffers. If no other buffer
diff --git a/src/frame.c b/src/frame.c
index d59b4045c00..4f3c1efc4a7 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1094,8 +1094,9 @@ make_frame (bool mini_p)
1094 { 1094 {
1095 Lisp_Object buf = Fcurrent_buffer (); 1095 Lisp_Object buf = Fcurrent_buffer ();
1096 1096
1097 /* If current buffer is hidden, try to find another one. */ 1097 /* If the current buffer is hidden and shall not be exposed, try to find
1098 if (BUFFER_HIDDEN_P (XBUFFER (buf))) 1098 another one. */
1099 if (BUFFER_HIDDEN_P (XBUFFER (buf)) && NILP (expose_hidden_buffer))
1099 buf = other_buffer_safely (buf); 1100 buf = other_buffer_safely (buf);
1100 1101
1101 /* Use set_window_buffer, not Fset_window_buffer, and don't let 1102 /* Use set_window_buffer, not Fset_window_buffer, and don't let
@@ -7164,6 +7165,20 @@ making the child frame unresponsive to user actions, the default is to
7164iconify the top level frame instead. */); 7165iconify the top level frame instead. */);
7165 iconify_child_frame = Qiconify_top_level; 7166 iconify_child_frame = Qiconify_top_level;
7166 7167
7168 DEFVAR_LISP ("expose-hidden-buffer", expose_hidden_buffer,
7169 doc: /* Non-nil means to make a hidden buffer more visible.
7170A buffer is considered "hidden" if its name starts with a space. By
7171default, many functions disregard hidden buffers. In particular,
7172`make-frame' does not show the current buffer in the new frame's
7173selected window if that buffer is hidden. Rather, `make-frame' will
7174show a buffer that is not hidden instead.
7175
7176If this variable is non-nil, it will override the default behavior and
7177allow `make-frame' to show the current buffer even if its hidden. */);
7178 expose_hidden_buffer = Qnil;
7179 DEFSYM (Qexpose_hidden_buffer, "expose-hidden-buffer");
7180 Fmake_variable_buffer_local (Qexpose_hidden_buffer);
7181
7167 DEFVAR_LISP ("frame-internal-parameters", frame_internal_parameters, 7182 DEFVAR_LISP ("frame-internal-parameters", frame_internal_parameters,
7168 doc: /* Frame parameters specific to every frame. */); 7183 doc: /* Frame parameters specific to every frame. */);
7169#ifdef HAVE_X_WINDOWS 7184#ifdef HAVE_X_WINDOWS