unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: 21132@debbugs.gnu.org, flitterio@gmail.com
Subject: bug#21132: 25.0.50; Emacs on Windows crashes evaluating x-frame-geometry in batch mode
Date: Sat, 25 Jul 2015 21:53:45 +0300	[thread overview]
Message-ID: <83y4i4ysp2.fsf@gnu.org> (raw)
In-Reply-To: <55B3D2C3.8060007@gmx.at>

> Date: Sat, 25 Jul 2015 20:17:39 +0200
> From: martin rudalics <rudalics@gmx.at>
> CC: 21132@debbugs.gnu.org
> 
>  >> Emacs built from the latest source on Windows crashes when invoked
>  >> as follows:
>  >>
>  >>    emacs.exe -Q -batch --eval="(x-frame-geometry (selected-frame))"
>  >
>  > Thanks, fixed.
> 
> Do you have any simple guideline how to find similar instances of this
> bug?

Look for unconditional uses of FRAME_W32_WINDOW in code that is not
guaranteed to be invoked in a GUI session.  Functions exposed to Lisp
are an obvious candidate, as in this case.

> And what is the difference between !FRAME_INITIAL_P (f) and
> FRAME_W32_WINDOW (f)?

FRAME_W32_WINDOW is not a predicate.  You probably meant
FRAME_INITIAL_P and FRAME_W32_P.  The difference is the method used to
output text.

> I suppose that !FRAME_INITIAL_P (f) implies
> FRAME_W32_WINDOW (f).

No, it implies (on w32) FRAME_W32_P or FRAME_TERMCAP_P.

> So there are probably cases when we use
> FRAME_W32_WINDOW (f) and FRAME_INITIAL_P (f) holds.  Right?

If there are, we will crash.

> And do we prefer (FRAME_W32_WINDOW (f) != 0) to (!FRAME_W32_WINDOW (f))?

We prefer !FRAME_W32_P (f)

> Also I believe that I should replace FRAME_X_WINDOW by FRAME_W32_WINDOW.

Yes.

>  > I believe similar changes are needed in xfns.c and in nsfns.m, could
>  > someone with access to the relevant OSes please check and apply?
> 
> I'll look into these.

Thanks.





  reply	other threads:[~2015-07-25 18:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-25 16:03 bug#21132: 25.0.50; Emacs on Windows crashes evaluating x-frame-geometry in batch mode Francis Litterio
2015-07-25 16:35 ` Eli Zaretskii
2015-07-25 18:17   ` martin rudalics
2015-07-25 18:53     ` Eli Zaretskii [this message]
2015-07-26 11:27       ` martin rudalics
2015-07-26 14:53         ` Eli Zaretskii
2015-07-27 16:02           ` martin rudalics
2015-07-27 16:25             ` Eli Zaretskii
2015-07-27 16:34               ` martin rudalics
2015-07-27 16:59                 ` Eli Zaretskii
2015-08-24  8:17 ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y4i4ysp2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21132@debbugs.gnu.org \
    --cc=flitterio@gmail.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).