diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2005-11-24 10:25:33 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2005-11-24 10:25:33 +0000 |
commit | e66af50a984b9b693fd6bbbf5f806612cdd03b66 (patch) | |
tree | f00e013b62fceea6f1eded9f78f846781b983613 /Doc/Zsh | |
parent | 325a7c041715f7602ad55161cf15e14b24f97b97 (diff) | |
download | zsh-e66af50a984b9b693fd6bbbf5f806612cdd03b66.tar.gz zsh-e66af50a984b9b693fd6bbbf5f806612cdd03b66.tar.xz zsh-e66af50a984b9b693fd6bbbf5f806612cdd03b66.zip |
22014: argument-base, insert-unicode-char
Diffstat (limited to 'Doc/Zsh')
-rw-r--r-- | Doc/Zsh/contrib.yo | 14 | ||||
-rw-r--r-- | Doc/Zsh/zle.yo | 17 |
2 files changed, 31 insertions, 0 deletions
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 5a70880ee..43d2812ff 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -693,6 +693,9 @@ The function may be run outside zle in which case it prints the character (together with a newline) to standard output. Input is still read from keystrokes. +See tt(insert-unicode-char) for an alternative way of inserting Unicode +characters using their hexadecimal character number. + The set of accented characters is reasonably complete up to Unicode character U+0180, the set of special characters less so. However, it it is very sporadic from that point. Adding new characters is easy, @@ -917,6 +920,17 @@ narrow-to-region -p $'Editing restricted region\n' \ zle recursive-edit narrow-to-region -R state) ) +tindex(insert-unicode-char) +item(tt(insert-unicode-char))( +When first executed, the user inputs a set of hexadecimal digits. +This is terminated with another call to tt(insert-unicode-char). +The digits are then turned into the corresponding Unicode character. +For example, if the widget is bound to tt(^XU), the character sequence +`tt(^XU 4 c ^XU)' inserts tt(L) (Unicode U+004c). + +See tt(insert-composed-char) for a way of inserting characters +using a two-character mnemonic. +) tindex(predict-on) tindex(predict-off) item(tt(predict-on))( diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 1daffde00..40bc24988 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -1519,6 +1519,23 @@ Inside a widget function, if passed an argument, i.e. `tt(zle universal-argument) var(num)', the numerical argument will be set to var(num); this is equivalent to `tt(NUMERIC=)var(num)'. ) +tindex(argument-base) +item(tt(argument-base))( +Use the existing numeric argument as a numeric base, which must be in the +range 2 to 36 inclusive. Subsequent use of tt(digit-argument) and +tt(universal-argument) will input a new prefix in the given base. +The usual hexadecimal convention is used: the letter tt(a) or tt(A) +corresponds to 10, and so on. Arguments in bases requiring digits from 10 +upwards are more conveniently input with tt(universal-argument), since +tt(ESC-a) etc. are not usually bound to tt(digit-argument). + +The function can be used with a command argument inside a user-defined +widget. The following code sets the base to 16 and lets the user input a +hexadecimal argument until a key out of the digit range is typed: + +example(zle argument-base 16 +zle universal-argument) +) enditem() texinode(Completion)(Miscellaneous)(Arguments)(Zle Widgets) subsect(Completion) |