zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: PATCH: zle TODOs etc.
Date: Tue, 22 Mar 2005 19:36:52 -0500	[thread overview]
Message-ID: <20050323003652.GA11877@scowler.net> (raw)
In-Reply-To: <1050321020913.ZM11750@candle.brasslantern.com> <200502251446.j1PEkID6019392@news01.csr.com>

On Mon, Mar 21, 2005 at 02:09:13AM +0000, Bart Schaefer wrote:
> Some discussion of this is in zsh-workers/20869.

Oops.  Thanks.

On Fri, Feb 25, 2005 at 02:46:17PM +0000, Peter Stephenson wrote:
> Word stuff: this will need a whole new way of doing iword().  Probably
> that's going to have to be a function call.  The obvious thing to do is
> to have it on each call check that either the character iswalnum() or
> the multibyte representation of the character is in the string set by
> $WORDCHARS (which we could cache as wchar_t in zle).  That's slower, but
> probably not prohibitively so.  (The functions supplied with the shell
> can in principle do much more, but the underlying pattern matching tests
> there don't no about multibyte characters either.)

Is this the right way to go about this?

M  Src/Zle/zle_main.c
M  Src/init.c
M  Src/params.c

* modified files

--- orig/Src/Zle/zle_main.c
+++ mod/Src/Zle/zle_main.c
@@ -101,6 +101,11 @@
 /**/
 mod_export int
 lastchar_wide_valid;
+
+/**/
+mod_export ZLE_STRING_T zle_wordchars;
+#else
+# define zle_wordchars wordchars;
 #endif
 
 /* the bindings for the previous and for this key */
@@ -1507,6 +1512,15 @@
 	kungetct = 0;
 }
 
+/**/
+mod_export void
+wordcharshook(void)
+{
+#ifdef ZLE_UNICODE_SUPPORT
+    /* TODO: convert wordchars to wchar zle_wordchars */
+#endif
+}
+
 /* Hook functions. Used to allow access to zle parameters if zle is
  * active. */
 
@@ -1560,6 +1574,7 @@
     zlegetlineptr = zlegetline;
     zlereadptr = zleread;
     zlesetkeymapptr = zlesetkeymap;
+    wordcharshookptr = wordcharshook;
 
     getkeyptr = getbyte;
 
@@ -1645,6 +1660,7 @@
     zlegetlineptr = NULL;
     zlereadptr = fallback_zleread;
     zlesetkeymapptr= noop_function_int;
+    wordcharshookptr = noop_function;
 
     getkeyptr = NULL;
 


--- orig/Src/init.c
+++ mod/Src/init.c
@@ -1150,6 +1150,9 @@
 #endif /* !LINKED_XMOD_zshQszle */
 
 /**/
+mod_export ZleVoidFn wordcharshookptr = noop_function;
+
+/**/
 unsigned char *
 autoload_zleread(char **lp, char **rp, int ha, int con)
 {


--- orig/Src/params.c
+++ mod/Src/params.c
@@ -3316,6 +3316,7 @@
     zsfree(wordchars);
     wordchars = x;
     inittyptab();
+    wordcharshookptr();
 }
 
 /* Function to get value for special parameter `_' */




  reply	other threads:[~2005-03-23  0:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-21  1:39 Src/Zle/zle_word.c iword debacle Clint Adams
2005-03-21  2:09 ` Bart Schaefer
2005-02-25 14:46   ` PATCH: zle TODOs etc Peter Stephenson
2005-03-23  0:36     ` Clint Adams [this message]
2005-03-26 17:14       ` Bart Schaefer
2005-04-05 20:25         ` Clint Adams

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=20050323003652.GA11877@scowler.net \
    --to=clint@zsh.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).