all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Mysterious hidden end of line characters.
@ 2008-01-26 17:14 David
  2008-01-26 19:21 ` Thierry Volpiatto
  2008-01-26 20:41 ` Peter Dyballa
  0 siblings, 2 replies; 24+ messages in thread
From: David @ 2008-01-26 17:14 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: Patrick Giraudoux

I have a strange problem with invisible end of line characters.

Yesterday I was trying to configure GRASS6.3 using the following
single line of code.


CFLAGS=-O2 ./configure \
	 --with-gdal=/usr/bin/gdal-config \
	 --with-tcltk \
	 --with-tcltk-includes=/usr/include/tcl8.4 \
	 --x-includes=/usr/include/X11 \
	--with-postgres-includes=/usr/include/postgresql \
	--with-freetype-includes=/usr/include/freetype2 \
	--x-includes=/usr/include/X11 \
	--x-libraries=/usr/lib/X11 \
	--with-libs=/usr/lib64 \
	--with-blas \
	--with-mysql \
	--with-mysql-includes=/usr/include/mysql \
	--with-cxx \
	--with-freetype \
	--with-freetype-includes=/usr/include/freetype2 \
	--with-readline \
	--with-sqlite \
	--with-tiff \
	--with-x \
	 --with-odbc \
	--enable-64bit \
	2>&1 | tee config_log.txt


Normally the \ character tells the shell not to execute the line but
to wait for the next line and execture them as one, so everything
above is seen by the computer as a single line. Right?

Well, not on my computer.  Each time I copied the lines from emacs to
a terminal (konsole) for some reason the \ was being over riden and
the terminal tried executing the code one line at a time. My effort to
configure GRASS failled until I removed every \ and collapsed
everything down to the following single line.

CFLAGS=-O2 ./configure --with-gdal=/usr/bin/gdal-config --with-tcltk --with-tcltk-includes=/usr/include/tcl8.4 --x-includes=/usr/include/X11 --with-postgres-includes=/usr/include/postgresql --with-freetype-includes=/usr/include/freetype2 --x-includes=/usr/include/X11 --x-libraries=/usr/lib/X11 --with-libs=/usr/lib64 --with-blas --with-mysql --with-mysql-includes=/usr/include/mysql --with-cxx --with-freetype --with-freetype-includes=/usr/include/freetype2 --with-readline --with-sqlite --with-tiff --with-x --with-odbc --enable-64bit 2>&1 | tee config_log.txt

A colleage then complained to me saying I had some kind of invisible
character at the end of each line of a shell script (naturally, writen
in emacs) that I'd sent him. He was having to guess where each of
these nasty characters was and delete them line by line.  I think he
has emacs on Ubuntu, I am running emacs21 on Debian etch.

How might I try to identify what is going on here?

cheers
Dave

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

* Re: Mysterious hidden end of line characters.
  2008-01-26 17:14 David
@ 2008-01-26 19:21 ` Thierry Volpiatto
  2008-01-26 19:54   ` David
                     ` (2 more replies)
  2008-01-26 20:41 ` Peter Dyballa
  1 sibling, 3 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-01-26 19:21 UTC (permalink / raw)
  To: dpleydel; +Cc: help-gnu-emacs, Patrick Giraudoux

Did you try running delete-trailing-white-space or picture-mode on your
files ?

David <dpleydel@univ-fcomte.fr> writes:

> I have a strange problem with invisible end of line characters.
>
> Yesterday I was trying to configure GRASS6.3 using the following
> single line of code.
>
>
> CFLAGS=-O2 ./configure \
> 	 --with-gdal=/usr/bin/gdal-config \
> 	 --with-tcltk \
> 	 --with-tcltk-includes=/usr/include/tcl8.4 \
> 	 --x-includes=/usr/include/X11 \
> 	--with-postgres-includes=/usr/include/postgresql \
> 	--with-freetype-includes=/usr/include/freetype2 \
> 	--x-includes=/usr/include/X11 \
> 	--x-libraries=/usr/lib/X11 \
> 	--with-libs=/usr/lib64 \
> 	--with-blas \
> 	--with-mysql \
> 	--with-mysql-includes=/usr/include/mysql \
> 	--with-cxx \
> 	--with-freetype \
> 	--with-freetype-includes=/usr/include/freetype2 \
> 	--with-readline \
> 	--with-sqlite \
> 	--with-tiff \
> 	--with-x \
> 	 --with-odbc \
> 	--enable-64bit \
> 	2>&1 | tee config_log.txt
>
>
> Normally the \ character tells the shell not to execute the line but
> to wait for the next line and execture them as one, so everything
> above is seen by the computer as a single line. Right?
>
> Well, not on my computer.  Each time I copied the lines from emacs to
> a terminal (konsole) for some reason the \ was being over riden and
> the terminal tried executing the code one line at a time. My effort to
> configure GRASS failled until I removed every \ and collapsed
> everything down to the following single line.
>
> CFLAGS=-O2 ./configure --with-gdal=/usr/bin/gdal-config --with-tcltk --with-tcltk-includes=/usr/include/tcl8.4 --x-includes=/usr/include/X11 --with-postgres-includes=/usr/include/postgresql --with-freetype-includes=/usr/include/freetype2 --x-includes=/usr/include/X11 --x-libraries=/usr/lib/X11 --with-libs=/usr/lib64 --with-blas --with-mysql --with-mysql-includes=/usr/include/mysql --with-cxx --with-freetype --with-freetype-includes=/usr/include/freetype2 --with-readline --with-sqlite --with-tiff --with-x --with-odbc --enable-64bit 2>&1 | tee config_log.txt
>
> A colleage then complained to me saying I had some kind of invisible
> character at the end of each line of a shell script (naturally, writen
> in emacs) that I'd sent him. He was having to guess where each of
> these nasty characters was and delete them line by line.  I think he
> has emacs on Ubuntu, I am running emacs21 on Debian etch.
>
> How might I try to identify what is going on here?
>
> cheers
> Dave
>
>
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>

-- 
A + Thierry
Pub key: http://pgp.mit.edu

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

* Re: Mysterious hidden end of line characters.
  2008-01-26 19:21 ` Thierry Volpiatto
@ 2008-01-26 19:54   ` David
  2008-01-26 20:06   ` David
       [not found]   ` <mailman.6584.1201377847.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 24+ messages in thread
From: David @ 2008-01-26 19:54 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: help-gnu-emacs

On Sat, Jan 26, 2008 at 08:21:24PM +0100, Thierry Volpiatto wrote:
> Did you try running delete-trailing-white-space or picture-mode on your
> files ?
> 

Thanks for the suggestion, but that didn't seem to do the job.

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

* Re: Mysterious hidden end of line characters.
  2008-01-26 19:21 ` Thierry Volpiatto
  2008-01-26 19:54   ` David
@ 2008-01-26 20:06   ` David
  2008-01-26 20:08     ` David
       [not found]   ` <mailman.6584.1201377847.18990.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 24+ messages in thread
From: David @ 2008-01-26 20:06 UTC (permalink / raw)
  To: Thierry Volpiatto
  Cc: help-gnu-emacs, dpleydel, Amélie Vaniscotte,
	Patrick Giraudoux

On Sat, Jan 26, 2008 at 08:21:24PM +0100, Thierry Volpiatto wrote:
> Did you try running delete-trailing-white-space or picture-mode on your
> files ?

Hey hold on, my last post was wrong, the delete-trailing-white-space
function solves the problem of pasting multiple lines into the
shell. Awesome, nice one dude.

I'll have to ask my colleage if he still has problems with the scripts
I send him after I use this funciton.

Thanks for the solution Thierry, this turned out to be way simpler
than I feared.

Dave :0)

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

* Re: Mysterious hidden end of line characters.
  2008-01-26 20:06   ` David
@ 2008-01-26 20:08     ` David
  0 siblings, 0 replies; 24+ messages in thread
From: David @ 2008-01-26 20:08 UTC (permalink / raw)
  To: David; +Cc: help-gnu-emacs, Patrick Giraudoux, Amélie Vaniscotte

> Hey hold on, my last post was wrong, the delete-trailing-white-space
> function solves the problem of pasting multiple lines into the
> shell. Awesome, nice one dude.
> 

Looks like nobody received the last post anyway. Again many thanks.

Dave

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

* Re: Mysterious hidden end of line characters.
  2008-01-26 17:14 David
  2008-01-26 19:21 ` Thierry Volpiatto
@ 2008-01-26 20:41 ` Peter Dyballa
  2008-01-30 15:04   ` David
       [not found]   ` <mailman.6748.1201705322.18990.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 24+ messages in thread
From: Peter Dyballa @ 2008-01-26 20:41 UTC (permalink / raw)
  To: dpleydel; +Cc: help-gnu-emacs, Patrick Giraudoux


Am 26.01.2008 um 18:14 schrieb David:

> How might I try to identify what is going on here?


You could have used a *-dos or *-mac encoding, which have two  
characters as line endings: line feed-carriage return or carriage  
return-line feed. This might cause trouble. You can check this by  
clicking with the mouse cursor onto the encoding marker in mode-line  
– at least in GNU Emacs 22. Otherwise there is describe-encoding.

But the *BIG* question is: why and for what do you need some external  
terminal application?!

In GNU Emacs you can imitate your behaviour by creating a *shell*  
buffer (M-x shell RET). In this *shell* buffer you have all that  
available what GNU Emacs can do, for example "flattening" your  
configure invocation.

It's possible too to use the *scratch* buffer to prepare such a long  
and complicated line.

And finally, the top choice: use compile! M-x compile RET and remove  
whatever you see in minibuffer, then paste (yank) the configure  
invocation as one line. You're still able to edit this line, isearch,  
whatever – and remove that "2>&1 | tee config_log.txt" ballast! Press  
RET. Isn't what you now see much nicer with the colourful faces? You  
can save that buffer – and you better kill it, that compile does not  
overwrite it when you start to really compile the software!

GNU Emacs can even remember your compile commands (M-x compile RET UP  
UP). IMO it's better not to rely on bash and explicitly use

	env <whichever environment settings> <the command>


And there is one situation when it's rather useful to configure in  
*compilation* buffer: when the line of input is too long for the  
shell to handle interactively.

--
Greetings

   Pete

The light at the end of the tunnel has been turned off due to budget  
cuts.

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

* Re: Mysterious hidden end of line characters.
       [not found]   ` <mailman.6584.1201377847.18990.help-gnu-emacs@gnu.org>
@ 2008-01-27  6:10     ` Tim X
  0 siblings, 0 replies; 24+ messages in thread
From: Tim X @ 2008-01-27  6:10 UTC (permalink / raw)
  To: help-gnu-emacs

David <dpleydel@univ-fcomte.fr> writes:

> On Sat, Jan 26, 2008 at 08:21:24PM +0100, Thierry Volpiatto wrote:
>> Did you try running delete-trailing-white-space or picture-mode on your
>> files ?
>
> Hey hold on, my last post was wrong, the delete-trailing-white-space
> function solves the problem of pasting multiple lines into the
> shell. Awesome, nice one dude.
>
> I'll have to ask my colleage if he still has problems with the scripts
> I send him after I use this funciton.
>
> Thanks for the solution Thierry, this turned out to be way simpler
> than I feared.
>

Its good you have a solution, but you have only addressed the symptom
and not the cause. this may be good enough, but I'd suggest that as this
shouldn't happen, there is something else wrong and its likely to cause
you subtle problems in other areas. 

What does emacs show on the mode line? For example, I have a u: at the
left to indicate my script buffer is in UTF-8 as this is the default
locale on my Debian system.

What is the default locale setting on your Debian system and that of
your colleagues?

What major and minor modes do you have loaded? 

Do you get the same 'odd' cut and paste behavior with all terminals
(i.e. gnome-terminal, xterm, rxvt and the linux console)? Are you using
anything like CUA mode? If you open a buffer with VI in a terminal and
paste from emacs into that buffer, do you get odd behavior, such as the
text 'stepping'?

Tim

-- 
tcross (at) rapttech dot com dot au

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

* Re: Mysterious hidden end of line characters.
  2008-01-26 20:41 ` Peter Dyballa
@ 2008-01-30 15:04   ` David
       [not found]   ` <mailman.6748.1201705322.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 24+ messages in thread
From: David @ 2008-01-30 15:04 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs, Patrick Giraudoux

Thanks Pete for you reply.

> You could have used a *-dos or *-mac encoding, which have two  
> characters as line endings: line feed-carriage return or carriage  
> return-line feed. This might cause trouble. You can check this by  
> clicking with the mouse cursor onto the encoding marker in mode-line  
> ? at least in GNU Emacs 22. Otherwise there is describe-encoding.

In emacs 21 the equivelent is M-x describe-coding-system. Right now
this is defined as undecided-unix which is repressented as -- in the
mode-line. Perhaps for some reason this was not the case last week
when my colleague complained about -dos coding.
 
> But the *BIG* question is: why and for what do you need some
> external terminal application?!  In GNU Emacs you can imitate your
> behaviour by creating a *shell* buffer (M-x shell RET). In this
> *shell* buffer you have all that available what GNU Emacs can do,
> for example "flattening" your configure invocation.


Ha ha, I thought someone might spot this. After 2 years of emacs use I
still have one or two newbie feathers lerking in my plummage. I do use
*shell* buffers alot, but there is some terminal functionality which I
do not have.

Examples of commands in a *shell* buffer which for me don't work as in
a terminal include

1) shell_prompt:~$ man pwd ## (or any other command), this gives
something rather unfriendly in emacs. Only today did I discover M-x
man was the proper way to do this. Nice feature, but rather
non-evident to the newbie. Why is *shell* not totally equivelent to a
terminal?

2) shell_prompt:~$ grass ## Similarly to typing man at the prompt, the
lack of terminal functionality used to prevent me from passing the
terminal based setup page. I recently discoverred the solution (for
older versions of GRASS) was to add a flag specifying a GUI setup
page. Also updating to more recent versions appears to avoid this
problem. So now I am finally using GRASS in emacs (horrah!).

3) shell_prompt:~$ mutt ## Similarly, I cannot find a way to navigate
my mail boxes using mutt inside emacs. Emacs just isn't displaying
anything that would normally appear in the terminal apart from when I
hit q it asks if I really want to quit - of course I do, I can't see
anything! The best I can do is to run mutt in the terminal, pass to
emacs to write messages and pass back to the terminal to handle
attachments etc. What am I missing?

4) shell_prompt:~$ su ## I never like moving to super user in emacs
because the password appears on screen as I type it. So all
administration is terminal based for me. How to hide passwords as a
terminal would?



> It's possible too to use the *scratch* buffer to prepare such a long  
> and complicated line.
> 
> And finally, the top choice: use compile! M-x compile RET and remove  
> whatever you see in minibuffer, then paste (yank) the configure  
> invocation as one line. You're still able to edit this line, isearch,  
> whatever ? and remove that "2>&1 | tee config_log.txt" ballast! Press  
> RET. Isn't what you now see much nicer with the colourful faces? You  
> can save that buffer ? and you better kill it, that compile does not  
> overwrite it when you start to really compile the software!
> 
> GNU Emacs can even remember your compile commands (M-x compile RET UP  
> UP). IMO it's better not to rely on bash and explicitly use
> 
> 	env <whichever environment settings> <the command>
> 
> 
> And there is one situation when it's rather useful to configure in  
> *compilation* buffer: when the line of input is too long for the  
> shell to handle interactively.

Wow, that sounds awesome. I'll bear it in mind for next time.
cheers
David

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

* Re: Mysterious hidden end of line characters.
       [not found]   ` <mailman.6748.1201705322.18990.help-gnu-emacs@gnu.org>
@ 2008-01-31  6:21     ` Tim X
  2008-01-31 10:20       ` Thierry Volpiatto
  0 siblings, 1 reply; 24+ messages in thread
From: Tim X @ 2008-01-31  6:21 UTC (permalink / raw)
  To: help-gnu-emacs

David <dpleydel@univ-fcomte.fr> writes:

>
> Ha ha, I thought someone might spot this. After 2 years of emacs use I
> still have one or two newbie feathers lerking in my plummage. I do use
> *shell* buffers alot, but there is some terminal functionality which I
> do not have.
>
> Examples of commands in a *shell* buffer which for me don't work as in
> a terminal include
>
> 1) shell_prompt:~$ man pwd ## (or any other command), this gives
> something rather unfriendly in emacs. Only today did I discover M-x
> man was the proper way to do this. Nice feature, but rather
> non-evident to the newbie. Why is *shell* not totally equivelent to a
> terminal?

The command M-x shell gives you a 'dumb' terminal. This means any
program that relies on terminal IO to display correctly wil fail. for
programs like this, use M-x term. 

>
> 2) shell_prompt:~$ grass ## Similarly to typing man at the prompt, the
> lack of terminal functionality used to prevent me from passing the
> terminal based setup page. I recently discoverred the solution (for
> older versions of GRASS) was to add a flag specifying a GUI setup
> page. Also updating to more recent versions appears to avoid this
> problem. So now I am finally using GRASS in emacs (horrah!).
>

Again, M-x term may be a better solution. Of course, you could just
write a special grass-mode and stick it up on emacswiki :)

> 3) shell_prompt:~$ mutt ## Similarly, I cannot find a way to navigate
> my mail boxes using mutt inside emacs. Emacs just isn't displaying
> anything that would normally appear in the terminal apart from when I
> hit q it asks if I really want to quit - of course I do, I can't see
> anything! The best I can do is to run mutt in the terminal, pass to
> emacs to write messages and pass back to the terminal to handle
> attachments etc. What am I missing?
>

I think there may be amode out there for running mutt in emacs. However,
maybe switch to a native emacs mail client. If you use IMAP, you could
use one of the many emacs mail clients that support imap and then when
your not in emcs, you can use mutt and still have access to all your
mail. There are also interfaces to gmail. 

> 4) shell_prompt:~$ su ## I never like moving to super user in emacs
> because the password appears on screen as I type it. So all
> administration is terminal based for me. How to hide passwords as a
> terminal would?
>
I don't get this problem using M-x term
I also use tramp to edit files owned by others from within emacs
i.e. /root@localhost:/path/to/file

Use M-x shell only when you want to execute simple line oriented
programs that don't need things like ncurses or formatted screen IO. 

finally, if your someone who likes to use lisp at the shell level and
have nice integration with emacs, have a look at the emacs shell - type
M-x eshell

Tim

-- 
tcross (at) rapttech dot com dot au


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

* Re: Mysterious hidden end of line characters.
  2008-01-31  6:21     ` Tim X
@ 2008-01-31 10:20       ` Thierry Volpiatto
  2008-01-31 11:17         ` Peter Dyballa
  0 siblings, 1 reply; 24+ messages in thread
From: Thierry Volpiatto @ 2008-01-31 10:20 UTC (permalink / raw)
  To: help-gnu-emacs

Tim X <timx@nospam.dev.null> writes:

> David <dpleydel@univ-fcomte.fr> writes:
>
>>
>> Ha ha, I thought someone might spot this. After 2 years of emacs use I
>> still have one or two newbie feathers lerking in my plummage. I do use
>> *shell* buffers alot, but there is some terminal functionality which I
>> do not have.
>>
>> Examples of commands in a *shell* buffer which for me don't work as in
>> a terminal include
>>
>> 1) shell_prompt:~$ man pwd ## (or any other command), this gives
>> something rather unfriendly in emacs. Only today did I discover M-x
>> man was the proper way to do this. Nice feature, but rather
>> non-evident to the newbie. Why is *shell* not totally equivelent to a
>> terminal?
>
> The command M-x shell gives you a 'dumb' terminal. This means any
> program that relies on terminal IO to display correctly wil fail. for
> programs like this, use M-x term. 
>
>>
>> 2) shell_prompt:~$ grass ## Similarly to typing man at the prompt, the
>> lack of terminal functionality used to prevent me from passing the
>> terminal based setup page. I recently discoverred the solution (for
>> older versions of GRASS) was to add a flag specifying a GUI setup
>> page. Also updating to more recent versions appears to avoid this
>> problem. So now I am finally using GRASS in emacs (horrah!).
>>
>
> Again, M-x term may be a better solution. Of course, you could just
> write a special grass-mode and stick it up on emacswiki :)
>
>> 3) shell_prompt:~$ mutt ## Similarly, I cannot find a way to navigate
>> my mail boxes using mutt inside emacs. Emacs just isn't displaying
>> anything that would normally appear in the terminal apart from when I
>> hit q it asks if I really want to quit - of course I do, I can't see
>> anything! The best I can do is to run mutt in the terminal, pass to
>> emacs to write messages and pass back to the terminal to handle
>> attachments etc. What am I missing?
>>
>
> I think there may be amode out there for running mutt in emacs. However,
> maybe switch to a native emacs mail client. If you use IMAP, you could
> use one of the many emacs mail clients that support imap and then when
> your not in emcs, you can use mutt and still have access to all your
> mail. There are also interfaces to gmail. 
>
>> 4) shell_prompt:~$ su ## I never like moving to super user in emacs
>> because the password appears on screen as I type it. So all
>> administration is terminal based for me. How to hide passwords as a
>> terminal would?
>>
If you start emacs with LC_ALL=C the prompt for password will be
Password:
and will be hidden.
The problem is when locale is french or else maybe, the regex that
match "Mot de passe :" don't exist.

I tried to modify it but without success .
It is in comint.el:

(defcustom comint-password-prompt-regexp
  "\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|\
Kerberos \\|CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)\
\[Pp]assword\\( (again)\\)?\\|\
pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\
\\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'"
  "*Regexp matching prompts for passwords in the inferior process.
This is used by `comint-watch-for-password-prompt'."
  :type 'regexp
  :group 'comint)


If some body find how to modify that it's welcome

> I don't get this problem using M-x term
> I also use tramp to edit files owned by others from within emacs
> i.e. /root@localhost:/path/to/file
>
> Use M-x shell only when you want to execute simple line oriented
> programs that don't need things like ncurses or formatted screen IO. 
>
> finally, if your someone who likes to use lisp at the shell level and
> have nice integration with emacs, have a look at the emacs shell - type
> M-x eshell
>
> Tim

-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
  2008-01-31 10:20       ` Thierry Volpiatto
@ 2008-01-31 11:17         ` Peter Dyballa
  2008-01-31 12:44           ` Thierry Volpiatto
                             ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Peter Dyballa @ 2008-01-31 11:17 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: help-gnu-emacs


Am 31.01.2008 um 11:20 schrieb Thierry Volpiatto:

> The problem is when locale is french or else maybe, the regex that
> match "Mot de passe :" don't exist.

Could be this works:

	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos \\| 
CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\ 
\)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\ 
(?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"


It's a very complicated structure that takes into account that you  
might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP  
password, some pass phrase, and I don't know what else.

Forgetting all this troublesome stuff, just describe another option

	\\|Mot de passe

with a final SPC that is then followed by

	?\\(?: for [^:]+\\)

so you have to put everything before this expression into a froup  
with \\(...\\). Or this is more correct?

	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos \\| 
CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\ 
\)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\ 
(?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"

Mostly guessing, not completely understanding.

--
Greetings

   Pete

Isn't vi that text editor with two modes... one that beeps and one  
that corrupts your file?
				– Dan Jacobson, on comp.os.linux.advocacy








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

* Re: Mysterious hidden end of line characters.
  2008-01-31 11:17         ` Peter Dyballa
@ 2008-01-31 12:44           ` Thierry Volpiatto
  2008-01-31 16:04           ` Thierry Volpiatto
                             ` (5 subsequent siblings)
  6 siblings, 0 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-01-31 12:44 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 31.01.2008 um 11:20 schrieb Thierry Volpiatto:
>
>> The problem is when locale is french or else maybe, the regex that
>> match "Mot de passe :" don't exist.
>
> Could be this works:
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"
>
>
> It's a very complicated structure that takes into account that you
> might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP
> password, some pass phrase, and I don't know what else.
>
> Forgetting all this troublesome stuff, just describe another option
>
> 	\\|Mot de passe
>
> with a final SPC that is then followed by
>
> 	?\\(?: for [^:]+\\)
>
> so you have to put everything before this expression into a froup with
> \\(...\\). Or this is more correct?
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"
>
> Mostly guessing, not completely understanding.

I will try again to modify this with your advices,
another thing is (that don't appear in this mail)
after Mot de passe there is a "_" and then ":"
The "_" is in blue and i think it's not a litteral "_"
but an unicode char or something like that but i don't
know what it is exactly.
May be it's why all the regex i tried before failed ?

-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
  2008-01-31 11:17         ` Peter Dyballa
  2008-01-31 12:44           ` Thierry Volpiatto
@ 2008-01-31 16:04           ` Thierry Volpiatto
  2008-01-31 16:12           ` Thierry Volpiatto
                             ` (4 subsequent siblings)
  6 siblings, 0 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-01-31 16:04 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 31.01.2008 um 11:20 schrieb Thierry Volpiatto:
>
>> The problem is when locale is french or else maybe, the regex that
>> match "Mot de passe :" don't exist.
>
> Could be this works:
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"
>
>
> It's a very complicated structure that takes into account that you
> might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP
> password, some pass phrase, and I don't know what else.
>
> Forgetting all this troublesome stuff, just describe another option
>
> 	\\|Mot de passe
>
> with a final SPC that is then followed by
>
> 	?\\(?: for [^:]+\\)
>
> so you have to put everything before this expression into a froup with
> \\(...\\). Or this is more correct?
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"
>
> Mostly guessing, not completely understanding.
Not working for the moment, i keep trying.
What i find is that Mot de passe_: is 
Mot de passe.:

Here is the describe of the character:


        character:   (160, #o240, #xa0)
preferred charset: iso-8859-1 (Latin-1 (ISO/IEC 8859-1))
       code point: 0xA0
           syntax: . 	which means: punctuation
         category: b:Arabic j:Japanese l:Latin
      buffer code: #xC2 #xA0
        file code: #xC2 #xA0 (encoded by coding system utf-8)
          display: by this font (glyph code)
     courier:pixelsize=14:foundry=adobe:weight=bold:slant=r:width=normal (#x61)
   hardcoded face: nobreak-space

Character code properties are not shown: customize what to show

There is an overlay here:
 From 1 to 17
  face                 regex-tool-matched-face

\([Mot de passe]*.*:*[blank]?\)
that regex work in regex-tool but don't work in the whole regexp

-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
  2008-01-31 11:17         ` Peter Dyballa
  2008-01-31 12:44           ` Thierry Volpiatto
  2008-01-31 16:04           ` Thierry Volpiatto
@ 2008-01-31 16:12           ` Thierry Volpiatto
  2008-01-31 16:40           ` Thierry Volpiatto
                             ` (3 subsequent siblings)
  6 siblings, 0 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-01-31 16:12 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 31.01.2008 um 11:20 schrieb Thierry Volpiatto:
>
>> The problem is when locale is french or else maybe, the regex that
>> match "Mot de passe :" don't exist.
>
> Could be this works:
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"
>
>
> It's a very complicated structure that takes into account that you
> might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP
> password, some pass phrase, and I don't know what else.
>
> Forgetting all this troublesome stuff, just describe another option
>
> 	\\|Mot de passe
>
> with a final SPC that is then followed by
>
> 	?\\(?: for [^:]+\\)
>
> so you have to put everything before this expression into a froup with
> \\(...\\). Or this is more correct?
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"
>
> Mostly guessing, not completely understanding.

Sorry, your first one seem good:

(setq comint-password-prompt-regexp 
      "\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
\\|
CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
\)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
(?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'")

I keep trying but it seem working.

-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
       [not found] <20080131144200.566493BC03B@ufc.univ-fcomte.fr>
@ 2008-01-31 16:36 ` David
  0 siblings, 0 replies; 24+ messages in thread
From: David @ 2008-01-31 16:36 UTC (permalink / raw)
  To: help-gnu-emacs

> > The command M-x shell gives you a 'dumb' terminal. This means any
> > program that relies on terminal IO to display correctly wil fail. for
> > programs like this, use M-x term. 

Brilliant!! Thanks for all the useful suggestions you folks have put
forward, I can now wipe Konsole off my hard drive!!! (Plus the fonts
appear bigger which is nice :0) )

cheers
Dave






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

* Re: Mysterious hidden end of line characters.
  2008-01-31 11:17         ` Peter Dyballa
                             ` (2 preceding siblings ...)
  2008-01-31 16:12           ` Thierry Volpiatto
@ 2008-01-31 16:40           ` Thierry Volpiatto
  2008-02-02 14:18           ` Thierry Volpiatto
                             ` (2 subsequent siblings)
  6 siblings, 0 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-01-31 16:40 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 31.01.2008 um 11:20 schrieb Thierry Volpiatto:
>
>> The problem is when locale is french or else maybe, the regex that
>> match "Mot de passe :" don't exist.
>
> Could be this works:
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"
>
>
> It's a very complicated structure that takes into account that you
> might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP
> password, some pass phrase, and I don't know what else.
>
> Forgetting all this troublesome stuff, just describe another option
>
> 	\\|Mot de passe
>
> with a final SPC that is then followed by
>
> 	?\\(?: for [^:]+\\)
>
> so you have to put everything before this expression into a froup with
> \\(...\\). Or this is more correct?
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"
>
> Mostly guessing, not completely understanding.

I have tested it in ubuntu and here in gentoo
Tramp prompt, sudo are not affected, it work.

So here to have password hidden with french prompt:

(setq comint-password-prompt-regexp 
      "\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
\\|
CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
\)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
(?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'")

Thank you for your help.

-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
       [not found] <20080131170759.CC0B71BC00C@ufc.univ-fcomte.fr>
@ 2008-01-31 17:54 ` David
  2008-01-31 18:28   ` Thierry Volpiatto
  0 siblings, 1 reply; 24+ messages in thread
From: David @ 2008-01-31 17:54 UTC (permalink / raw)
  To: help-gnu-emacs

> >> The problem is when locale is french or else maybe, the regex that
> >> match "Mot de passe :" don't exist.
> >
> > Could be this works:
> >
> > 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> > \\|
> > CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> > \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> > (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"
> >
> >
> > It's a very complicated structure that takes into account that you
> > might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP
> > password, some pass phrase, and I don't know what else.
> >
> > Forgetting all this troublesome stuff, just describe another option
> >
> > 	\\|Mot de passe
> >
> > with a final SPC that is then followed by
> >
> > 	?\\(?: for [^:]+\\)
> >
> > so you have to put everything before this expression into a froup with
> > \\(...\\). Or this is more correct?
> >
> > 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> > \\|
> > CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> > \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> > (?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"
> >
> > Mostly guessing, not completely understanding.
> 
> I have tested it in ubuntu and here in gentoo
> Tramp prompt, sudo are not affected, it work.
> 
> So here to have password hidden with french prompt:
> 
> (setq comint-password-prompt-regexp 
>       "\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'")
> 
> Thank you for your help.
 
Hi Thierry

Thaks for going into such depth, you guys are going way deeper than I
am able to here. Unfortunately this doesn't work in my *shell*, I
still see the characters typed at the password: prompt. But I don't
mind. I love the M-x term for running mutt and M-x eshell seems very
cool for super user tasks, unlike the terminal emulator you don't
loose the emacs functionality.

I have one small proble with the eshell, after running su my promt is
a bit naff.

~ $ su
Password: 
^[[1;31mdell-1 /home/dave #^[[0m 

What options are there for having a nicer prompt in eshell? It would
be nice to show the path in the prompt when the path is short or
abreviate the path in the prompt when the path is long. Am I dreaming?

cheers
Dave




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

* Re: Mysterious hidden end of line characters.
  2008-01-31 17:54 ` David
@ 2008-01-31 18:28   ` Thierry Volpiatto
  2008-02-01 12:54     ` David
  0 siblings, 1 reply; 24+ messages in thread
From: Thierry Volpiatto @ 2008-01-31 18:28 UTC (permalink / raw)
  To: dpleydel; +Cc: help-gnu-emacs

David <dpleydel@univ-fcomte.fr> writes:

>> >> The problem is when locale is french or else maybe, the regex that
>> >> match "Mot de passe :" don't exist.
>> >
>> > Could be this works:
>> >
>> > 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
>> > \\|
>> > CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
>> > \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
>> > (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"
>> >
>> >
>> > It's a very complicated structure that takes into account that you
>> > might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP
>> > password, some pass phrase, and I don't know what else.
>> >
>> > Forgetting all this troublesome stuff, just describe another option
>> >
>> > 	\\|Mot de passe
>> >
>> > with a final SPC that is then followed by
>> >
>> > 	?\\(?: for [^:]+\\)
>> >
>> > so you have to put everything before this expression into a froup with
>> > \\(...\\). Or this is more correct?
>> >
>> > 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
>> > \\|
>> > CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
>> > \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
>> > (?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"
>> >
>> > Mostly guessing, not completely understanding.
>> 
>> I have tested it in ubuntu and here in gentoo
>> Tramp prompt, sudo are not affected, it work.
>> 
>> So here to have password hidden with french prompt:
>> 
>> (setq comint-password-prompt-regexp 
>>       "\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
>> \\|
>> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
>> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
>> (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'")
>> 
>> Thank you for your help.
>  
> Hi Thierry
>
> Thaks for going into such depth, you guys are going way deeper than I
> am able to here. Unfortunately this doesn't work in my *shell*, I
> still see the characters typed at the password: prompt. But I don't
> mind. I love the M-x term for running mutt and M-x eshell seems very
> cool for super user tasks, unlike the terminal emulator you don't
> loose the emacs functionality.
>
> I have one small proble with the eshell, after running su my promt is
> a bit naff.
>
> ~ $ su
> Password: 
> dell-1 /home/dave # 
>
> What options are there for having a nicer prompt in eshell? It would
> be nice to show the path in the prompt when the path is short or
> abreviate the path in the prompt when the path is long. Am I dreaming?

Is it what you need ?

(setq eshell-output-filter-functions (list 'eshell-handle-ansi-color 
					   'eshell-handle-control-codes 
					   'eshell-watch-for-password-prompt))


-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
  2008-01-31 18:28   ` Thierry Volpiatto
@ 2008-02-01 12:54     ` David
  2008-02-01 14:07       ` Thierry Volpiatto
  2008-02-01 15:11       ` Thierry Volpiatto
  0 siblings, 2 replies; 24+ messages in thread
From: David @ 2008-02-01 12:54 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: help-gnu-emacs


> > ~ $ su
> > Password: 
> > dell-1 /home/dave # 
> >
> > What options are there for having a nicer prompt in eshell? It would
> > be nice to show the path in the prompt when the path is short or
> > abreviate the path in the prompt when the path is long. Am I dreaming?
> 
> Is it what you need ?
> 
> (setq eshell-output-filter-functions (list 'eshell-handle-ansi-color 
> 					   'eshell-handle-control-codes 
> 					   'eshell-watch-for-password-prompt))

Thanks Thiery, well not quite. Actually, something funny happened with
my last email, what I see at the prompt for the super user has some
code which looks like "^ [1;31m", but when I send this email from
emacs to mutt this code becomes converted so in the email it doesn't
look so bad and no one could see what the problem was.  To get around
this I have added a space after the ^ in this email. It's the "^
[1;31m" which really looks bad in the eshell. It looks like this short
piece of code isn't converted but just pronted as it is making the
prompt for the super user look ugly.

cheers
Dave




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

* Re: Mysterious hidden end of line characters.
  2008-02-01 12:54     ` David
@ 2008-02-01 14:07       ` Thierry Volpiatto
  2008-02-01 15:11       ` Thierry Volpiatto
  1 sibling, 0 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-02-01 14:07 UTC (permalink / raw)
  To: dpleydel; +Cc: help-gnu-emacs

David <dpleydel@univ-fcomte.fr> writes:

>> > ~ $ su
>> > Password: 
>> > dell-1 /home/dave # 
>> >
>> > What options are there for having a nicer prompt in eshell? It would
>> > be nice to show the path in the prompt when the path is short or
>> > abreviate the path in the prompt when the path is long. Am I dreaming?
>> 
>> Is it what you need ?
>> 
>> (setq eshell-output-filter-functions (list 'eshell-handle-ansi-color 
>> 					   'eshell-handle-control-codes 
>> 					   'eshell-watch-for-password-prompt))
>
> Thanks Thiery, well not quite. Actually, something funny happened with
> my last email, what I see at the prompt for the super user has some
> code which looks like "^ [1;31m", but when I send this email from
> emacs to mutt this code becomes converted so in the email it doesn't
> look so bad and no one could see what the problem was.  To get around
> this I have added a space after the ^ in this email. It's the "^
> [1;31m" which really looks bad in the eshell. It looks like this short
> piece of code isn't converted but just pronted as it is making the
> prompt for the super user look ugly.
>
> cheers
> Dave
>
I guessed that , it do the same here if i don't use 
eshell-output-filter-functions.

Do you have ansi color enabled in your .emacs ?

(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

When you do ls do you have color (blue dir , ...etc) ?
if not may be you can add dumb to ~/.ls_colors or /etc/DIR_COLORS

-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
  2008-02-01 12:54     ` David
  2008-02-01 14:07       ` Thierry Volpiatto
@ 2008-02-01 15:11       ` Thierry Volpiatto
  1 sibling, 0 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-02-01 15:11 UTC (permalink / raw)
  To: dpleydel; +Cc: help-gnu-emacs

David <dpleydel@univ-fcomte.fr> writes:

>> > ~ $ su
>> > Password: 
>> > dell-1 /home/dave # 
>> >
>> > What options are there for having a nicer prompt in eshell? It would
>> > be nice to show the path in the prompt when the path is short or
>> > abreviate the path in the prompt when the path is long. Am I dreaming?
>> 
>> Is it what you need ?
>> 
>> (setq eshell-output-filter-functions (list 'eshell-handle-ansi-color 
>> 					   'eshell-handle-control-codes 
>> 					   'eshell-watch-for-password-prompt))
>
> Thanks Thiery, well not quite. Actually, something funny happened with
> my last email, what I see at the prompt for the super user has some
> code which looks like "^ [1;31m", but when I send this email from
> emacs to mutt this code becomes converted so in the email it doesn't
> look so bad and no one could see what the problem was.  To get around
> this I have added a space after the ^ in this email. It's the "^
> [1;31m" which really looks bad in the eshell. It looks like this short
> piece of code isn't converted but just pronted as it is making the
> prompt for the super user look ugly.
>
> cheers
> Dave
>

And here the regex for prompt password in eshell for french locale:

(setq eshell-password-prompt-regexp "[Pp]ass\\(word\\|phrase\\).*:\\s *\\'\\|[Mot de passe.]*:\\s *\\'")
-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
  2008-01-31 11:17         ` Peter Dyballa
                             ` (3 preceding siblings ...)
  2008-01-31 16:40           ` Thierry Volpiatto
@ 2008-02-02 14:18           ` Thierry Volpiatto
  2008-02-04 13:00           ` Thierry Volpiatto
  2008-02-04 13:10           ` Thierry Volpiatto
  6 siblings, 0 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-02-02 14:18 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 31.01.2008 um 11:20 schrieb Thierry Volpiatto:
>
>> The problem is when locale is french or else maybe, the regex that
>> match "Mot de passe :" don't exist.
>
> Could be this works:
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"
>
>
> It's a very complicated structure that takes into account that you
> might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP
> password, some pass phrase, and I don't know what else.
>
> Forgetting all this troublesome stuff, just describe another option
>
> 	\\|Mot de passe
>
> with a final SPC that is then followed by
>
> 	?\\(?: for [^:]+\\)
>
> so you have to put everything before this expression into a froup with
> \\(...\\). Or this is more correct?
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"
>
> Mostly guessing, not completely understanding.

As you warn me at the start of this post,
i have strange effect with this regex:
when i do tar command i have a prompt like "tar: "
when i launch a script python with some raw-input,
in a python-shell (ipython) the prompt is hidden like a password.

So i tried to modify the regex again:
I can have a prompt for su correct but always with side effects on 
some other commands.

I think the best should be modifying bash to avoid this stupid
"Mot de passe : " and have a normal "Password: "
without modifying the locale env variables.
But i don't know where i can modify that for the moment.

If emacs is started with LC_ALL=C the prompt is "Password: "
Thats a way to do but some errors can appear on french files(not sure)

-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
  2008-01-31 11:17         ` Peter Dyballa
                             ` (4 preceding siblings ...)
  2008-02-02 14:18           ` Thierry Volpiatto
@ 2008-02-04 13:00           ` Thierry Volpiatto
  2008-02-04 13:10           ` Thierry Volpiatto
  6 siblings, 0 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-02-04 13:00 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 31.01.2008 um 11:20 schrieb Thierry Volpiatto:
>
>> The problem is when locale is french or else maybe, the regex that
>> match "Mot de passe :" don't exist.
>
> Could be this works:
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"
>
>
> It's a very complicated structure that takes into account that you
> might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP
> password, some pass phrase, and I don't know what else.
>
> Forgetting all this troublesome stuff, just describe another option
>
> 	\\|Mot de passe
>
> with a final SPC that is then followed by
>
> 	?\\(?: for [^:]+\\)
>
> so you have to put everything before this expression into a froup with
> \\(...\\). Or this is more correct?
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"
>
> Mostly guessing, not completely understanding.

Finally, i found the best solution, without modifying the regex:
Just set in .bashrc an alias ==> alias su="LC_ALL su -l"
Like that the prompt is password, is hidden and when you are root,
if you do echo $LC_ALL, the env variable is unchanged (-l option of su)
fr_FR.UTF-8 for me.
Thats much more safe than modifying the comint regex.

-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

* Re: Mysterious hidden end of line characters.
  2008-01-31 11:17         ` Peter Dyballa
                             ` (5 preceding siblings ...)
  2008-02-04 13:00           ` Thierry Volpiatto
@ 2008-02-04 13:10           ` Thierry Volpiatto
  6 siblings, 0 replies; 24+ messages in thread
From: Thierry Volpiatto @ 2008-02-04 13:10 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 31.01.2008 um 11:20 schrieb Thierry Volpiatto:
>
>> The problem is when locale is french or else maybe, the regex that
>> match "Mot de passe :" don't exist.
>
> Could be this works:
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)\\|Mot de passe \\)?\\(?: for [^:]+\\)?:\\s *\\'"
>
>
> It's a very complicated structure that takes into account that you
> might fail to enter correctly a Kerberos, or CVS, or SMB, or LDAP
> password, some pass phrase, and I don't know what else.
>
> Forgetting all this troublesome stuff, just describe another option
>
> 	\\|Mot de passe
>
> with a final SPC that is then followed by
>
> 	?\\(?: for [^:]+\\)
>
> so you have to put everything before this expression into a froup with
> \\(...\\). Or this is more correct?
>
> 	"\\(\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|Kerberos
> \\|
> CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)[Pp]assword\\( (again)\
> \)?\\|pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\\
> (?:, try again\\)?\\(?: for [^:]+\\)\\|Mot de passe \\)?:\\s *\\'"
>
> Mostly guessing, not completely understanding.

For eshell, add alias for su like that:
alias 'LC_ALL=C su -l'

thought the regex i gave in last posts seem safe, but that is much
better.

-- 
A + Thierry
Pub key: http://pgp.mit.edu




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

end of thread, other threads:[~2008-02-04 13:10 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080131144200.566493BC03B@ufc.univ-fcomte.fr>
2008-01-31 16:36 ` Mysterious hidden end of line characters David
     [not found] <20080131170759.CC0B71BC00C@ufc.univ-fcomte.fr>
2008-01-31 17:54 ` David
2008-01-31 18:28   ` Thierry Volpiatto
2008-02-01 12:54     ` David
2008-02-01 14:07       ` Thierry Volpiatto
2008-02-01 15:11       ` Thierry Volpiatto
2008-01-26 17:14 David
2008-01-26 19:21 ` Thierry Volpiatto
2008-01-26 19:54   ` David
2008-01-26 20:06   ` David
2008-01-26 20:08     ` David
     [not found]   ` <mailman.6584.1201377847.18990.help-gnu-emacs@gnu.org>
2008-01-27  6:10     ` Tim X
2008-01-26 20:41 ` Peter Dyballa
2008-01-30 15:04   ` David
     [not found]   ` <mailman.6748.1201705322.18990.help-gnu-emacs@gnu.org>
2008-01-31  6:21     ` Tim X
2008-01-31 10:20       ` Thierry Volpiatto
2008-01-31 11:17         ` Peter Dyballa
2008-01-31 12:44           ` Thierry Volpiatto
2008-01-31 16:04           ` Thierry Volpiatto
2008-01-31 16:12           ` Thierry Volpiatto
2008-01-31 16:40           ` Thierry Volpiatto
2008-02-02 14:18           ` Thierry Volpiatto
2008-02-04 13:00           ` Thierry Volpiatto
2008-02-04 13:10           ` Thierry Volpiatto

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.