unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* About frame title case [Windows]
@ 2017-05-07 14:51 Angelo Graziosi
  2017-05-07 16:49 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Angelo Graziosi @ 2017-05-07 14:51 UTC (permalink / raw)
  To: Emacs developers

In the Windows builds with MSYS2/MinGW64 I notice the following.

Suppose the PC name is 'FooBar', i.e. the MSYS2 shell prompt looks

user@FooBar MSYS ~
$

Now, in the Windows builds, Emacs shows the frame title as 
'emacs@FOOBAR', i.e. do not respect the case 'FooBar'.

I understand this, internally DOS systems use all in uppercase, but I 
wonder if we can have that respecting the case, 'emacs@FooBar', as on 
other systems (GNU/Linux, macOS, and also in Cygwin native builds, if I 
remember...).

I write about this because also the Windows Subsystem for Linux (WSL) in 
Windows 10 Anniversary Update had this 'issue'... In its shell it had

user@FOOBAR ~
$

But now, with Creators Update, it seems the 'issue' has been fixed:

user@FooBar ~
$

So, why not to 'fix' it also for Emacs on Windows?


TIA,
  Angelo.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About frame title case [Windows]
  2017-05-07 14:51 About frame title case [Windows] Angelo Graziosi
@ 2017-05-07 16:49 ` Eli Zaretskii
  2017-05-07 21:28   ` Angelo Graziosi
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-05-07 16:49 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Sun, 7 May 2017 16:51:41 +0200
> 
> In the Windows builds with MSYS2/MinGW64 I notice the following.
> 
> Suppose the PC name is 'FooBar', i.e. the MSYS2 shell prompt looks
> 
> user@FooBar MSYS ~
> $
> 
> Now, in the Windows builds, Emacs shows the frame title as 
> 'emacs@FOOBAR', i.e. do not respect the case 'FooBar'.
> 
> I understand this, internally DOS systems use all in uppercase, but I 
> wonder if we can have that respecting the case, 'emacs@FooBar', as on 
> other systems (GNU/Linux, macOS, and also in Cygwin native builds, if I 
> remember...).

Emacs doesn't up-case the system-name, it uses the exact string we get
from the system API we use to get the machine name (GetComputerName).

Patches to use other APIs that perhaps don't have this issue, without
incurring disadvantages (like the possible hangs if DNS is not
available etc.) are welcome.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About frame title case [Windows]
  2017-05-07 16:49 ` Eli Zaretskii
@ 2017-05-07 21:28   ` Angelo Graziosi
  2017-05-08 17:00     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Angelo Graziosi @ 2017-05-07 21:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Il 07/05/2017 18:49, Eli Zaretskii ha scritto:
> Emacs doesn't up-case the system-name, it uses the exact string we get
> from the system API we use to get the machine name (GetComputerName).

Looking at src/w32.c it seems you are implementing (sys_)gethostname() 
which, if I understood, is also used on other *nix systems.

gethostname() seems the right routine because on MSYS2 shell I get:

$ env | grep -i foobar
HOSTNAME=FooBar
COMPUTERNAME=FOOBAR

or, if you prefer,

$ echo $COMPUTERNAME $HOSTNAME
FOOBAR FooBar

I wonder what are the "contraindications" in using gethostname() from 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms738527(v=vs.85).aspx

After all, if Start / Setting / Systems / Info shows the PC name in the 
right case, a way should exist to do the same in Emacs.

In any case this is only a little noise.


Thanks,
  Angelo.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About frame title case [Windows]
  2017-05-07 21:28   ` Angelo Graziosi
@ 2017-05-08 17:00     ` Eli Zaretskii
  2017-05-08 19:50       ` Angelo Graziosi
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-05-08 17:00 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Sun, 7 May 2017 23:28:22 +0200
> Cc: emacs-devel@gnu.org
> 
> Il 07/05/2017 18:49, Eli Zaretskii ha scritto:
> > Emacs doesn't up-case the system-name, it uses the exact string we get
> > from the system API we use to get the machine name (GetComputerName).
> 
> Looking at src/w32.c it seems you are implementing (sys_)gethostname() 
> which, if I understood, is also used on other *nix systems.
> 
> gethostname() seems the right routine because on MSYS2 shell I get:
> 
> $ env | grep -i foobar
> HOSTNAME=FooBar
> COMPUTERNAME=FOOBAR
> 
> or, if you prefer,
> 
> $ echo $COMPUTERNAME $HOSTNAME
> FOOBAR FooBar

Does it help to set PRELOAD_WINSOCK=1 in the environment before
starting Emacs?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About frame title case [Windows]
  2017-05-08 17:00     ` Eli Zaretskii
@ 2017-05-08 19:50       ` Angelo Graziosi
  2017-05-09  2:32         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Angelo Graziosi @ 2017-05-08 19:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel



Il 08/05/2017 19:00, Eli Zaretskii ha scritto:
>> From: Angelo Graziosi <angelo.graziosi@alice.it>
>> Date: Sun, 7 May 2017 23:28:22 +0200
>> Cc: emacs-devel@gnu.org
>>
>> Il 07/05/2017 18:49, Eli Zaretskii ha scritto:
>>> Emacs doesn't up-case the system-name, it uses the exact string we get
>>> from the system API we use to get the machine name (GetComputerName).
>>
>> Looking at src/w32.c it seems you are implementing (sys_)gethostname()
>> which, if I understood, is also used on other *nix systems.
>>
>> gethostname() seems the right routine because on MSYS2 shell I get:
>>
>> $ env | grep -i foobar
>> HOSTNAME=FooBar
>> COMPUTERNAME=FOOBAR
>>
>> or, if you prefer,
>>
>> $ echo $COMPUTERNAME $HOSTNAME
>> FOOBAR FooBar
> 
> Does it help to set PRELOAD_WINSOCK=1 in the environment before
> starting Emacs?
> 

Yes, it does! Does it mean we have to add a new environment variable in 
Windows?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About frame title case [Windows]
  2017-05-08 19:50       ` Angelo Graziosi
@ 2017-05-09  2:32         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2017-05-09  2:32 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Mon, 8 May 2017 21:50:29 +0200
> 
> > Does it help to set PRELOAD_WINSOCK=1 in the environment before
> > starting Emacs?
> > 
> 
> Yes, it does! Does it mean we have to add a new environment variable in 
> Windows?

I don't think we have to add it, but you (or anyone else who is
bothered by the letter-case of system-name) might want to do that
locally.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-09  2:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-07 14:51 About frame title case [Windows] Angelo Graziosi
2017-05-07 16:49 ` Eli Zaretskii
2017-05-07 21:28   ` Angelo Graziosi
2017-05-08 17:00     ` Eli Zaretskii
2017-05-08 19:50       ` Angelo Graziosi
2017-05-09  2:32         ` Eli Zaretskii

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).