bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] ls: Use pretty UTF-8 arrow when showing where symlinks point


From: Pádraig Brady
Subject: Re: [PATCH] ls: Use pretty UTF-8 arrow when showing where symlinks point to
Date: Tue, 11 Aug 2009 22:27:25 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Lennart Poettering wrote:
> [Second version of the patch, makes this feature optional with --fancy-chars]

--fancy-chars :)
I'm not sure how serious this patch is.
How about:

alias lsf='ls -l --color | sed "s/ -> / $(tput bold)\u25aa\u25b6$(tput sgr0) /"'

cheers,
Pádraig.

p.s. this chunk is far too verbose

> +#ifdef HAVE_NL_LANGINFO
> +       static const char *arrow = NULL;
> +
> +       if (!arrow)
> +         {
> +           arrow = " -> ";
> +
> +           if (fancy_chars)
> +             {
> +               const char *cs;
> +               cs = nl_langinfo(CODESET);
> +
> +               if (cs && strcmp(cs, "UTF-8") == 0)
> +                 arrow = " \xe2\x86\x92 ";
> +             }
> +         }
> +       DIRED_FPUTS_LITERAL (arrow, stdout);
> +#else
>         DIRED_FPUTS_LITERAL (" -> ", stdout);
> +#endif

this is equivalent I think:

       static const char *arrow = " -> ";
#ifdef HAVE_NL_LANGINFO
       if (fancy_chars && STREQ (nl_langinfo (CODESET), "UTF-8"))
         arrow = " \xe2\x86\x92 ";
#endif
       DIRED_FPUTS_LITERAL (arrow, stdout);





reply via email to

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