all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dan.colascione@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] system-type cygwin with window-system w32
Date: Mon, 18 Jul 2011 10:04:31 -0700	[thread overview]
Message-ID: <4E24679F.5080807@gmail.com> (raw)
In-Reply-To: <83r55n7dsv.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2822 bytes --]

On 7/18/11 9:29 AM, Eli Zaretskii wrote:
>> Date: Mon, 18 Jul 2011 03:33:59 -0700
>> From: Daniel Colascione <dan.colascione@gmail.com>
>> CC: emacs-devel@gnu.org
>>
>>>> -  if (!hprevinst)
>>>> -    {
>>>> -      w32_init_class (hinst);
>>>> -    }
>>>> +  w32_init_class (hinst);
>>>
>>> Not sure why the test was deleted here.  Can you explain?
>>
>> hprevinst isn't trivially available under Cygwin, and I don't see what
>> the test is buying us: class registration is inexpensive.
> 
> But then for Cygwin the condition will always be false, and the net
> effect is to always call the function, as you wanted, right?  So I
> would rather we left the code alone.

We'd still need the variable with your proposal, and I don't see what
the existing behavior has, even in the NT case.

>>>> +  htext = GlobalAlloc (GMEM_MOVEABLE | GMEM_DDESHARE, bytes);
>>>> +  if (!htext)
>>>> +    error ("GlobalAlloc: %s", w32_strerror (GetLastError ()));
>>>
>>> Such cryptic error messages are not useful, because users are not
>>> required to know what GlobalAlloc is.  Please modify the text to be
>>> more palatable to mere mortals (here and elsewhere in this part of the
>>> patch).
>>
>> Well, it's better than what we used to do much of the time, which was to
>> not check error codes at all.  How would you suggest changing the
>> messages?
> 
> How about calling memory_full?
> 
> Or maybe error ("Not enough memory <TO DO WHATEVER THIS CODE DOES>") ?

The error isn't necessarily fatal --- and in general (speaking to other
instances of w32_strerror in the patch) we don't always know what
exactly went wrong.  It'd be nice to give users an opportunity to figure
it out.  Maybe we can recognize a subset of error codes and forward
those to memory_full.

>> We could just the UI thread for this purpose instead of a dedicated one,
> 
> This is what I had in mind as the alternative, yes.
> 
>> What if I want to create a GUI-less Emacs that can nevertheless
>> can interact with the system clipboard?
> 
> GUI-less Emacs normally doesn't interact with the clipboard, so
> there's no need to choose a design that complicates things just
> because we would like to make this feature available on a single
> platform.

The complexity has to be present regardless.

> Anyway, I'm hardly an expert on this particular issue (i.e. Windows
> GUI and the message pump).  I'm just worried by the fact that we will
> have 2 threads calling GetMessage; in my experience this could lead to
> hard-to-debug problems.

Calling GetMessage in two threads is very common and well-supported, and
won't by itself cause problems. If anything, separating the message
loops makes the program more robust --- each message loop is less
complex and thereby easier to understand.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2011-07-18 17:04 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-18  0:01 [PATCH] system-type cygwin with window-system w32 Daniel Colascione
2011-07-18  0:06 ` Daniel Colascione
2011-07-18  6:13 ` Eli Zaretskii
2011-07-18  6:29   ` Daniel Colascione
2011-07-18  8:53     ` Eli Zaretskii
2011-07-18 10:10       ` Daniel Colascione
2011-07-18 16:04         ` Paul Eggert
2011-07-18 16:19         ` Eli Zaretskii
2011-07-18 13:55     ` Jason Rumney
2011-07-18 16:13     ` Paul Eggert
2011-07-18 17:34       ` Andreas Schwab
2011-07-18  6:53 ` Eli Zaretskii
2011-07-18  7:01   ` Daniel Colascione
2011-07-18  9:04     ` Eli Zaretskii
2011-07-18  9:41       ` Daniel Colascione
2011-07-18 10:10         ` Eli Zaretskii
2011-07-18 10:49           ` Daniel Colascione
2011-07-18 11:22             ` Juanma Barranquero
2011-07-18 16:41             ` Eli Zaretskii
2011-07-18 16:48               ` Daniel Colascione
2011-07-18 17:08                 ` Eli Zaretskii
2011-07-18 22:08             ` Richard Stallman
2011-07-18 22:24               ` Daniel Colascione
2011-07-18 22:45                 ` David Kastrup
2011-07-18 22:56                   ` Daniel Colascione
2011-07-19 16:49                     ` Richard Stallman
2011-07-21  1:44               ` Lennart Borgman
2011-07-18 22:08             ` Richard Stallman
2011-07-18 13:31       ` Jason Rumney
2011-07-18 13:46         ` Richard Riley
2011-07-18  8:42 ` Eli Zaretskii
2011-07-18 10:33   ` Daniel Colascione
2011-07-18 16:29     ` Eli Zaretskii
2011-07-18 17:04       ` Daniel Colascione [this message]
2011-07-18 15:54 ` Stefan Monnier
2011-07-18 15:55 ` Stefan Monnier
2011-07-18 17:37 ` Andreas Schwab
  -- strict thread matches above, loose matches on Subject: below --
2011-07-18 17:33 grischka
2011-07-18 17:50 ` Daniel Colascione
2011-07-18 18:08   ` Daniel Colascione
2011-07-18 18:52     ` grischka
2011-07-18 19:11       ` Daniel Colascione
2011-07-18 21:01         ` grischka
2011-07-19  2:58           ` Eli Zaretskii
2011-07-19  2:59             ` Daniel Colascione
2011-07-21 17:44           ` Lennart Borgman
2011-07-22  7:30             ` Daniel Colascione
2011-07-22  7:41               ` Lennart Borgman
2011-07-22 21:24                 ` chad
2011-07-22 21:57                   ` Lennart Borgman
2011-07-18 18:38   ` grischka

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

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

  git send-email \
    --in-reply-to=4E24679F.5080807@gmail.com \
    --to=dan.colascione@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.