diff options
| author | Martin Rudalics | 2019-03-11 09:57:23 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2019-03-11 09:57:23 +0100 |
| commit | 95373b69b34f9756d2f05b19798b763d22aa5f0a (patch) | |
| tree | ffd55c71f1cccf34fc90aeb56dfeb4e78afb1915 /src/frame.c | |
| parent | 27466c62fdc977e8d3b23c5ae4f529a64ac7374f (diff) | |
| download | emacs-95373b69b34f9756d2f05b19798b763d22aa5f0a.tar.gz emacs-95373b69b34f9756d2f05b19798b763d22aa5f0a.zip | |
Rewrite minibuffer window resizing code
* src/frame.c (resize_mini_frames): New variable.
* src/window.c (resize_mini_window_apply): New function.
(grow_mini_window, shrink_mini_window): Remove PIXELWISE
argument. Call resize_mini_window_apply to apply changes.
(Fresize_mini_window_internal): Call resize_mini_window_apply
to apply changes.
(Qwindow__resize_mini_frame): New symbol.
* src/window.h (grow_mini_window, shrink_mini_window): Adjust
external declarations.
* src/xdisp.c (resize_mini_window): For minibuffer-only frames
call 'window--resize-mini-frame' if resize_mini_frames is
non-nil. Offload parts of logic to grow_mini_window and
shrink_mini_window which are now called without the PIXELWISE
argument.
(Vresize_mini_windows): Mention 'resize-mini-frames' in
doc-string.
* lisp/cus-start.el (resize-mini-frames): Add customization
support.
* lisp/window.el (window--resize-mini-window): Simplify code.
(window--resize-mini-frame): New function.
* doc/lispref/minibuf.texi (Minibuffer Windows): Describe new
option 'resize-mini-frames'.
* etc/NEWS: Mention new option 'resize-mini-frames'.
Diffstat (limited to 'src/frame.c')
| -rw-r--r-- | src/frame.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c index c336369dbb5..46bdf222315 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -6079,6 +6079,19 @@ setting this variable does not change that frame's previous association. | |||
| 6079 | 6079 | ||
| 6080 | This variable is local to the current terminal and cannot be buffer-local. */); | 6080 | This variable is local to the current terminal and cannot be buffer-local. */); |
| 6081 | 6081 | ||
| 6082 | DEFVAR_LISP ("resize-mini-frames", resize_mini_frames, | ||
| 6083 | doc: /* Non-nil means resize minibuffer-only frames automatically. | ||
| 6084 | If this is nil, do not resize minibuffer-only frames automatically. | ||
| 6085 | |||
| 6086 | If this is a function, call that function with the minibuffer-only | ||
| 6087 | frame that shall be resized as sole argument. The buffer of the root | ||
| 6088 | window of that frame is the buffer whose text will be eventually shown | ||
| 6089 | in the minibuffer window. | ||
| 6090 | |||
| 6091 | Any other non-nil value means to resize minibuffer-only frames by | ||
| 6092 | calling `fit-frame-to-buffer'. */); | ||
| 6093 | resize_mini_frames = Qnil; | ||
| 6094 | |||
| 6082 | DEFVAR_LISP ("focus-follows-mouse", focus_follows_mouse, | 6095 | DEFVAR_LISP ("focus-follows-mouse", focus_follows_mouse, |
| 6083 | doc: /* Non-nil if window system changes focus when you move the mouse. | 6096 | doc: /* Non-nil if window system changes focus when you move the mouse. |
| 6084 | You should set this variable to tell Emacs how your window manager | 6097 | You should set this variable to tell Emacs how your window manager |