zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: PATCH: displaying wide characters
Date: Wed, 19 Oct 2005 23:47:34 +0100	[thread overview]
Message-ID: <200510192247.j9JMlYHs025918@pwslaptop.csr.com> (raw)
In-Reply-To: Your message of "Wed, 19 Oct 2005 21:31:34 BST." <200510192031.j9JKVYk7010115@pwslaptop.csr.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2559 bytes --]

> Oliver pointed out there are wide ASCII characters at the top of the
> basic multilingual plane, from U+ff00 onward, which can be used for
> testing.  Iʼd be happy to add these to define-composed-chars for
> convenience but couldnʼt offhand see how to do it intuitively without
> clashing with RFC1345.  (Iʼve just realised I could use ^a etc. since
> RFC1345 doesnʼt assume youʼve got ^ on the keyboard, but after three
> solid hours at this I need a rest (nearly wrote "reset").)

Here they are.

Index: Doc/Zsh/contrib.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/contrib.yo,v
retrieving revision 1.49
diff -u -r1.49 contrib.yo
--- Doc/Zsh/contrib.yo	17 Oct 2005 09:51:48 -0000	1.49
+++ Doc/Zsh/contrib.yo	19 Oct 2005 22:47:16 -0000
@@ -719,6 +719,11 @@
 
 The most common characters from the Arabic, Cyrillic, Greek and Hebrew
 alphabets are available; consult RFC 1345 for the appropriate sequences.
+In addition, a set of two letter codes not in RFC 1345 are available for
+the double-width characters corresponding to ASCII characters from tt(!)
+to tt(~) (0x21 to 0x7e) by preceeding the character with tt(^), for
+example tt(^A) for a double-width tt(A).
+
 The following other two-character sequences are understood.
 
 startitem()
Index: Functions/Zle/define-composed-chars
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zle/define-composed-chars,v
retrieving revision 1.2
diff -u -r1.2 define-composed-chars
--- Functions/Zle/define-composed-chars	17 Oct 2005 09:51:48 -0000	1.2
+++ Functions/Zle/define-composed-chars	19 Oct 2005 22:47:17 -0000
@@ -1,6 +1,9 @@
 # This is not a widget function, it is only a helper for insert-composed-char
 # to cut down on resident memory use.
 
+emulate -L zsh
+setopt cbases
+
 # The associative array zsh_accent_chars is indexed by the
 # accent.  The values are sets of character / Unicode pairs for
 # the character with the given accent.  The Unicode value is
@@ -249,6 +252,15 @@
 a=h
 z[$a]+=" S 5e9"
 
+typeset -i 16 -Z 4 ia
+typeset -i 16 -Z 6 iuni
+# Extended width characters ^A, ^B, ... (not RFC1345)
+for (( ia = 0x21; ia < 0x7f; ia++ )); do
+  (( iuni = ia + 0xff00 - 0x20 ))
+  eval a="\$'\\x${ia##0x}'"
+  z[$a]+=" ^ ${iuni##0x}"
+done
+
 # Card suits: here first character is the interesting one
 for a b in S 2660 H 2661 D 2662 C 2663; do
   z[$a]+=" c $b"


-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page still at http://www.pwstephenson.fsnet.co.uk/


      parent reply	other threads:[~2005-10-19 22:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-19 20:31 Peter Stephenson
2005-10-19 20:41 ` Peter Stephenson
2005-10-20  0:39   ` Mikael Magnusson
2005-10-20  9:39     ` Peter Stephenson
2005-10-20 15:02       ` Bart Schaefer
2005-10-21  9:03         ` Peter Stephenson
2005-10-21 14:39           ` Bart Schaefer
2005-10-21 22:29             ` Peter Stephenson
2005-10-24  8:40       ` Mikael Magnusson
2005-10-24  9:07         ` Peter Stephenson
2005-10-24 12:41           ` Mikael Magnusson
2005-10-24 12:47             ` Peter Stephenson
2005-10-24 16:53               ` Peter Stephenson
2005-10-25 23:11         ` Peter Stephenson
2005-10-26  5:19           ` Mikael Magnusson
2005-10-26  9:17             ` Peter Stephenson
2005-10-26 14:31               ` Mikael Magnusson
2005-10-28 12:03                 ` Peter Stephenson
2005-10-28 17:19                   ` Mikael Magnusson
2005-10-19 22:47 ` Peter Stephenson [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=200510192247.j9JMlYHs025918@pwslaptop.csr.com \
    --to=p.w.stephenson@ntlworld.com \
    --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).