unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* msys2 build path problems + copy-paste english results in chinese characters
@ 2021-12-01 15:04 arthur miller
  2021-12-01 15:55 ` Lars Ingebrigtsen
  2021-12-01 16:46 ` Eli Zaretskii
  0 siblings, 2 replies; 21+ messages in thread
From: arthur miller @ 2021-12-01 15:04 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 336 bytes --]

I copy pasted english text in newly compiled Emacs, and get back some text in Chinese (at least I think it is) 🙂 👍

As much as exciting that seems, I would still prefer to get back text in English.

Also, as seen exec-path is wrong. I started, as recommended, via windows means (shortcuts) instead of msys/mingw prompts.



[-- Attachment #1.2: Type: text/html, Size: 1627 bytes --]

[-- Attachment #2: Clip1.png --]
[-- Type: image/png, Size: 119019 bytes --]

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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 15:04 arthur miller
@ 2021-12-01 15:55 ` Lars Ingebrigtsen
  2021-12-01 18:32   ` Arthur Miller
  2021-12-01 16:46 ` Eli Zaretskii
  1 sibling, 1 reply; 21+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-01 15:55 UTC (permalink / raw)
  To: arthur miller; +Cc: emacs-devel

arthur miller <arthur.miller@live.com> writes:

> I copy pasted english text in newly compiled Emacs, and get back some text in
> Chinese (at least I think it is) 🙂 👍

What's your Emacs version (and if this is on master, what's the commit
you're at)?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 15:04 arthur miller
  2021-12-01 15:55 ` Lars Ingebrigtsen
@ 2021-12-01 16:46 ` Eli Zaretskii
  2021-12-01 18:25   ` Arthur Miller
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2021-12-01 16:46 UTC (permalink / raw)
  To: arthur miller; +Cc: emacs-devel

> From: arthur miller <arthur.miller@live.com>
> Date: Wed, 1 Dec 2021 15:04:50 +0000
> 
> I copy pasted english text in newly compiled Emacs, and get back some text in Chinese (at least I think it is)

Copy-pasted from which application?

If it's an MSYS2 application, then I suspect the problem is MSYS2 apps
encode copied text in UTF-8 (since Cygwin does, AFAIK), whereas a
native MS-Windows build of Emacs expects a UTF-16 encoding.

> Also, as seen exec-path is wrong. I started, as recommended, via windows means (shortcuts) instead of
> msys/mingw prompts.

Wrong how?  I don't see anything about exec-path in the image you
posted.



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 16:46 ` Eli Zaretskii
@ 2021-12-01 18:25   ` Arthur Miller
  2021-12-01 18:44     ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Arthur Miller @ 2021-12-01 18:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: arthur miller <arthur.miller@live.com>
>> Date: Wed, 1 Dec 2021 15:04:50 +0000
>> 
>> I copy pasted english text in newly compiled Emacs, and get back some text in Chinese (at least I think it is)
>
> Copy-pasted from which application?
Emacs!

I copy-pasted the raw above, I did it with the mouse though. :-) After I took the
screenshot I redo it by marking and copying via M-w and C-y and it worked.

> If it's an MSYS2 application, then I suspect the problem is MSYS2 apps
> encode copied text in UTF-8 (since Cygwin does, AFAIK), whereas a
> native MS-Windows build of Emacs expects a UTF-16 encoding.
>
>> Also, as seen exec-path is wrong. I started, as recommended, via windows means (shortcuts) instead of
>> msys/mingw prompts.
>
> Wrong how?  I don't see anything about exec-path in the image you
> posted.

Look at warning from the native-comp in window below; it can not find assemblern
(gnu as). When looking at exec-path I see no paths from mingw present anywhere,
but I did found "." in the path, which I haven't put there myself.




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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 15:55 ` Lars Ingebrigtsen
@ 2021-12-01 18:32   ` Arthur Miller
  2021-12-01 18:50     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 21+ messages in thread
From: Arthur Miller @ 2021-12-01 18:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> arthur miller <arthur.miller@live.com> writes:
>
>> I copy pasted english text in newly compiled Emacs, and get back some text in
>> Chinese (at least I think it is) 🙂 👍
>
> What's your Emacs version (and if this is on master, what's the commit
> you're at)?

I installed msys2 clean + pulled Emacs like an hour/half hour before I did that
screenshot. I couldn't get emacsclient to work after rebuild, so I was checking
my paths and entire setup. Client/server works with emacs -Q, but suddenly my
config does not seem to work, and I used to have it working without problems
since back in winxp.



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 18:25   ` Arthur Miller
@ 2021-12-01 18:44     ` Eli Zaretskii
  2021-12-01 22:39       ` Arthur Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2021-12-01 18:44 UTC (permalink / raw)
  To: Arthur Miller; +Cc: emacs-devel

> From: Arthur Miller <arthur.miller@live.com>
> Cc: emacs-devel@gnu.org
> Date: Wed, 01 Dec 2021 19:25:54 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: arthur miller <arthur.miller@live.com>
> >> Date: Wed, 1 Dec 2021 15:04:50 +0000
> >> 
> >> I copy pasted english text in newly compiled Emacs, and get back some text in Chinese (at least I think it is)
> >
> > Copy-pasted from which application?
> Emacs!

You copied from Emacs to the same Emacs, and you get garbled text?

> I copy-pasted the raw above, I did it with the mouse though. :-)

So you marked the text with the mouse, and then did what? M-w? or
something else?  You must describe what you did exactly, because there
are too many unknown factors here.

> After I took the screenshot I redo it by marking and copying via M-w
> and C-y and it worked.

So M-w followed by C-y works.  What doesn't work?

> >> Also, as seen exec-path is wrong. I started, as recommended, via windows means (shortcuts) instead of
> >> msys/mingw prompts.
> >
> > Wrong how?  I don't see anything about exec-path in the image you
> > posted.
> 
> Look at warning from the native-comp in window below; it can not find assemblern
> (gnu as). When looking at exec-path I see no paths from mingw present anywhere,
> but I did found "." in the path, which I haven't put there myself.

The "." part is added by the MSYS2 Bash.  but I still don't understand
why it gets in the way.  Does the directory where you have gas.exe
appear on the system-wide PATH?



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 18:32   ` Arthur Miller
@ 2021-12-01 18:50     ` Lars Ingebrigtsen
  2021-12-01 22:42       ` Arthur Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-01 18:50 UTC (permalink / raw)
  To: Arthur Miller; +Cc: emacs-devel

Arthur Miller <arthur.miller@live.com> writes:

> I installed msys2 clean + pulled Emacs like an hour/half hour before I
> did that screenshot.

`M-x report-emacs-bug' should give you the revision.  It'll look like
this:

Repository revision: 6a60bd475d67b7e8c9184836abf7eea229183066


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 18:44     ` Eli Zaretskii
@ 2021-12-01 22:39       ` Arthur Miller
  2021-12-01 23:01         ` Óscar Fuentes
  2021-12-02  7:17         ` Eli Zaretskii
  0 siblings, 2 replies; 21+ messages in thread
From: Arthur Miller @ 2021-12-01 22:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Arthur Miller <arthur.miller@live.com>
>> Cc: emacs-devel@gnu.org
>> Date: Wed, 01 Dec 2021 19:25:54 +0100
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> From: arthur miller <arthur.miller@live.com>
>> >> Date: Wed, 1 Dec 2021 15:04:50 +0000
>> >> 
>> >> I copy pasted english text in newly compiled Emacs, and get back some text in Chinese (at least I think it is)
>> >
>> > Copy-pasted from which application?
>> Emacs!
>
> You copied from Emacs to the same Emacs, and you get garbled text?
>
>> I copy-pasted the raw above, I did it with the mouse though. :-)
>
> So you marked the text with the mouse, and then did what? M-w? or
> something else?  You must describe what you did exactly, because there
> are too many unknown factors here.
>
>> After I took the screenshot I redo it by marking and copying via M-w
>> and C-y and it worked.
>
> So M-w followed by C-y works.  What doesn't work?
I pasted it with the middle mouse button; so now when you asked, I should
probably say oups :-). It was many months of X11 and very few sessions in win32
environment.

>> >> Also, as seen exec-path is wrong. I started, as recommended, via windows means (shortcuts) instead of
>> >> msys/mingw prompts.
>> >
>> > Wrong how?  I don't see anything about exec-path in the image you
>> > posted.
>> 
>> Look at warning from the native-comp in window below; it can not find assemblern
>> (gnu as). When looking at exec-path I see no paths from mingw present anywhere,
>> but I did found "." in the path, which I haven't put there myself.
>
> The "." part is added by the MSYS2 Bash.  but I still don't understand
> why it gets in the way.  Does the directory where you have gas.exe
It is not considered very safe to have it in the path, so I am very suspicisious
to that.

>                          Does the directory where you have gas.exe
> appear on the system-wide PATH?

Nope; I haven't manually added any of msys paths to the system, I thought the
build would add some default paths to msys dirs.



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 18:50     ` Lars Ingebrigtsen
@ 2021-12-01 22:42       ` Arthur Miller
  0 siblings, 0 replies; 21+ messages in thread
From: Arthur Miller @ 2021-12-01 22:42 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>
>> I installed msys2 clean + pulled Emacs like an hour/half hour before I
>> did that screenshot.
>
> `M-x report-emacs-bug' should give you the revision.  It'll look like
> this:
>
> Repository revision: 6a60bd475d67b7e8c9184836abf7eea229183066

Indeed, didn't thought of it. Anyway, I have booted into Arch anyway. I think I
know the problem; I pasted with the middle mouse button; does not work in Windows.



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 22:39       ` Arthur Miller
@ 2021-12-01 23:01         ` Óscar Fuentes
  2021-12-02  7:19           ` Eli Zaretskii
  2021-12-02  7:17         ` Eli Zaretskii
  1 sibling, 1 reply; 21+ messages in thread
From: Óscar Fuentes @ 2021-12-01 23:01 UTC (permalink / raw)
  To: emacs-devel

Arthur Miller <arthur.miller@live.com> writes:

>>> >> Also, as seen exec-path is wrong. I started, as recommended, via windows means (shortcuts) instead of
>>> >> msys/mingw prompts.
>>> >
>>> > Wrong how?  I don't see anything about exec-path in the image you
>>> > posted.
>>> 
>>> Look at warning from the native-comp in window below; it can not find assemblern
>>> (gnu as). When looking at exec-path I see no paths from mingw present anywhere,
>>> but I did found "." in the path, which I haven't put there myself.
>>
>> The "." part is added by the MSYS2 Bash.  but I still don't understand
>> why it gets in the way.  Does the directory where you have gas.exe
> It is not considered very safe to have it in the path, so I am very suspicisious
> to that.
>
>>                          Does the directory where you have gas.exe
>> appear on the system-wide PATH?
>
> Nope; I haven't manually added any of msys paths to the system, I thought the
> build would add some default paths to msys dirs.

Try this in your .emacs :

(let ((dir (file-name-directory (car command-line-args))))
  (setenv "PATH" (concat (getenv "PATH") path-separator dir))
  (setq exec-path (append exec-path (list dir))))




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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 22:39       ` Arthur Miller
  2021-12-01 23:01         ` Óscar Fuentes
@ 2021-12-02  7:17         ` Eli Zaretskii
       [not found]           ` <AM9PR09MB4977B43C2FC19514E4385B5E966C9@AM9PR09MB4977.eurprd09.prod.outlook.com>
  1 sibling, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2021-12-02  7:17 UTC (permalink / raw)
  To: Arthur Miller; +Cc: emacs-devel

> From: Arthur Miller <arthur.miller@live.com>
> Cc: emacs-devel@gnu.org
> Date: Wed, 01 Dec 2021 23:39:23 +0100
> 
> > So M-w followed by C-y works.  What doesn't work?
> I pasted it with the middle mouse button; so now when you asked, I should
> probably say oups :-). It was many months of X11 and very few sessions in win32
> environment.

I don't think I understand the "oups" part: does it mean you figured
out what caused the problem?

> >> >> Also, as seen exec-path is wrong. I started, as recommended, via windows means (shortcuts) instead of
> >> >> msys/mingw prompts.
> >> >
> >> > Wrong how?  I don't see anything about exec-path in the image you
> >> > posted.
> >> 
> >> Look at warning from the native-comp in window below; it can not find assemblern
> >> (gnu as). When looking at exec-path I see no paths from mingw present anywhere,
> >> but I did found "." in the path, which I haven't put there myself.
> >
> > The "." part is added by the MSYS2 Bash.  but I still don't understand
> > why it gets in the way.  Does the directory where you have gas.exe
> It is not considered very safe to have it in the path, so I am very suspicisious
> to that.

MSYS2 does it for good reasons.  Since you invoked Emacs from the
MSYS2 Bash, something that is generally not recommended, you inherit
that, and have to deal with it.

> >                          Does the directory where you have gas.exe
> > appear on the system-wide PATH?
> 
> Nope; I haven't manually added any of msys paths to the system, I thought the
> build would add some default paths to msys dirs.

That's your problem: this is why Emacs started from Bash doesn't find
the assembler.  The assembler (and GCC/Binutils in general) are not
MSYS2 programs, they are native Windows programs.  Their directories
should be on PATH, so that you could invoke them from anywhere on your
system, not just from MSYS2 Bash command line.



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-01 23:01         ` Óscar Fuentes
@ 2021-12-02  7:19           ` Eli Zaretskii
  2021-12-02  9:42             ` Óscar Fuentes
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2021-12-02  7:19 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: emacs-devel

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Thu, 02 Dec 2021 00:01:41 +0100
> 
> >>                          Does the directory where you have gas.exe
> >> appear on the system-wide PATH?
> >
> > Nope; I haven't manually added any of msys paths to the system, I thought the
> > build would add some default paths to msys dirs.
> 
> Try this in your .emacs :
> 
> (let ((dir (file-name-directory (car command-line-args))))
>   (setenv "PATH" (concat (getenv "PATH") path-separator dir))
>   (setq exec-path (append exec-path (list dir))))

Changing PATH from within Emacs is not recommended, it will bite you
down the road when you least expect it.



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-02  7:19           ` Eli Zaretskii
@ 2021-12-02  9:42             ` Óscar Fuentes
  2021-12-02 10:05               ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Óscar Fuentes @ 2021-12-02  9:42 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> >>                          Does the directory where you have gas.exe
>> >> appear on the system-wide PATH?
>> >
>> > Nope; I haven't manually added any of msys paths to the system, I thought the
>> > build would add some default paths to msys dirs.
>> 
>> Try this in your .emacs :
>> 
>> (let ((dir (file-name-directory (car command-line-args))))
>>   (setenv "PATH" (concat (getenv "PATH") path-separator dir))
>>   (setq exec-path (append exec-path (list dir))))
>
> Changing PATH from within Emacs is not recommended, it will bite you
> down the road when you least expect it.

I'm using that since many years ago without problems. It makes possible
to run all the other Mingw-w64 executables installed on the same
directory as emacs.exe without changing the global PATH or using a
script to start Emacs.

If you know a better approach and/or wish to describe a failure mode for
the above code...




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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-02  9:42             ` Óscar Fuentes
@ 2021-12-02 10:05               ` Eli Zaretskii
  2021-12-02 15:40                 ` Óscar Fuentes
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2021-12-02 10:05 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: emacs-devel

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Thu, 02 Dec 2021 10:42:49 +0100
> 
> >> (let ((dir (file-name-directory (car command-line-args))))
> >>   (setenv "PATH" (concat (getenv "PATH") path-separator dir))
> >>   (setq exec-path (append exec-path (list dir))))
> >
> > Changing PATH from within Emacs is not recommended, it will bite you
> > down the road when you least expect it.
> 
> I'm using that since many years ago without problems.

Sheer luck.

> If you know a better approach

Yes, change PATH outside of Emacs.  Then live happily ever after.

> and/or wish to describe a failure mode for the above code...

One failure is that you put directories with forward slashes into the
environment of the programs you invoke, and not all of them like that
(although most do cope with that).

Another problem is that after this, PATH used by Emacs and PATH used
by sub-processes is different.

Yet another problem, specific to invoking MSYS2 commands, is that the
directory might be incorrectly encoded (if it includes non-ASCII
characters), since MSYS2 programs expect UTF-8 encoding AFAIK, whereas
Emacs encodes it using the system codepage.

There might be other problems, I'm not sure I remember all of them.  I
just learned long ago not to do that.



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

* Re:
@ 2021-12-02 14:09 Angelo Graziosi
  2021-12-02 14:21 ` msys2 build path problems + copy-paste english results in chinese characters Angelo Graziosi
  0 siblings, 1 reply; 21+ messages in thread
From: Angelo Graziosi @ 2021-12-02 14:09 UTC (permalink / raw)
  To: emacs-devel@gnu.org, ofv@wanadoo.es

> Try this in your .emacs :
> 
> (let ((dir (file-name-directory (car command-line-args))))
>   (setenv "PATH" (concat (getenv "PATH") path-separator dir))
>   (setq exec-path (append exec-path (list dir))))

I tried this

(let ((dir (file-name-directory (car command-line-args))))
  (setenv "PATH" (concat (getenv "PATH") path-separator dir))
  (setq exec-path (append exec-path '("C:/msys64/mingw64/bin" "C:/msys64/usr/bin"))))

but it does not seem to work.

First, I had to change it this way

- ...setq exec-path (append exec-path (list dir)...
+ ...setq exec-path (append exec-path '(list dir)...

otherwise Emacs won't start.

Second, with that change only '...\Emacs\bin' is added to the PATH, not the MSYS2/MINGW64 paths...

Instead of change the init file, it is some year I use a Windows .lnk with 

Target: C:\Windows\System32\cmd.exe /c "SET path=C:\msys64\mingw64\bin;%path%&& SET PRELOAD_WINSOCK=1&& START /D ^"C:\LocalApps\Emacs\bin^" runemacs.exe"


Ciao,
  Angelo.



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-02 14:09 Angelo Graziosi
@ 2021-12-02 14:21 ` Angelo Graziosi
  0 siblings, 0 replies; 21+ messages in thread
From: Angelo Graziosi @ 2021-12-02 14:21 UTC (permalink / raw)
  To: emacs-devel@gnu.org, ofv@wanadoo.es

Oops, missed subject in replay..

> Il 02/12/2021 15:09 Angelo Graziosi  ha scritto:
> 
>  
> > Try this in your .emacs :
> > 
> > (let ((dir (file-name-directory (car command-line-args))))
> >   (setenv "PATH" (concat (getenv "PATH") path-separator dir))
> >   (setq exec-path (append exec-path (list dir))))
> 
> I tried this
> 
> (let ((dir (file-name-directory (car command-line-args))))
>   (setenv "PATH" (concat (getenv "PATH") path-separator dir))
>   (setq exec-path (append exec-path '("C:/msys64/mingw64/bin" "C:/msys64/usr/bin"))))
> 
> but it does not seem to work.
> 
> First, I had to change it this way
> 
> - ...setq exec-path (append exec-path (list dir)...
> + ...setq exec-path (append exec-path '(list dir)...
> 
> otherwise Emacs won't start.
> 
> Second, with that change only '...\Emacs\bin' is added to the PATH, not the MSYS2/MINGW64 paths...
> 
> Instead of change the init file, it is some year I use a Windows .lnk with 
> 
> Target: C:\Windows\System32\cmd.exe /c "SET path=C:\msys64\mingw64\bin;%path%&& SET PRELOAD_WINSOCK=1&& START /D ^"C:\LocalApps\Emacs\bin^" runemacs.exe"
> 
> 
> Ciao,
>   Angelo.



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-02 10:05               ` Eli Zaretskii
@ 2021-12-02 15:40                 ` Óscar Fuentes
  2021-12-02 18:05                   ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Óscar Fuentes @ 2021-12-02 15:40 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Óscar Fuentes <ofv@wanadoo.es>
>> Date: Thu, 02 Dec 2021 10:42:49 +0100
>> 
>> >> (let ((dir (file-name-directory (car command-line-args))))
>> >>   (setenv "PATH" (concat (getenv "PATH") path-separator dir))
>> >>   (setq exec-path (append exec-path (list dir))))
>> >
>> > Changing PATH from within Emacs is not recommended, it will bite you
>> > down the road when you least expect it.
>> 
>> I'm using that since many years ago without problems.
>
> Sheer luck.
>
>> If you know a better approach
>
> Yes, change PATH outside of Emacs.  Then live happily ever after.

That's precisely what I prefer to avoid.

>> and/or wish to describe a failure mode for the above code...
>
> One failure is that you put directories with forward slashes into the
> environment of the programs you invoke, and not all of them like that
> (although most do cope with that).

Maybe if an application parses PATH on a broken way. So far I found
none.

> Another problem is that after this, PATH used by Emacs and PATH used
> by sub-processes is different.

I don't know how this could be a problem, even less when emacs.exe lives
in the directory added to PATH.

> Yet another problem, specific to invoking MSYS2 commands, is that the
> directory might be incorrectly encoded (if it includes non-ASCII
> characters), since MSYS2 programs expect UTF-8 encoding AFAIK, whereas
> Emacs encodes it using the system codepage.

Well, adding directories containing MSYS2/Cygwin applications to PATH is
risky, something to avoid. Fortunately, on a MSYS2 setup MSYS2 and
mingw-w64 binaries are strictly separated.

> There might be other problems, I'm not sure I remember all of them.  I
> just learned long ago not to do that.

My experience says otherwise, and having to set up PATH so Emacs can
execute the applications installed on its same directory is not trivial
for inexperienced users and an annoyance for the rest. IMO
runemacs.exe/emacsclient.exe should add their directory to PATH before
invoking emacs.exe.




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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-02 15:40                 ` Óscar Fuentes
@ 2021-12-02 18:05                   ` Eli Zaretskii
  2021-12-05  8:43                     ` Arthur Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2021-12-02 18:05 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: emacs-devel

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Thu, 02 Dec 2021 16:40:43 +0100
> 
> >> If you know a better approach
> >
> > Yes, change PATH outside of Emacs.  Then live happily ever after.
> 
> That's precisely what I prefer to avoid.

There's no need to avoid it.

> > One failure is that you put directories with forward slashes into the
> > environment of the programs you invoke, and not all of them like that
> > (although most do cope with that).
> 
> Maybe if an application parses PATH on a broken way. So far I found
> none.

I've definitely seen a few in the past.

> > Another problem is that after this, PATH used by Emacs and PATH used
> > by sub-processes is different.
> 
> I don't know how this could be a problem, even less when emacs.exe lives
> in the directory added to PATH.

It could be a problem because sub-processes will be able to find
programs that Emacs might not find.

> > Yet another problem, specific to invoking MSYS2 commands, is that the
> > directory might be incorrectly encoded (if it includes non-ASCII
> > characters), since MSYS2 programs expect UTF-8 encoding AFAIK, whereas
> > Emacs encodes it using the system codepage.
> 
> Well, adding directories containing MSYS2/Cygwin applications to PATH is
> risky, something to avoid. Fortunately, on a MSYS2 setup MSYS2 and
> mingw-w64 binaries are strictly separated.

But the OP definitely wanted MSYS2 executables, that's why he invoked
Emacs from Bash (which is an MSYS2 program).



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-02 18:05                   ` Eli Zaretskii
@ 2021-12-05  8:43                     ` Arthur Miller
  0 siblings, 0 replies; 21+ messages in thread
From: Arthur Miller @ 2021-12-05  8:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Óscar Fuentes, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Óscar Fuentes <ofv@wanadoo.es>
>> Date: Thu, 02 Dec 2021 16:40:43 +0100
>> 
>> >> If you know a better approach
>> >
>> > Yes, change PATH outside of Emacs.  Then live happily ever after.
>> 
>> That's precisely what I prefer to avoid.
>
> There's no need to avoid it.
>
>> > One failure is that you put directories with forward slashes into the
>> > environment of the programs you invoke, and not all of them like that
>> > (although most do cope with that).
>> 
>> Maybe if an application parses PATH on a broken way. So far I found
>> none.
>
> I've definitely seen a few in the past.
>
>> > Another problem is that after this, PATH used by Emacs and PATH used
>> > by sub-processes is different.
>> 
>> I don't know how this could be a problem, even less when emacs.exe lives
>> in the directory added to PATH.
>
> It could be a problem because sub-processes will be able to find
> programs that Emacs might not find.
>
>> > Yet another problem, specific to invoking MSYS2 commands, is that the
>> > directory might be incorrectly encoded (if it includes non-ASCII
>> > characters), since MSYS2 programs expect UTF-8 encoding AFAIK, whereas
>> > Emacs encodes it using the system codepage.
>> 
>> Well, adding directories containing MSYS2/Cygwin applications to PATH is
>> risky, something to avoid. Fortunately, on a MSYS2 setup MSYS2 and
>> mingw-w64 binaries are strictly separated.

Not just strictly separated but they don't seem to like to be mixed. Now
coreutils get installed into "msys" (/usr/bin) while GCC gets installed into
mingw64 (/mingw64/bin). So if I wish emacs to find gcc, as & co, and not run it
from the command line, I have to add mingw64/bin to my OS path. If I also wish
Emacs to find gnu ls, I have to add /usr/bin to OS path to, but they are not
recommended to mix, and you also don't recommend setting path from within Emacs
either, so I am a little bit puzzled here what would is a good practice.

I have currently added mingw first, and msys after to the OS paths, so gcc & co
will find it's binaries first, how well it will work I will see.

And I also discovered I can't send mail, authentication failed, which is 
probably .authinfo file not being found or not being decrypted, which also used
to work before. I don't know yet if it is also related to paths or something
else; I am not into tweaking my system more today, so that will be another day.



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
       [not found]           ` <AM9PR09MB4977B43C2FC19514E4385B5E966C9@AM9PR09MB4977.eurprd09.prod.outlook.com>
@ 2021-12-05 10:17             ` Eli Zaretskii
  2021-12-05 10:57               ` Arthur Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Eli Zaretskii @ 2021-12-05 10:17 UTC (permalink / raw)
  To: Arthur Miller; +Cc: emacs-devel

> From: Arthur Miller <arthur.miller@live.com>
> Cc: emacs-devel@gnu.org
> Date: Sun, 05 Dec 2021 09:16:50 +0100
> 
> I have been back to windows now, and got server/dameon to work again, paths
> fixed etc. Then I have experienced something I think is a bug and wanted to
> test it in a clean Emacs, so I started new instance with -Q option. I copied
> text from my customized Emacs with by marking text and using kill-ring-save
> (M-w). In clean Emacs I pasted it with yank (C-y) and result came out
> completely scrambled, screenshot included.

I think the reason for this is in your customizations in Emacs from
which you did the M-w.  It sounds like it somehow uses an encoding
other than UTF-16 to encode the text it puts into the clipboard.

> Regarding what I think is bug; I can't make a frame from elisp if I pass in both
> width and height.

Can you please separate the bugs?  This is unrelated to the issue with
copy/paste.


> This code gives me "memory exhausted .." error (C stack
> overflow?):
> 
> (defvar emw--frame nil)
> 
> (let ((w (display-pixel-width))
>       (h (display-pixel-height)))
>         (setq emw--frame (make-frame 
>                           `((width . ,w)
>                             (height . ,h)
>                             (visibility . t)
>                             (auto-raise . nil)
>                             (skip-taskbar . t)
>                             (no-focus-on-map . t)
>                             (no-accept-focus . t)
>                             (undecorated . t)
>                             (unsplittable . t)
>                             (z-group . below)
>                             (no-other-frame . t)
>                             (minibuffer . nil)
>                             (tool-bar-lines . 0)
>                             (menu-bar-lines . 0)
>                             (left-fringe . 0)
>                             (right-fringe . 0)
>                             (border-width . 0)
>                             (internal-border-width . 0)
>                             (vertical-scroll-bars . nil)
>                             (horizontal-scroll-bars . nil)))))

When I evaluate the above in "emacs -Q", Emacs signals an error:

  (error "Value ‘below’ for z-group is not supported on Windows")

So I wonder why you get a different result.  What version of Emacs is
that?



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

* Re: msys2 build path problems + copy-paste english results in chinese characters
  2021-12-05 10:17             ` Eli Zaretskii
@ 2021-12-05 10:57               ` Arthur Miller
  0 siblings, 0 replies; 21+ messages in thread
From: Arthur Miller @ 2021-12-05 10:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Arthur Miller <arthur.miller@live.com>
>> Cc: emacs-devel@gnu.org
>> Date: Sun, 05 Dec 2021 09:16:50 +0100
>> 
>> I have been back to windows now, and got server/dameon to work again, paths
>> fixed etc. Then I have experienced something I think is a bug and wanted to
>> test it in a clean Emacs, so I started new instance with -Q option. I copied
>> text from my customized Emacs with by marking text and using kill-ring-save
>> (M-w). In clean Emacs I pasted it with yank (C-y) and result came out
>> completely scrambled, screenshot included.
>
> I think the reason for this is in your customizations in Emacs from
> which you did the M-w.  It sounds like it somehow uses an encoding
> other than UTF-16 to encode the text it puts into the clipboard.

Ok. I'll investigate. This is same setup I had since quite some time, so it is a
bit strange, but Emacs has evolved. 

>> Regarding what I think is bug; I can't make a frame from elisp if I pass in both
>> width and height.
>
> Can you please separate the bugs?  This is unrelated to the issue with
> copy/paste.

I actually wanted to investigate what is going on and potentially write a bug
repport, but got all those other issues, couldn't even sent mail from gnus, so I
got back to Arch :).

>
>> This code gives me "memory exhausted .." error (C stack
>> overflow?):
>> 
>> (defvar emw--frame nil)
>> 
>> (let ((w (display-pixel-width))
>>       (h (display-pixel-height)))
>>         (setq emw--frame (make-frame 
>>                           `((width . ,w)
>>                             (height . ,h)
>>                             (visibility . t)
>>                             (auto-raise . nil)
>>                             (skip-taskbar . t)
>>                             (no-focus-on-map . t)
>>                             (no-accept-focus . t)
>>                             (undecorated . t)
>>                             (unsplittable . t)
>>                             (z-group . below)
>>                             (no-other-frame . t)
>>                             (minibuffer . nil)
>>                             (tool-bar-lines . 0)
>>                             (menu-bar-lines . 0)
>>                             (left-fringe . 0)
>>                             (right-fringe . 0)
>>                             (border-width . 0)
>>                             (internal-border-width . 0)
>>                             (vertical-scroll-bars . nil)
>>                             (horizontal-scroll-bars . nil)))))
>
> When I evaluate the above in "emacs -Q", Emacs signals an error:
>
>   (error "Value ‘below’ for z-group is not supported on Windows")
>
> So I wonder why you get a different result.  What version of Emacs is
> that?

As said, I get that error you saw on the screenshot. I didn't see that message
about z-group. It is a couple of days ago, when I started the thread.

I'll go back to windows later this evening and try to work out more what is
going on.



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

end of thread, other threads:[~2021-12-05 10:57 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 14:09 Angelo Graziosi
2021-12-02 14:21 ` msys2 build path problems + copy-paste english results in chinese characters Angelo Graziosi
  -- strict thread matches above, loose matches on Subject: below --
2021-12-01 15:04 arthur miller
2021-12-01 15:55 ` Lars Ingebrigtsen
2021-12-01 18:32   ` Arthur Miller
2021-12-01 18:50     ` Lars Ingebrigtsen
2021-12-01 22:42       ` Arthur Miller
2021-12-01 16:46 ` Eli Zaretskii
2021-12-01 18:25   ` Arthur Miller
2021-12-01 18:44     ` Eli Zaretskii
2021-12-01 22:39       ` Arthur Miller
2021-12-01 23:01         ` Óscar Fuentes
2021-12-02  7:19           ` Eli Zaretskii
2021-12-02  9:42             ` Óscar Fuentes
2021-12-02 10:05               ` Eli Zaretskii
2021-12-02 15:40                 ` Óscar Fuentes
2021-12-02 18:05                   ` Eli Zaretskii
2021-12-05  8:43                     ` Arthur Miller
2021-12-02  7:17         ` Eli Zaretskii
     [not found]           ` <AM9PR09MB4977B43C2FC19514E4385B5E966C9@AM9PR09MB4977.eurprd09.prod.outlook.com>
2021-12-05 10:17             ` Eli Zaretskii
2021-12-05 10:57               ` Arthur Miller

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