]> code.delx.au - gnu-emacs/commitdiff
Don't have help functions call x-display-pixel-width/-height on ttys
authorMartin Rudalics <rudalics@gmx.at>
Fri, 18 Dec 2015 10:03:03 +0000 (11:03 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Fri, 18 Dec 2015 10:03:03 +0000 (11:03 +0100)
* lisp/help.el (temp-buffer-max-height, temp-buffer-max-width):
Don't call x-display-pixel-width/-height on ttys.

lisp/help.el

index c558b652b7ecf980cd9b24052ba9d7ab72a4db5d..d6cfae44183063cf386877cd90557e2296be00dd 100644 (file)
@@ -1069,7 +1069,7 @@ is currently activated with completion."
 ;;; Automatic resizing of temporary buffers.
 (defcustom temp-buffer-max-height
   (lambda (buffer)
-    (if (eq (selected-window) (frame-root-window))
+    (if (and (display-graphic-p) (eq (selected-window) (frame-root-window)))
        (/ (x-display-pixel-height) (frame-char-height) 2)
       (/ (- (frame-height) 2) 2)))
   "Maximum height of a window displaying a temporary buffer.
@@ -1086,7 +1086,7 @@ function is called, the window to be resized is selected."
 
 (defcustom temp-buffer-max-width
   (lambda (buffer)
-    (if (eq (selected-window) (frame-root-window))
+    (if (and (display-graphic-p) (eq (selected-window) (frame-root-window)))
        (/ (x-display-pixel-width) (frame-char-width) 2)
       (/ (- (frame-width) 2) 2)))
   "Maximum width of a window displaying a temporary buffer.