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

2009-08-12 Thread Jim Meyering
Lennart Poettering wrote: [Second version of the patch, makes this feature optional with --fancy-chars] Diego Pettenò complained that ls -l doesn't use the UTF-8 arrow character to show where symlinks point to. This tiny patch fixes that. With this applied the character is used when the

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

2009-08-12 Thread Pádraig Brady
Lennart Poettering wrote: On Tue, 11.08.09 22:27, Pádraig Brady (p...@draigbrady.com) wrote: 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

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

2009-08-12 Thread Pádraig Brady
Jim Meyering wrote: - It's easy to get nearly the same effect with a simple filter, as Pádraig suggested. (of course, a naive filter fails if a file name contains - , but the end result is solely for human consumption, not for mechanical parsing, so that's ok) Just

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

2009-08-12 Thread Pádraig Brady
Pádraig Brady wrote: Oh right, so something like: static const char *arrow; if (!arrow) { if (fancy_chars STREQ (locale_charset(), UTF-8)) arrow = \xe2\x86\x92 ; else arrow = - ; } DIRED_FPUTS_LITERAL (arrow, stdout); Note the use of locale_charset()

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

2009-08-11 Thread Lennart Poettering
[Second version of the patch, makes this feature optional with --fancy-chars] Diego Pettenò complained that ls -l doesn't use the UTF-8 arrow character to show where symlinks point to. This tiny patch fixes that. With this applied the character is used when the CODESET is UTF-8 otherwise we fall

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

2009-08-11 Thread Pádraig Brady
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

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

2009-08-11 Thread Lennart Poettering
On Tue, 11.08.09 22:27, Pádraig Brady (p...@draigbrady.com) wrote: 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

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

2009-08-06 Thread Lennart Poettering
Diego Pettenò complained that ls -l doesn't use the UTF-8 arrow character to show where symlinks point to. This tiny patch fixes that. With this applied the character is used when the CODESET is UTF-8 otherwise we fall back to the traditional - arrow. Ah, ls -l is so much prettier now with this

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

2009-08-06 Thread Erik Auerswald
Hello Lennart, On Thu, Aug 06, 2009 at 07:24:42PM +0200, Lennart Poettering wrote: Diego Pettenò complained that ls -l doesn't use the UTF-8 arrow character to show where symlinks point to. This tiny patch fixes that. With this applied the character is used when the CODESET is UTF-8 otherwise

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

2009-08-06 Thread Philip Rowlands
On Thu, 6 Aug 2009, Lennart Poettering wrote: Diego Petten? complained that ls -l doesn't use the UTF-8 arrow character to show where symlinks point to. This tiny patch fixes that. With this applied the character is used when the CODESET is UTF-8 otherwise we fall back to the traditional -