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: Sun, 16 Jul 2006 19:04:33 +0200 Message-ID: References: <87slldpd8s.fsf@neutrino.caeruleus.net> <44AFB1E1.20906@student.lu.se> <8764i7kywu.fsf@neutrino.caeruleus.net> <874pxls3bu.fsf@neutrino.caeruleus.net> <85k66hjmy4.fsf@lola.goethe.zz> <85veq0c9zi.fsf@lola.goethe.zz> <8764hycylh.fsf@neutrino.caeruleus.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1153069528 16839 80.91.229.2 (16 Jul 2006 17:05:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 16 Jul 2006 17:05:28 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 16 19:05:08 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 1G2A3H-0003Xb-F3 for ged-emacs-devel@m.gmane.org; Sun, 16 Jul 2006 19:05:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G2A3G-0007Et-UI for ged-emacs-devel@m.gmane.org; Sun, 16 Jul 2006 13:05:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G2A35-0007Eo-2U for emacs-devel@gnu.org; Sun, 16 Jul 2006 13:04:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G2A33-0007ET-8s for emacs-devel@gnu.org; Sun, 16 Jul 2006 13:04:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G2A33-0007E9-2l for emacs-devel@gnu.org; Sun, 16 Jul 2006 13:04:53 -0400 Original-Received: from [199.232.41.67] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1G2A5W-0000nj-Md for emacs-devel@gnu.org; Sun, 16 Jul 2006 13:07:26 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by mx20.gnu.org with esmtp (Exim 4.52) id 1G2A31-00028B-99 for emacs-devel@gnu.org; Sun, 16 Jul 2006 13:04:51 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1G2A2v-0003Sq-Ci for emacs-devel@gnu.org; Sun, 16 Jul 2006 19:04:45 +0200 Original-Received: from p54a54b78.dip0.t-ipconnect.de ([84.165.75.120]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Jul 2006 19:04:45 +0200 Original-Received: from angeli by p54a54b78.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Jul 2006 19:04:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 88 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: p54a54b78.dip0.t-ipconnect.de Cancel-Lock: sha1:RUtwm9eEQA13hJtHFcTRbSxGszA= 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:57098 Archived-At: --=-=-= * Ralf Angeli (2006-07-16) writes: > So one rather needs screen-dependent or display-dependent values for > screen width and height. (Obviously.) A pragmatic way for specifying > this would be an alist with (DISPLAY . LENGTH) elements as suggested > by Kim (assuming display is equivalent to screen). Here is a patch implementing that approach. I can provide an change log entry once this is settled. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment *** frame.el 06 Apr 2006 19:46:36 +0200 1.236 --- frame.el 16 Jul 2006 18:16:16 +0200 *************** *** 1081,1097 **** (t (frame-width (if (framep display) display (selected-frame))))))) (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))) (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))) (defun display-backing-store (&optional display) "Return the backing store capability of DISPLAY's screen. --- 1081,1115 ---- (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." ! (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." ! (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. --=-=-= Does somebody have a multi-screen setup for testing this patch? With my local X server `(display-screens)' returns (":0.0"). I assume an additional screen would show up as ":0.1" in that list. But I don't know about Windows and Mac OS. On Windows `(display-screens)' returns ("") and I am wondering what would show up with a multi-screen setup. -- Ralf --=-=-= 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 --=-=-=--