unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* M-x shell, run 'emacs --help', get colorized output... why?
@ 2011-01-17  2:11 Steven Thomas
  2011-01-18  9:20 ` Oleksandr Gavenko
  2011-01-22  1:48 ` Steven Thomas
  0 siblings, 2 replies; 4+ messages in thread
From: Steven Thomas @ 2011-01-17  2:11 UTC (permalink / raw)
  To: help-gnu-emacs

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

I notice that emacs shell-mode colorizes certain strings in the output of a
command you run. For example most (though not all) words starting with - or
-- get colorized. You can see this if you run emacs --help. I don't see this
goofy colorization in term mode or eshell mode.

Can anyone explain what the deal is? A cursory look at the code in shell.el
didn't reveal anything, but I'm sure that somewhere emacs must be deciding
to add colors to the output.

[-- Attachment #2: Type: text/html, Size: 501 bytes --]

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

* Re: M-x shell, run 'emacs --help', get colorized output... why?
  2011-01-17  2:11 M-x shell, run 'emacs --help', get colorized output... why? Steven Thomas
@ 2011-01-18  9:20 ` Oleksandr Gavenko
  2011-01-22  1:48 ` Steven Thomas
  1 sibling, 0 replies; 4+ messages in thread
From: Oleksandr Gavenko @ 2011-01-18  9:20 UTC (permalink / raw)
  To: help-gnu-emacs

On 17.01.2011 4:11, Steven Thomas wrote:
> I notice that emacs shell-mode colorizes certain strings in the output
> of a command you run. For example most (though not all) words starting
> with - or -- get colorized. You can see this if you run emacs --help. I
> don't see this goofy colorization in term mode or eshell mode.
>
> Can anyone explain what the deal is? A cursory look at the code in
> shell.el didn't reveal anything, but I'm sure that somewhere emacs must
> be deciding to add colors to the output.

term-mode and eshell-mode are mush different from shell-mode.
I can not help you.

Its settings are non common.

I also use

   (ansi-color-for-comint-mode-on)

for 'shell-mode'. This allow correctly see 'ls --color' or 'grep 
--color' output.




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

* Re: M-x shell, run 'emacs --help', get colorized output... why?
  2011-01-17  2:11 M-x shell, run 'emacs --help', get colorized output... why? Steven Thomas
  2011-01-18  9:20 ` Oleksandr Gavenko
@ 2011-01-22  1:48 ` Steven Thomas
  2011-02-06 20:59   ` PJ Weisberg
  1 sibling, 1 reply; 4+ messages in thread
From: Steven Thomas @ 2011-01-22  1:48 UTC (permalink / raw)
  To: help-gnu-emacs

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

It turns out shell.el is deliberately doing this, as I expected. The regexps
they use for the matching are in shell-font-lock-keywords. They don't work
that well (e.g. matching "--whatever" in the middle of a line, but not at
the beginning) and I find the colors distracting, so I just disabled the
coloring with (setq shell-font-lock-keywords nil).

On Sun, Jan 16, 2011 at 6:11 PM, Steven Thomas <sthomas314@gmail.com> wrote:

> I notice that emacs shell-mode colorizes certain strings in the output of a
> command you run. For example most (though not all) words starting with - or
> -- get colorized. You can see this if you run emacs --help. I don't see this
> goofy colorization in term mode or eshell mode.
>
> Can anyone explain what the deal is? A cursory look at the code in shell.el
> didn't reveal anything, but I'm sure that somewhere emacs must be deciding
> to add colors to the output.
>

[-- Attachment #2: Type: text/html, Size: 1255 bytes --]

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

* Re: M-x shell, run 'emacs --help', get colorized output... why?
  2011-01-22  1:48 ` Steven Thomas
@ 2011-02-06 20:59   ` PJ Weisberg
  0 siblings, 0 replies; 4+ messages in thread
From: PJ Weisberg @ 2011-02-06 20:59 UTC (permalink / raw)
  To: Steven Thomas; +Cc: help-gnu-emacs

On Fri, Jan 21, 2011 at 5:48 PM, Steven Thomas <sthomas314@gmail.com> wrote:
> They don't work
> that well (e.g. matching "--whatever" in the middle of a line, but not at
> the beginning)

I don't use any of the shells inside Emacs at all (They work
differently from my normal terminal emulator, which is annoying.), but
the above is clearly intentional.  In the middle of a line,
"--whatever" is an option, but at the beginning it's just a command
whose name happens to start with --.

-PJ



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

end of thread, other threads:[~2011-02-06 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17  2:11 M-x shell, run 'emacs --help', get colorized output... why? Steven Thomas
2011-01-18  9:20 ` Oleksandr Gavenko
2011-01-22  1:48 ` Steven Thomas
2011-02-06 20:59   ` PJ Weisberg

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