9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Mark van Atten <vanattenmark@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] NFD and p9p acme on OSX
Date: Sat, 14 Sep 2013 11:51:09 +0200	[thread overview]
Message-ID: <CALAsyW1skxf6=VBt9bYWqQA4Cri0s=vrYQyLixnz2r5Mra1NYA@mail.gmail.com> (raw)
In-Reply-To: <5597aeb2af08782d984e2a59b4c6775d@brasstown.quanstro.net>

Thank you, Erik, for your comments!

I just realized that in

fn ls {
builtin ls $* | iconv -f UTF8-MAC -t UTF-8
}

one needs

u iconv

because otherwise it picks the wrong iconv when executing this
redefined ls in contexts where $PLAN9/bin occurs in the path first;
for example, try

9 man cat

with the uncorrected redefinition of ls.

As ever,
Mark.



On Thu, Sep 12, 2013 at 4:17 PM, erik quanstrom <quanstro@quanstro.net> wrote:
> On Thu Sep 12 05:41:19 EDT 2013, vanattenmark@gmail.com wrote:
>> Running p9p on OSX, I find it useful to put this in my rc profile:
>>
>> fn ls {
>> builtin ls $* | iconv -f UTF8-MAC -t UTF-8
>> }
>>
>> fn lc {
>> builtin lc $* | iconv -f UTF8-MAC -t UTF-8
>> }
>>
>> so as to deal with the NFD used by the OSX file system and list
>> names containing non-ascii characters correctly.
>>
>> But this doesn't solve the corresponding problem when clicking B3 to
>> open a directory in acme.
>>
>> Am I overlooking something? If not, what do people use to deal with
>> this---perhaps a patch to lib9?
>
> i created something similar for plan 9.  it uses runecompose
> (see runeclass(2), http://9atom.org/magic/man2html/2/runeclass)
> this uses tables built by awk scripts directly from unicodedata.txt.
> there is a rune/compose (see rune(1), http://9atom.org/magic/man2html/1/rune)
> that makes it possible to write
>         fn lc {builtin lc $* | rune/compose}
>
> but i agree, one would like a more systemic solution.  cooking this
> into stat/wstat wouldn't work, because the file name text might escape
> p9p and cause the rest of the system to be confused.
>
> perhaps runecompose and runedecompose (or equivalent) could be
> cooked into fullrune, chartorune, runetochar, etc.  (for apple oses only?)
> the big pain point would be dealing with the fact that chartorune
> could create up to maxcombiners*4 bytes of utf-8, and fullrune might
> need that size buffer to convert one rune.  it's easy to grep for these
> use cases.
>
> - erik
>



      reply	other threads:[~2013-09-14  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12  9:40 Mark van Atten
2013-09-12 14:17 ` erik quanstrom
2013-09-14  9:51   ` Mark van Atten [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALAsyW1skxf6=VBt9bYWqQA4Cri0s=vrYQyLixnz2r5Mra1NYA@mail.gmail.com' \
    --to=vanattenmark@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).