diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-10-10 11:00:35 +0200 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-10-10 11:00:35 +0200 |
commit | f7e7ff4fb16bf8fc8e7662f21cd9843e9eb648e8 (patch) | |
tree | 8757f25ff7948b6b045bd60f5adf6ebf91ed75ee /lisp/doc-view.el | |
parent | 138990bbda7ab228e3fde44710426c474b2c1086 (diff) | |
parent | 5824c209ba17b97978519ea62478c57010311e88 (diff) | |
download | emacs-f7e7ff4fb16bf8fc8e7662f21cd9843e9eb648e8.tar.gz emacs-f7e7ff4fb16bf8fc8e7662f21cd9843e9eb648e8.tar.bz2 emacs-f7e7ff4fb16bf8fc8e7662f21cd9843e9eb648e8.zip |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/doc-view.el')
-rw-r--r-- | lisp/doc-view.el | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 8aaf38aab21..02d89650b8b 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -910,17 +910,27 @@ Resize the containing frame if needed." (width-diff (- img-width win-width)) (height-diff (- img-height win-height)) (new-frame-params + ;; If we can't resize the window, try and resize the frame. + ;; We used to compare the `window-width/height` and the + ;; `frame-width/height` instead of catching the errors, but + ;; it's too fiddly (e.g. in the presence of the miniwindow, + ;; the height the frame should be equal to the height of the + ;; root window +1). (append - (if (= (window-width) (frame-width)) - `((width . (text-pixels - . ,(+ (frame-text-width) width-diff)))) - (enlarge-window (/ width-diff (frame-char-width)) 'horiz) - nil) - (if (= (window-height) (frame-height)) - `((height . (text-pixels - . ,(+ (frame-text-height) height-diff)))) - (enlarge-window (/ height-diff (frame-char-height)) nil) - nil)))) + (condition-case nil + (progn + (enlarge-window (/ width-diff (frame-char-width)) 'horiz) + nil) + (error + `((width . (text-pixels + . ,(+ (frame-text-width) width-diff)))))) + (condition-case nil + (progn + (enlarge-window (/ height-diff (frame-char-height)) nil) + nil) + (error + `((height . (text-pixels + . ,(+ (frame-text-height) height-diff))))))))) (when new-frame-params (modify-frame-parameters (selected-frame) new-frame-params)))) |