bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ls colored output does not work with Emacs backup files, #*#


From: Eric Blake
Subject: Re: ls colored output does not work with Emacs backup files, #*#
Date: Fri, 11 Aug 2006 07:23:40 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Thunderbird/1.5.0.5 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Philip Ganchev on 8/11/2006 12:50 AM:
> The program "ls" cannot be configured to use a special color when
> listing backup files that start with a hash character (#).   A
> commonly encountered example of such files is backup files produced by
> Emacs: their names match the glob pattern #*#.

Actually dircolors and ls do not use glob patterns, but literal suffixes
(although I would like to see that changed, but have not had time to
propose a patch; and I don't know what performance hit using glob and/or
fnmatch will have compared to the current strncmp).  Which means only '.'
or '*' can start lines for suffix matching in the dircolors input.  And #
is the dircolors comment, so you have to resort to \043 or some other
escape sequence notation so that dircolors doesn't eat it as a comment.

With that in mind, you can feed this line to dircolors:
*\043 01;35

to get an LS_COLORS value that will turn emacs backup files magenta in an
ls listing.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE3ITc84KuGfSFAYARAnOxAJ92aRBrlNAddIQuX7uQItjoX2593ACfQoFO
0F5kHODDTbQCxOjdZvNr/0U=
=pNCe
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]