From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: display-mm-width return value off on Windows Date: Tue, 22 Aug 2006 23:38:15 +0200 Message-ID: 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> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1156282817 26001 80.91.229.2 (22 Aug 2006 21:40:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Aug 2006 21:40:17 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 22 23:40: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 1GFdyR-00020P-JR for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2006 23:39:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GFdyQ-0003q8-W4 for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2006 17:39:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GFdyD-0003nF-Ip for emacs-devel@gnu.org; Tue, 22 Aug 2006 17:39:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GFdyB-0003lt-Rp for emacs-devel@gnu.org; Tue, 22 Aug 2006 17:39:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GFdyB-0003lq-Lr for emacs-devel@gnu.org; Tue, 22 Aug 2006 17:39:35 -0400 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GFe5s-0002fM-CZ for emacs-devel@gnu.org; Tue, 22 Aug 2006 17:47:32 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepc.post.tele.dk (Postfix) with SMTP id 287FA8A0030; Tue, 22 Aug 2006 23:39:30 +0200 (CEST) Original-To: Ralf Angeli In-Reply-To: (Ralf Angeli's message of "Tue, 22 Aug 2006 21:16:46 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:58750 Archived-At: Ralf Angeli writes: > * Ralf Angeli (2006-08-22) writes: > >> The change to frame.el would >> certainly be a change fixing this. I am currently extending it a bit >> to allow the user to specify a default value for all displays not >> matching provided display names. I'll post it later today. > > You can find it attached. Here is a change log entry: > > 2006-08-22 Ralf Angeli > > * frame.el (display-mm-dimensions-alist): New variable. > (display-mm-height, display-mm-width): Use it. Looks good to me. One question: Should they really return the default value with for emacs -nw ? Or nil as before? > > -- > Ralf > > 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 22 Aug 2006 19:02:11 -0000 > *************** > *** 1083,1099 **** > (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. > --- 1083,1124 ---- > (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 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." > ! (or (cddr (assoc (or display (frame-parameter nil 'display)) > ! display-mm-dimensions-alist)) > ! (cddr (assoc t 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)) > ! (cadr (assoc t 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. > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel -- Kim F. Storm http://www.cua.dk