summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-08-22 14:38:49 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-08-22 14:38:49 -0700
commit590dab5a68f4283d53ce79d4633fe1503131baea (patch)
tree2e2452d22d54826cb84e2c5dc976abbb2ed40322 /lisp/window.el
parentcaa2770d1d79f9c8013d6dddcd9e86d05230b26d (diff)
parent8c2946e29b38fa3e0dff6b4d402ba0fda0e03c9b (diff)
downloademacs-590dab5a68f4283d53ce79d4633fe1503131baea.tar.gz
Merge from origin/emacs-25
8c2946e In NEWS describe new handling of window margins (Bug#24193) 0cee66c Facultatively ignore margins when splitting and resizing wind... 8d68147 Document CATEGORY arg to modify-category-entry 8342e74 Document char-script-table's effect on word motion e9ff485 Further fix for 'url-http-create-request' and multibyte strings 0695235 Fix docstring of eval-expression 98b01dd Clarify when 'cursor' property is in effect 75f1882 Convert the remaining strings to unibyte before concatenating d2db5dd Fix bug with handling the bidi cache ccd0e92 * doc/lispref/text.texi (Change Hooks): Minor copyedits. f785ff4 Clarify documentation of before/after-change-functions 3c9cb57 Document use of vectors in keymaps # Conflicts: # src/xdisp.c
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el25
1 files changed, 18 insertions, 7 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 4699e2c5e56..cfa10ea1b0f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1381,10 +1381,21 @@ return the minimum pixel-size of WINDOW."
(let* ((char-size (frame-char-size window t))
(fringes (window-fringes window))
(margins (window-margins window))
+ ;; Let the 'min-margins' parameter override the actual
+ ;; widths of the margins. We allow any number to
+ ;; replace the values specified by `window-margins'.
+ ;; See bug#24193 for the rationale of this parameter.
+ (min-margins (window-parameter window 'min-margins))
+ (left-min-margin (and min-margins
+ (numberp (car min-margins))
+ (car min-margins)))
+ (right-min-margin (and min-margins
+ (numberp (cdr min-margins))
+ (cdr min-margins)))
(pixel-width
(+ (window-safe-min-size window t t)
- (* (or (car margins) 0) char-size)
- (* (or (cdr margins) 0) char-size)
+ (* (or left-min-margin (car margins) 0) char-size)
+ (* (or right-min-margin(cdr margins) 0) char-size)
(car fringes) (cadr fringes)
(window-scroll-bar-width window)
(window-right-divider-width window))))
@@ -4771,7 +4782,7 @@ frame. The selected window is not changed by this function."
(window-sizable-p
parent (- (+ new-pixel-size divider-width)) horizontal
(setq ignore 'preserved) t))
- (error "Window %s too small for splitting (1)" parent)))
+ (error "Window %s too small for splitting" parent)))
((and (> (+ new-pixel-size divider-width
(window-min-size window horizontal nil t))
old-pixel-size)
@@ -4780,7 +4791,7 @@ frame. The selected window is not changed by this function."
window horizontal (setq ignore 'preserved) t))
old-pixel-size))
;; SIZE unspecified, no resizing.
- (error "Window %s too small for splitting (2)" window))))
+ (error "Window %s too small for splitting" window))))
((and (>= pixel-size 0)
(or (>= pixel-size old-pixel-size)
(< new-pixel-size
@@ -4788,7 +4799,7 @@ frame. The selected window is not changed by this function."
;; SIZE specified as new size of old window. If the new size
;; is larger than the old size or the size of the new window
;; would be less than the safe minimum, signal an error.
- (error "Window %s too small for splitting (3)" window))
+ (error "Window %s too small for splitting" window))
(resize
;; SIZE specified, resizing.
(unless (or (window-sizable-p
@@ -4798,13 +4809,13 @@ frame. The selected window is not changed by this function."
parent (- (+ new-pixel-size divider-width)) horizontal
(setq ignore 'preserved) t))
;; If we cannot resize the parent give up.
- (error "Window %s too small for splitting (4)" parent)))
+ (error "Window %s too small for splitting" parent)))
((or (< new-pixel-size
(window-safe-min-pixel-size window horizontal))
(< (- old-pixel-size new-pixel-size)
(window-safe-min-pixel-size window horizontal)))
;; SIZE specification violates minimum size restrictions.
- (error "Window %s too small for splitting (5)" window)))
+ (error "Window %s too small for splitting" window)))
(window--resize-reset frame horizontal)