From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ralf Angeli Newsgroups: gmane.emacs.devel Subject: Re: display-mm-width return value off on Windows Date: Thu, 24 Aug 2006 18:14:36 +0200 Message-ID: <874pw2qff7.fsf@neutrino.caeruleus.net> References: <44E73CD6.80207@gnu.org> <874pw86284.fsf@neutrino.caeruleus.net> <44E79204.9030505@gnu.org> <87y7tj4y5l.fsf@neutrino.caeruleus.net> <87odudzyev.fsf@neutrino.caeruleus.net> <87psetwbwl.fsf@neutrino.caeruleus.net> <871wr7wbgn.fsf@neutrino.caeruleus.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1156436174 31084 80.91.229.2 (24 Aug 2006 16:16:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 24 Aug 2006 16:16:14 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 24 18:16:11 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GGHrY-0000wx-D7 for ged-emacs-devel@m.gmane.org; Thu, 24 Aug 2006 18:15:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGHrX-0004rn-KJ for ged-emacs-devel@m.gmane.org; Thu, 24 Aug 2006 12:15:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GGHqs-0004Ca-CH for emacs-devel@gnu.org; Thu, 24 Aug 2006 12:14:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GGHqq-00048r-0F for emacs-devel@gnu.org; Thu, 24 Aug 2006 12:14:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GGHqp-00048Z-Ot for emacs-devel@gnu.org; Thu, 24 Aug 2006 12:14:39 -0400 Original-Received: from [212.227.126.186] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GGHyv-0003od-6x for emacs-devel@gnu.org; Thu, 24 Aug 2006 12:23:01 -0400 Original-Received: from [84.165.63.65] (helo=neutrino.caeruleus.net) by mrelayeu.kundenserver.de (node=mrelayeu2) with ESMTP (Nemesis), id 0MKwtQ-1GGHqn0BiW-0001Lk; Thu, 24 Aug 2006 18:14:38 +0200 Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Thu, 24 Aug 2006 00:44:14 +0200") X-Provags-ID: kundenserver.de abuse@kundenserver.de login:abf9ffac21f8345504ac40c53d3b40ba X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58818 Archived-At: --=-=-= * Kim F. Storm (2006-08-24) writes: > Ralf Angeli writes: > >> Thanks for spotting this. I think it should return nil. More >> specifically: If display-mm-* is called without an argument it should >> return nil if the display the current frame is located on is not a >> graphical one. If display-mm-* is called with an argument it should >> return nil if the target display is unavailable or not a graphical >> one. I can change the patch accordingly ... > > Pls. do. You can find the updated patch attached. The change log entry posted before is still valid. -- Ralf --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Index: frame.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/frame.el,v retrieving revision 1.238 diff -u -r1.238 frame.el --- frame.el 20 Aug 2006 14:43:29 -0000 1.238 +++ frame.el 24 Aug 2006 16:13:09 -0000 @@ -1083,17 +1083,42 @@ (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. + +If there is an element with the special value t as display +indicator, it will be used for all graphical displays not +explicitely specified." + :version "22.1" + :type '(alist :key-type (choice (string :tag "Display name") + (const :tag "Default" t)) + :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)) + (cddr (assoc t display-mm-dimensions-alist)) + (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)) + (cadr (assoc t display-mm-dimensions-alist)) + (x-display-mm-width display)))) (defun display-backing-store (&optional display) "Return the backing store capability of DISPLAY's screen. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--