Index: frame.el =================================================================== RCS file: /sources/emacs/emacs/lisp/frame.el,v retrieving revision 1.237 diff -u -r1.237 frame.el --- frame.el 21 Jul 2006 07:42:52 -0000 1.237 +++ frame.el 5 Aug 2006 14:36:20 -0000 @@ -1083,17 +1083,35 @@ (t (frame-width (if (framep display) display (selected-frame))))))) +(defcustom display-mm-dimensions-alist nil + "Alist for specifying screen dimensions in millimeters. +Each element of the alist has the form (display . (width . height)), +e.g. (\":0.0\" . (287 . 215)). + +The dimensions will be used for `display-mm-height' and +`display-mm-width' if defined for the respective display." + :version "22.1" + :type '(alist :key-type (string :tag "Display") + :value-type (cons :tag "Dimensions" + (integer :tag "Width") + (integer :tag "Height"))) + :group 'frames) + (defun display-mm-height (&optional display) "Return the height of DISPLAY's screen in millimeters. If the information is unavailable, value is nil." - (and (memq (framep-on-display display) '(x w32 mac)) - (x-display-mm-height display))) + (or (cddr (assoc (or display (frame-parameter nil 'display)) + display-mm-dimensions-alist)) + (and (memq (framep-on-display display) '(x w32 mac)) + (x-display-mm-height display)))) (defun display-mm-width (&optional display) "Return the width of DISPLAY's screen in millimeters. If the information is unavailable, value is nil." - (and (memq (framep-on-display display) '(x w32 mac)) - (x-display-mm-width display))) + (or (cadr (assoc (or display (frame-parameter nil 'display)) + display-mm-dimensions-alist)) + (and (memq (framep-on-display display) '(x w32 mac)) + (x-display-mm-width display)))) (defun display-backing-store (&optional display) "Return the backing store capability of DISPLAY's screen.