GNU bug report logs - #18636
24.4.50; doc of `display-monitor-attributes-list' - DISPLAY? FRAME?

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 5 Oct 2014 19:06:02 UTC

Severity: minor

Found in version 24.4.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18636 in the body.
You can then email your comments to 18636 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#18636; Package emacs. (Sun, 05 Oct 2014 19:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 05 Oct 2014 19:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4.50; doc of `display-monitor-attributes-list' - DISPLAY? FRAME?
Date: Sun, 5 Oct 2014 12:05:19 -0700 (PDT)
I find it unclear that the optional parameter of
`display-monitor-attributes-list' is named DISPLAY, and is referred to
as a display in the doc string, and yet in `frame-monitor-attributes'
it is arg FRAME that is passed to `display-monitor-attributes-list'.

Is the argument of `display-monitor-attributes-list' a display or a
frame?

What about other functions, such as `display-pixel-height', which call
`display-monitor-attributes-list'?  They seem to pass their DISPLAY arg
to it.  Is this arg too something that can be (or is always?) a frame?
The doc string of `display-pixel-height' (for example) says:

  "If DISPLAY is omitted or nil, it defaults to the selected frame's
   display."

That would seem to suggest that a frame is not a display, but rather it
_has_ a display.

And there is a frame parameter `display', whose value is "The display on
which to open this frame.  It should be a string of the form
`"HOST:DPY.SCREEN"', just like the `DISPLAY' environment variable.

This suggests that a display is not a frame.  So how is it that
`frame-monitor-attributes' passes a FRAME to
`display-monitor-attributes-list', which supposedly expects a display
instead?

Please try to clear up some of this confusion in the doc and doc
strings.


In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-09-15 on LEG570
Bzr revision: 117884 dancol <at> dancol.org-20140915050944-sqsajysnwef51f9m
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18636; Package emacs. (Sun, 05 Oct 2014 19:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 18636 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 18636 <at> debbugs.gnu.org
Subject: Re: bug#18636: 24.4.50;
 doc of `display-monitor-attributes-list' - DISPLAY? FRAME?
Date: Sun, 05 Oct 2014 22:27:03 +0300
> Date: Sun, 5 Oct 2014 12:05:19 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> 
> I find it unclear that the optional parameter of
> `display-monitor-attributes-list' is named DISPLAY, and is referred to
> as a display in the doc string, and yet in `frame-monitor-attributes'
> it is arg FRAME that is passed to `display-monitor-attributes-list'.
> 
> Is the argument of `display-monitor-attributes-list' a display or a
> frame?

It can be either.

> What about other functions, such as `display-pixel-height', which call
> `display-monitor-attributes-list'?  They seem to pass their DISPLAY arg
> to it.  Is this arg too something that can be (or is always?) a frame?
> The doc string of `display-pixel-height' (for example) says:
> 
>   "If DISPLAY is omitted or nil, it defaults to the selected frame's
>    display."
> 
> That would seem to suggest that a frame is not a display, but rather it
> _has_ a display.

A frame is not a display, but these functions accept either one.

If you make a list of the functions where the doc string is not
explicit about this fact, I will fix them.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18636; Package emacs. (Mon, 06 Oct 2014 02:42:02 GMT) Full text and rfc822 format available.

Message #11 received at 18636 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Cc: 18636 <at> debbugs.gnu.org
Subject: RE: bug#18636: 24.4.50;	doc of `display-monitor-attributes-list' -
 DISPLAY? FRAME?
Date: Sun, 5 Oct 2014 19:41:21 -0700 (PDT)
> > I find it unclear that the optional parameter of
> > `display-monitor-attributes-list' is named DISPLAY, and is
> > referred to as a display in the doc string, and yet in
> > `frame-monitor-attributes' it is arg FRAME that is passed
> > to `display-monitor-attributes-list'.
> >
> > Is the argument of `display-monitor-attributes-list' a
> > display or a frame?
> 
> It can be either.

OK.  Then the doc should say so.  And it should call out the
relation between the two.  For example, if a frame is passed
and its display is used (= its `display' frame parameter),
then say so.

> > What about other functions, such as `display-pixel-height', which
> > call `display-monitor-attributes-list'?  They seem to pass their
> > DISPLAY arg to it.  Is this arg too something that can be (or
> > is always?) a frame? The doc string of `display-pixel-height'
> > (for example) says:
> >
> >   "If DISPLAY is omitted or nil, it defaults to the selected
> >    frame's display."
> >
> > That would seem to suggest that a frame is not a display, but
> > rather it _has_ a display.
> 
> A frame is not a display, but these functions accept either one.

Their doc should say so.

> If you make a list of the functions where the doc string is not
> explicit about this fact, I will fix them.

Thank you.  I think this is the case for all of the 20 functions
described in (elisp) `Display Feature Testing', but there might
be others as well.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 08 Oct 2014 10:24:02 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Wed, 08 Oct 2014 10:24:03 GMT) Full text and rfc822 format available.

Message #16 received at 18636-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 18636-done <at> debbugs.gnu.org
Subject: Re: bug#18636: 24.4.50;
 doc of `display-monitor-attributes-list' - DISPLAY? FRAME?
Date: Wed, 08 Oct 2014 13:24:01 +0300
> Date: Sun, 5 Oct 2014 19:41:21 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 18636 <at> debbugs.gnu.org
> 
> > > I find it unclear that the optional parameter of
> > > `display-monitor-attributes-list' is named DISPLAY, and is
> > > referred to as a display in the doc string, and yet in
> > > `frame-monitor-attributes' it is arg FRAME that is passed
> > > to `display-monitor-attributes-list'.
> > >
> > > Is the argument of `display-monitor-attributes-list' a
> > > display or a frame?
> > 
> > It can be either.
> 
> OK.  Then the doc should say so.

Done on the emacs-24 branch (revision 117559).

> And it should call out the
> relation between the two.  For example, if a frame is passed
> and its display is used (= its `display' frame parameter),
> then say so.

That's not what happens, though.  Each function extracts the info it
needs from whatever kind of argument it is passed, and then uses that
info.

> > > What about other functions, such as `display-pixel-height', which
> > > call `display-monitor-attributes-list'?  They seem to pass their
> > > DISPLAY arg to it.  Is this arg too something that can be (or
> > > is always?) a frame? The doc string of `display-pixel-height'
> > > (for example) says:
> > >
> > >   "If DISPLAY is omitted or nil, it defaults to the selected
> > >    frame's display."
> > >
> > > That would seem to suggest that a frame is not a display, but
> > > rather it _has_ a display.
> > 
> > A frame is not a display, but these functions accept either one.
> 
> Their doc should say so.

Done.

> > If you make a list of the functions where the doc string is not
> > explicit about this fact, I will fix them.
> 
> Thank you.  I think this is the case for all of the 20 functions
> described in (elisp) `Display Feature Testing', but there might
> be others as well. 

Done.

> > > In (elisp) `Basic Parameters' I see this description of frame
> > > parameter `display':
> > >
> > >   The display on which to open this frame.  It should be a string
> > >   of the form `"HOST:DPY.SCREEN"', just like the `DISPLAY'
> > >   environment variable.
> > >
> > > But if I evaluate `(frame-parameters)' on MS Windows I see this
> > > value for parameter `display': "w32".
> > >
> > > "w32" does not seem to fit the form `"HOST:DPY.SCREEN"'.  What
> > > gives?
> > 
> > Emacs on MS-Windows doesn't support the notion of 'display', so all
> > frames return the same value of that parameter.
> 
> OK, then the doc should mention this, or at least say that the
> string might not take the form "HOST:DPY.SCREEN" on some platforms,
> and preferably say something about what to expect on the
> exceptional platforms (and perhaps give some idea of what use the
> exceptional value is - what it can be used for, or what info it
> conveys).

Done.

> > > And why is that string surrounded by `...'?
> > 
> > An artifact of Texinfo markup.
> 
> I see.  Is that then correct, or should the `...' be absent?
> There are strings in the manual that are not surrounded by `...'.

I fixed the markup.

> > > And why aren't the components of that "form" described: What are
> > > acceptable values for HOST, DPY, and SCREEN?
> > 
> > Users on X already know what they are; users on other systems don't
> > need to know, because this is not supported.  Either way, this
> > notion is not an Emacs invention, it is a feature of the X
> > window system.
> 
> Then please say that.  E.g., say that the value is useful only for
> X Window, or only relevant for it.  If the function itself has no
> use beyond X Window, then please make that clear.

Done, and also improved the description of the X form.

> From: Andy Moreton <andrewjmoreton <at> gmail.com>
> Date: Tue, 07 Oct 2014 19:35:28 +0100
> 
> > Oh, and I think this is no longer about the docs, so probably a new
> > bug report is in order, specifically about restoring frames on
> > multi-monitor displays.

> True, as long as the meaning of geometry/workarea and the coordinate
> system are given a little more detail in the docs.

Done.

I'm closing this bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18636; Package emacs. (Wed, 08 Oct 2014 10:46:02 GMT) Full text and rfc822 format available.

Message #19 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andy Moreton <andrewjmoreton <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#18636: 24.4.50;
 doc of `display-monitor-attributes-list' - DISPLAY? FRAME?
Date: Wed, 08 Oct 2014 11:44:45 +0100
On Wed 08 Oct 2014, Eli Zaretskii wrote:

> Done on the emacs-24 branch (revision 117559).

Thanks for doing this Eli. The lisp example you added for
'display-monitor-attributes-list' contains a typo from my email:

(((geometry 0 0 1920 1080)   ;; Left hand monitor
  (workarea 0 0 1920 1050)   ;; Bottom of screen used for task bar
  task bar

The third line containing "task bar" should be removed as it should have
been part of the comment on the previous line. Sorry!

    AndyM





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18636; Package emacs. (Wed, 08 Oct 2014 11:18:01 GMT) Full text and rfc822 format available.

Message #22 received at 18636 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andy Moreton <andrewjmoreton <at> gmail.com>
Cc: 18636 <at> debbugs.gnu.org
Subject: Re: bug#18636: 24.4.50;
 doc of `display-monitor-attributes-list' - DISPLAY? FRAME?
Date: Wed, 08 Oct 2014 14:17:41 +0300
> From: Andy Moreton <andrewjmoreton <at> gmail.com>
> Date: Wed, 08 Oct 2014 11:44:45 +0100
> 
> On Wed 08 Oct 2014, Eli Zaretskii wrote:
> 
> > Done on the emacs-24 branch (revision 117559).
> 
> Thanks for doing this Eli. The lisp example you added for
> 'display-monitor-attributes-list' contains a typo from my email:
> 
> (((geometry 0 0 1920 1080)   ;; Left hand monitor
>   (workarea 0 0 1920 1050)   ;; Bottom of screen used for task bar
>   task bar
> 
> The third line containing "task bar" should be removed as it should have
> been part of the comment on the previous line. Sorry!

Thanks, fixed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18636; Package emacs. (Wed, 08 Oct 2014 13:21:01 GMT) Full text and rfc822 format available.

Message #25 received at 18636-done <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 18636-done <at> debbugs.gnu.org
Subject: RE: bug#18636: 24.4.50;	doc of `display-monitor-attributes-list' -
 DISPLAY? FRAME?
Date: Wed, 8 Oct 2014 06:20:49 -0700 (PDT)
> > > > Is the argument of `display-monitor-attributes-list' a
> > > > display or a frame?
> > >
> > > It can be either.
> > OK.  Then the doc should say so.
> Done on the emacs-24 branch (revision 117559).

Thanks.

> > And it should call out the
> > relation between the two.  For example, if a frame is passed
> > and its display is used (= its `display' frame parameter),
> > then say so.
> 
> That's not what happens, though.  Each function extracts the info it
> needs from whatever kind of argument it is passed, and then uses
> that info.

I said, "For example". Whatever the actual relation between the
two is, it should be described.  (Descriptions like "the information
it needs" and "that info" are OK for here, but would not be helpful
in the doc string.)

> Done.
> Done.
> Done.
> I fixed the markup.
> Done, and also improved the description of the X form.
> Done.

Thx * 6.

> I'm closing this bug.

Great. Thanks. (Haven't seen the result yet, but I'm sure it's good.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18636; Package emacs. (Wed, 08 Oct 2014 13:33:02 GMT) Full text and rfc822 format available.

Message #28 received at 18636 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 18636 <at> debbugs.gnu.org
Subject: Re: bug#18636: 24.4.50;
 doc of `display-monitor-attributes-list' - DISPLAY? FRAME?
Date: Wed, 08 Oct 2014 16:32:38 +0300
> Date: Wed, 8 Oct 2014 06:20:49 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 18636-done <at> debbugs.gnu.org
> 
> > > And it should call out the
> > > relation between the two.  For example, if a frame is passed
> > > and its display is used (= its `display' frame parameter),
> > > then say so.
> > 
> > That's not what happens, though.  Each function extracts the info it
> > needs from whatever kind of argument it is passed, and then uses
> > that info.
> 
> I said, "For example". Whatever the actual relation between the
> two is, it should be described.  (Descriptions like "the information
> it needs" and "that info" are OK for here, but would not be helpful
> in the doc string.)

I'm not sure what you think the documentation should tell about this,
and why.  Each function needs something different from its argument;
surely, describing all that in the doc string is counter-productive.
Whoever needs those details, should read the code.

IOW, what other details are required to correctly invoke and use these
functions?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18636; Package emacs. (Wed, 08 Oct 2014 14:05:02 GMT) Full text and rfc822 format available.

Message #31 received at 18636 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 18636 <at> debbugs.gnu.org
Subject: RE: bug#18636: 24.4.50;	doc of `display-monitor-attributes-list' -
 DISPLAY? FRAME?
Date: Wed, 8 Oct 2014 07:04:51 -0700 (PDT)
> > > > And it should call out the
> > > > relation between the two.  For example, if a frame is passed
> > > > and its display is used (= its `display' frame parameter),
> > > > then say so.
> > >
> > > That's not what happens, though.  Each function extracts the
> > > info it needs from whatever kind of argument it is passed, and
> > > then uses that info.
> >
> > I said, "For example". Whatever the actual relation between the
> > two is, it should be described.  (Descriptions like "the
> > information it needs" and "that info" are OK for here, but would
> > not be helpful in the doc string.)
> 
> I'm not sure what you think the documentation should tell about
> this, and why.  Each function needs something different from its argument;
> surely, describing all that in the doc string is counter-productive.
> Whoever needs those details, should read the code.
> 
> IOW, what other details are required to correctly invoke and use
> these functions?

Dunno what other details are needed to understand these functions.
That was the point.

I'm not looking for implementation details.  I'm guessing that a
description of the function, and a good understanding of it, involves
some description/understanding of the argument and what it means
to the function.  What the function needs it for - not in terms of
just what it does with it, but in logical terms - why it is required.

Maybe no more info is needed - dunno.  But usually a user can tell
why a given argument might have a value of different types, e.g. a
buffer or a string that names a buffer.  The connection here, between
a frame arg value and a display arg value, is not obvious.  I was
guessing that what the function needs, ultimately, is a display, and
that if given a frame it uses the frame's display.  But apparently 
that is not the connection.

I'm in the dark on this.  Use your own judgment.  If you think
nothing is unclear or missing, that's good enough for me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#18636; Package emacs. (Wed, 08 Oct 2014 14:11:02 GMT) Full text and rfc822 format available.

Message #34 received at 18636 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 18636 <at> debbugs.gnu.org
Subject: Re: bug#18636: 24.4.50;
 doc of `display-monitor-attributes-list' - DISPLAY? FRAME?
Date: Wed, 08 Oct 2014 17:10:31 +0300
> Date: Wed, 8 Oct 2014 07:04:51 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 18636 <at> debbugs.gnu.org
> 
> > IOW, what other details are required to correctly invoke and use
> > these functions?
> 
> Dunno what other details are needed to understand these functions.
> That was the point.
> 
> I'm not looking for implementation details.  I'm guessing that a
> description of the function, and a good understanding of it, involves
> some description/understanding of the argument and what it means
> to the function.  What the function needs it for - not in terms of
> just what it does with it, but in logical terms - why it is required.
> 
> Maybe no more info is needed - dunno.  But usually a user can tell
> why a given argument might have a value of different types, e.g. a
> buffer or a string that names a buffer.  The connection here, between
> a frame arg value and a display arg value, is not obvious.  I was
> guessing that what the function needs, ultimately, is a display, and
> that if given a frame it uses the frame's display.  But apparently 
> that is not the connection.
> 
> I'm in the dark on this.  Use your own judgment.  If you think
> nothing is unclear or missing, that's good enough for me.

In my judgment, nothing else is needed.  Most functions just need the
type of the frames on display, which can be gleaned from any of the
possible argument types.  The other need the screen used by the
display, which again can be gotten from any argument type.

IOW, these arguments serve as proxies to the information needed by the
functions.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 06 Nov 2014 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.