all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs 23.3 with Cygwin bash and '\r'.
@ 2011-03-10 16:30 Oleksandr Gavenko
  2011-03-10 17:34 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Gavenko @ 2011-03-10 16:30 UTC (permalink / raw)
  To: help-gnu-emacs

I get latest Emacs 23.3:

   http://permalink.gmane.org/gmane.emacs.announce/19

and it loaded successfully, but previously all Emacs after setting:

        (setq shell-file-name "bash")
        (setenv "SHELL" "/bin/bash")

work fine and now shell say:

  $ pwd
bash: $'pwd\r': команда не найдена

How fix?




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

* Re: Emacs 23.3 with Cygwin bash and '\r'.
  2011-03-10 16:30 Emacs 23.3 with Cygwin bash and '\r' Oleksandr Gavenko
@ 2011-03-10 17:34 ` Eli Zaretskii
  2011-03-11  8:32   ` Oleksandr Gavenko
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2011-03-10 17:34 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Oleksandr Gavenko <gavenko@bifit.com.ua>
> Date: Thu, 10 Mar 2011 18:30:41 +0200
> 
> I get latest Emacs 23.3:
> 
>    http://permalink.gmane.org/gmane.emacs.announce/19
> 
> and it loaded successfully, but previously all Emacs after setting:
> 
>         (setq shell-file-name "bash")
>         (setenv "SHELL" "/bin/bash")
> 
> work fine and now shell say:
> 
>   $ pwd
> bash: $'pwd\r': команда не найдена

Doesn't that \r give a hint?




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

* Re: Emacs 23.3 with Cygwin bash and '\r'.
  2011-03-10 17:34 ` Eli Zaretskii
@ 2011-03-11  8:32   ` Oleksandr Gavenko
  2011-03-11  9:00     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Gavenko @ 2011-03-11  8:32 UTC (permalink / raw)
  To: help-gnu-emacs

On 10.03.2011 19:34, Eli Zaretskii wrote:
>> From: Oleksandr Gavenko<gavenko@bifit.com.ua>
>> Date: Thu, 10 Mar 2011 18:30:41 +0200
>>
>> I get latest Emacs 23.3:
>>
>>     http://permalink.gmane.org/gmane.emacs.announce/19
>>
>> and it loaded successfully, but previously all Emacs after setting:
>>
>>          (setq shell-file-name "bash")
>>          (setenv "SHELL" "/bin/bash")
>>
>> work fine and now shell say:
>>
>>   $ pwd
>> bash: $'pwd\r': команда не найдена
>
> Doesn't that \r give a hint?
>
Sorry, no ))

I write

(defun my-strip-last-cr (str)
   (pp str)
   (if (> (length str) 0)
       (if (equal (substring str -1) "\r")
           (progn (message "yyy") (substring str 0 -1))
         str)
     ""
     ) )

(defun my-shell-input-filter nil (add-to-list 
'comint-input-filter-functions 'my-strip-last-cr))

(add-hook 'shell-mode-hook 'my-shell-input-filter)

M-x shell ls RET
bash: $'ls\r': команда не найдена

In *Message* buffer I get:

#("ls\n" 0 2
   (fontified t))

So no any \r pass to filter!!

Also I try recent bash specific Cygwin settings: "set -o igncr" without 
happiness.

If I type whitespace char after ls/pwd - all OK.

I don't find any relevant settings in shell.el and comint.el by 
searching "\r" or "^M"
and don't know how further debug issue.




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

* Re: Emacs 23.3 with Cygwin bash and '\r'.
  2011-03-11  8:32   ` Oleksandr Gavenko
@ 2011-03-11  9:00     ` Eli Zaretskii
  2011-03-11 10:29       ` Oleksandr Gavenko
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2011-03-11  9:00 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Oleksandr Gavenko <gavenko@bifit.com.ua>
> Date: Fri, 11 Mar 2011 10:32:44 +0200
> 
> On 10.03.2011 19:34, Eli Zaretskii wrote:
> >> From: Oleksandr Gavenko<gavenko@bifit.com.ua>
> >> Date: Thu, 10 Mar 2011 18:30:41 +0200
> >>
> >> I get latest Emacs 23.3:
> >>
> >>     http://permalink.gmane.org/gmane.emacs.announce/19
> >>
> >> and it loaded successfully, but previously all Emacs after setting:
> >>
> >>          (setq shell-file-name "bash")
> >>          (setenv "SHELL" "/bin/bash")
> >>
> >> work fine and now shell say:
> >>
> >>   $ pwd
> >> bash: $'pwd\r': команда не найдена
> >
> > Doesn't that \r give a hint?
> >
> Sorry, no ))

What value do you get if you evaluate the following expression:

   (process-coding-system (get-process "shell"))

You can do the evaluation with M-:

Since you are using the Cygwin bash, you need to use undecided-unix
(or something -unix, anyway) in the cdr of the cons cell that is
returned by process-coding-system.  You can probably use
set-process-coding-system to change the defaults.

(Btw, if your Emacs is a native Windows build, then you should expect
these surprises, because native Windows programs and Cygwin programs
are subtly incompatible, the matters related to EOL format being one
of the aspects of this incompatibility.  Why not use the Cygwin build
of Emacs instead?)

> In *Message* buffer I get:
> 
> #("ls\n" 0 2
>    (fontified t))
> 
> So no any \r pass to filter!!

Encoding and decoding works below the Lisp level.




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

* Re: Emacs 23.3 with Cygwin bash and '\r'.
  2011-03-11  9:00     ` Eli Zaretskii
@ 2011-03-11 10:29       ` Oleksandr Gavenko
  0 siblings, 0 replies; 5+ messages in thread
From: Oleksandr Gavenko @ 2011-03-11 10:29 UTC (permalink / raw)
  To: help-gnu-emacs

On 11.03.2011 11:00, Eli Zaretskii wrote:
>> From: Oleksandr Gavenko<gavenko@bifit.com.ua>
>> Date: Fri, 11 Mar 2011 10:32:44 +0200
>>
>> On 10.03.2011 19:34, Eli Zaretskii wrote:
>>>> From: Oleksandr Gavenko<gavenko@bifit.com.ua>
>>>> Date: Thu, 10 Mar 2011 18:30:41 +0200
>>>>
>>>> I get latest Emacs 23.3:
>>>>
>>>>      http://permalink.gmane.org/gmane.emacs.announce/19
>>>>
>>>> and it loaded successfully, but previously all Emacs after setting:
>>>>
>>>>           (setq shell-file-name "bash")
>>>>           (setenv "SHELL" "/bin/bash")
>>>>
>>>> work fine and now shell say:
>>>>
>>>>   $ pwd
>>>> bash: $'pwd\r': команда не найдена
>>>
>>> Doesn't that \r give a hint?
>>>
>> Sorry, no ))
>
> What value do you get if you evaluate the following expression:
>
>     (process-coding-system (get-process "shell"))
>
(windows-1251-unix . windows-1251-dos)

This hint help me!
>
> Since you are using the Cygwin bash, you need to use undecided-unix
> (or something -unix, anyway) in the cdr of the cons cell that is
> returned by process-coding-system.  You can probably use
> set-process-coding-system to change the defaults.
>
  Firstly I afraid how automatically call

   (set-process-coding-system (get-process "shell") 'cp1251-unix 
'cp1251-unix)

But I try

   (setq shell-file-name "bash")
   (modify-coding-system-alist 'process "bash" '(cp1251-unix . cp1251-unix))

and this help! Work with new Emacs and with old.

> (Btw, if your Emacs is a native Windows build, then you should expect
> these surprises, because native Windows programs and Cygwin programs
> are subtly incompatible, the matters related to EOL format being one
> of the aspects of this incompatibility.  Why not use the Cygwin build
> of Emacs instead?)
>
I use native Emacs with cygwin-mount.el and Cygwin toolset because I 
some times
use 'menu' and mouse clicking. Cygwin X Window require additional 
attention in this area
and look some ugly.

Work perfectly with minor issues.




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

end of thread, other threads:[~2011-03-11 10:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-10 16:30 Emacs 23.3 with Cygwin bash and '\r' Oleksandr Gavenko
2011-03-10 17:34 ` Eli Zaretskii
2011-03-11  8:32   ` Oleksandr Gavenko
2011-03-11  9:00     ` Eli Zaretskii
2011-03-11 10:29       ` Oleksandr Gavenko

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.