summaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2014-12-18 18:12:24 +0100
committerMartin Rudalics <rudalics@gmx.at>2014-12-18 18:12:24 +0100
commit47f730e3b6a36d6b3e22b91caac576ec2ac4bd7c (patch)
treea516327425c0cd36f4cc1fe56376fc0860e7ab54 /src/frame.c
parent36c43e95de5e067b7d6a06db479765b4e4a22986 (diff)
downloademacs-47f730e3b6a36d6b3e22b91caac576ec2ac4bd7c.tar.gz
Add code for "preserving" window sizes.
* frame.c (frame_windows_min_size): New argument IGNORE. (adjust_frame_size): When called from change_frame_size call frame_windows_min_size with IGNORE Qt so we can ignore size restrictions. * dired.el (dired-pop-to-buffer): Call fit-window-to-buffer with `preserve-size' t. (dired-mark-pop-up): Preserve size of window showing marked files. * electric.el (Electric-pop-up-window): * help.el (resize-temp-buffer-window): Call fit-window-to-buffer with `preserve-size' t. * minibuffer.el (minibuffer-completion-help): Use `resize-temp-buffer-window' instead of `fit-window-to-buffer' (Bug#19355). Preserve size of completions window. * register.el (register-preview): Preserve size of register preview window. * tmm.el (tmm-add-prompt): Call fit-window-to-buffer with `preserve-size' t (Bug#1291). * window.el (with-displayed-buffer-window): Add calls to `window-preserve-size'. (window-min-pixel-size, window--preservable-size) (window-preserve-size, window-preserved-size) (window--preserve-size, window--min-size-ignore-p): New functions. (window-min-size, window-min-delta, window--resizable) (window--resize-this-window, split-window-below) (split-window-right): Amend doc-string. (adjust-window-trailing-edge): Handle preserving window sizes. Signal user-error instead of an error when there's no window above or below. (window--min-size-1, window-sizable, window--size-fixed-1) (window-size-fixed-p, window--min-delta-1) (frame-windows-min-size, window--max-delta-1, window-resize) (window--resize-child-windows, window--resize-siblings) (enlarge-window, shrink-window, split-window): Handle preserving window sizes. (window--state-put-2): Handle horizontal scroll bars. (window--display-buffer): Call `preserve-size' if asked for. (display-buffer): Mention `preserve-size' alist member in doc-string. (fit-window-to-buffer): New argument PRESERVE-SIZE.
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/frame.c b/src/frame.c
index eaab63a0ea4..31273665e88 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -335,9 +335,9 @@ predicates which report frame's specific UI-related capabilities. */)
}
static int
-frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object pixelwise)
+frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object ignore, Lisp_Object pixelwise)
{
- return XINT (call3 (Qframe_windows_min_size, frame, horizontal, pixelwise));
+ return XINT (call4 (Qframe_windows_min_size, frame, horizontal, ignore, pixelwise));
}
@@ -419,8 +419,10 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit,
/* The following two values are calculated from the old window body
sizes and any "new" settings for scroll bars, dividers, fringes and
margins (though the latter should have been processed already). */
- min_windows_width = frame_windows_min_size (frame, Qt, Qt);
- min_windows_height = frame_windows_min_size (frame, Qnil, Qt);
+ min_windows_width
+ = frame_windows_min_size (frame, Qt, (inhibit == 5) ? Qt : Qnil, Qt);
+ min_windows_height
+ = frame_windows_min_size (frame, Qnil, (inhibit == 5) ? Qt : Qnil, Qt);
if (inhibit >= 2 && inhibit <= 4)
/* If INHIBIT is in [2..4] inhibit if the "old" window sizes stay