diff options
| author | Martin Rudalics | 2014-12-18 18:12:24 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-12-18 18:12:24 +0100 |
| commit | 47f730e3b6a36d6b3e22b91caac576ec2ac4bd7c (patch) | |
| tree | a516327425c0cd36f4cc1fe56376fc0860e7ab54 /src | |
| parent | 36c43e95de5e067b7d6a06db479765b4e4a22986 (diff) | |
| download | emacs-47f730e3b6a36d6b3e22b91caac576ec2ac4bd7c.tar.gz emacs-47f730e3b6a36d6b3e22b91caac576ec2ac4bd7c.zip | |
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')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/frame.c | 10 | ||||
| -rw-r--r-- | src/window.c | 6 |
3 files changed, 14 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2b125d52723..6fabfb49ea4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-12-18 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * frame.c (frame_windows_min_size): New argument IGNORE. | ||
| 4 | (adjust_frame_size): When called from change_frame_size call | ||
| 5 | frame_windows_min_size with IGNORE Qt so we can ignore size | ||
| 6 | restrictions. | ||
| 7 | |||
| 1 | 2014-12-18 Eli Zaretskii <eliz@gnu.org> | 8 | 2014-12-18 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | * font.c (Ffont_info): Add more font information to the vector | 10 | * font.c (Ffont_info): Add more font information to the vector |
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. */) | |||
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | static int | 337 | static int |
| 338 | frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object pixelwise) | 338 | frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object ignore, Lisp_Object pixelwise) |
| 339 | { | 339 | { |
| 340 | return XINT (call3 (Qframe_windows_min_size, frame, horizontal, pixelwise)); | 340 | return XINT (call4 (Qframe_windows_min_size, frame, horizontal, ignore, pixelwise)); |
| 341 | } | 341 | } |
| 342 | 342 | ||
| 343 | 343 | ||
| @@ -419,8 +419,10 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, | |||
| 419 | /* The following two values are calculated from the old window body | 419 | /* The following two values are calculated from the old window body |
| 420 | sizes and any "new" settings for scroll bars, dividers, fringes and | 420 | sizes and any "new" settings for scroll bars, dividers, fringes and |
| 421 | margins (though the latter should have been processed already). */ | 421 | margins (though the latter should have been processed already). */ |
| 422 | min_windows_width = frame_windows_min_size (frame, Qt, Qt); | 422 | min_windows_width |
| 423 | min_windows_height = frame_windows_min_size (frame, Qnil, Qt); | 423 | = frame_windows_min_size (frame, Qt, (inhibit == 5) ? Qt : Qnil, Qt); |
| 424 | min_windows_height | ||
| 425 | = frame_windows_min_size (frame, Qnil, (inhibit == 5) ? Qt : Qnil, Qt); | ||
| 424 | 426 | ||
| 425 | if (inhibit >= 2 && inhibit <= 4) | 427 | if (inhibit >= 2 && inhibit <= 4) |
| 426 | /* If INHIBIT is in [2..4] inhibit if the "old" window sizes stay | 428 | /* If INHIBIT is in [2..4] inhibit if the "old" window sizes stay |
diff --git a/src/window.c b/src/window.c index ca2bc74fcf4..2177a1d3966 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4135,11 +4135,7 @@ values. */) | |||
| 4135 | 4135 | ||
| 4136 | /* Resize frame F's windows when number of lines of F is set to SIZE. | 4136 | /* Resize frame F's windows when number of lines of F is set to SIZE. |
| 4137 | HORFLAG 1 means resize windows when number of columns of F is set to | 4137 | HORFLAG 1 means resize windows when number of columns of F is set to |
| 4138 | SIZE. PIXELWISE 1 means to interpret SIZE as pixels. | 4138 | SIZE. PIXELWISE 1 means to interpret SIZE as pixels. */ |
| 4139 | |||
| 4140 | This function can delete all windows but the selected one in order to | ||
| 4141 | satisfy the request. The result will be meaningful if and only if | ||
| 4142 | F's windows have meaningful sizes when you call this. */ | ||
| 4143 | void | 4139 | void |
| 4144 | resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) | 4140 | resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) |
| 4145 | { | 4141 | { |