emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display-mm-width return value off on Windows


From: Kim F. Storm
Subject: Re: display-mm-width return value off on Windows
Date: Tue, 22 Aug 2006 23:38:15 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Ralf Angeli <address@hidden> 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  <address@hidden>
>
>       * 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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-devel

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]