zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk
Cc: 478019@bugs.debian.org
Subject: Re: Bug#478019: zsh: Should handle non-breaking space as word separator
Date: Sat, 26 Apr 2008 19:41:25 +0100	[thread overview]
Message-ID: <20080426194125.355685ca@pws-pc> (raw)
In-Reply-To: <20080426150548.GB6165@scru.org>

On Sat, 26 Apr 2008 16:05:48 +0100
Clint Adams <schizo@debian.org> wrote:
> On Sat, Apr 26, 2008 at 12:00:03PM +0100, Samuel Thibault wrote:
> > On a french keyboard, '|' is typed by using alt-gr, and the non-breaking
> > space is often typed by using alt-gr space. That often leads to this:
> > 
> > € echo a | grep a
> > zsh: command not found:  grep
> > 
> > Because zsh looks for a " grep" command, with leading non-breaking space
> > because my thumb remained a bit too long on the alt-gr key.
> > 
> > This doesn't happen with bash, because bash treats non-breaking space as
> > a word separator.  Could zsh do the same? (currently, I have defined
> > alias  grep=grep
> > alias  vi=vi
> > ...)
> 
> Having locale-based (and multibyte) word separators sounds like a nightmare
> to me, but maybe someone has some ideas.

I tend to agree with this.  It's doable, and the standard (SUS 2004)
supports the idea (see under LC_CTYPE) although it's a little bit
two-faced (only ASCII space characters are listed as requiring quoting,
for example).  However,

- I've been resisting having to convert the byte stream into anything
  else for basic shell parsing.  I've got far better things to do
  than make the shell slower and buggier for a feature of doubtful
  general utility.
- Having basic syntactic elements depending on the locale is really
  nasty.  We have one such kludge ourselves, (NO_)POSIX_IDENTIFIERS,
  which is mostly a sop to traditional pre-multibyte zsh behaviour.  I
  would actively discourage people from assuming this sort of behaviour.
- It seems to me somewhat ludicrous making a change specifically so
  that arguments can be separated by a "non-breaking" space.  Is it
  or isn't it breakable?
- This isn't a general solution to mistyping anyway.  You might be able
  to fix alt-gr space with xmodmap or the terminal emulator translation
  table.

(Yes, I know "a little bit two-faced" is meaningless, strictly
speaking.  I stopped speaking strictly years ago now.)

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  parent reply	other threads:[~2008-04-26 18:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080426110003.GA16650@implementation>
2008-04-26 15:05 ` Clint Adams
2008-04-26 15:25   ` Samuel Thibault
2008-04-26 18:41   ` Peter Stephenson [this message]
2008-04-26 19:09   ` Stephane Chazelas

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=20080426194125.355685ca@pws-pc \
    --to=p.w.stephenson@ntlworld.com \
    --cc=478019@bugs.debian.org \
    --cc=zsh-workers@sunsite.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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