From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27696 invoked from network); 15 Aug 2005 18:28:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Aug 2005 18:28:08 -0000 Received: (qmail 22543 invoked from network); 15 Aug 2005 18:28:01 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Aug 2005 18:28:01 -0000 Received: (qmail 22524 invoked by alias); 15 Aug 2005 18:27:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21629 Received: (qmail 22515 invoked from network); 15 Aug 2005 18:27:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 15 Aug 2005 18:27:58 -0000 Received: (qmail 22160 invoked from network); 15 Aug 2005 18:27:58 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO dot.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 15 Aug 2005 18:27:54 -0000 Received: by dot.blorf.net (Postfix, from userid 1000) id 0699A27A3; Mon, 15 Aug 2005 11:27:53 -0700 (PDT) Date: Mon, 15 Aug 2005 11:27:52 -0700 From: Wayne Davison To: Peter Stephenson Cc: zsh-workers@sunsite.dk Subject: Re: PATCH: make unicode support configurable Message-ID: <20050815182752.GC29158@blorf.net> References: <20050815171733.GB29158@blorf.net> <13553.1124126857@csr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="BRE3mIcgqKzpedwo" Content-Disposition: inline In-Reply-To: <13553.1124126857@csr.com> User-Agent: Mutt/1.5.9i X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 --BRE3mIcgqKzpedwo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Aug 15, 2005 at 06:27:37PM +0100, Peter Stephenson wrote: > Probably something more general is appropriate [...] > --enable-multibyte-zle is about the best I can think of. OK. I also like Oliver's logic that we will want to tie-in any future multibyte support into the same option, so my newest patch changes the option name to just --enable-multibyte. If we decide the -zle suffix is better, it will be easy to add. > (indeed, [something more general] would be [appropriate] for the name > ZLE_UNICODE_SUPPORT if the definition doesn't depend on ISO 10646). I'll leave any possible renaming of the ZLE_UNICODE_SUPPORT define for later. > It's possible we might: it controls whether printf understands Unicode. Oh, I didn't realize that. I've restored that logic in this new patch and enhanced the comment to mention printf. The code in system.h still checks for __STDC_ISO_10646__ for this, though I don't know if the subset actually needs this test or not. My new patch also removes some debug code that got left in the previous patch (it echoed a var to /tmp/uni). Let me know if there are any objections to my checking this in. ..wayne.. --BRE3mIcgqKzpedwo Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="multibyte.patch" --- configure.ac 1 Aug 2005 09:54:56 -0000 1.37 +++ configure.ac 15 Aug 2005 18:22:36 -0000 @@ -2063,6 +2063,37 @@ int ptsname();], , fi fi +dnl --------------------- +dnl multibyte ZLE support +dnl --------------------- +AC_ARG_ENABLE(multibyte, +[ --enable-multibyte support multibyte chars in the zsh line editor], +[zsh_cv_c_zle_unicode_support=$enableval], +[AC_CACHE_CHECK(if the system adequately supports multibyte chars, + zsh_cv_c_zle_unicode_support, + [AC_TRY_COMPILE([ +#ifdef HAVE_LOCALE_H +# include +#endif + ], [ +int main() { +#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) \ + && defined(HAVE_MBRTOWC) && defined(HAVE_WCRTOMB) \ + && defined (__STDC_ISO_10646__) + return 0; +#else +# error Not supported. +#endif +} + ], + zsh_cv_c_zle_unicode_support=yes, + zsh_cv_c_zle_unicode_support=no)]) +]) +AH_TEMPLATE([ZLE_UNICODE_SUPPORT], +[Define to 1 if you want unicode support in the line editor.]) +if test $zsh_cv_c_zle_unicode_support = yes; then + AC_DEFINE(ZLE_UNICODE_SUPPORT) +fi dnl --------------- dnl dynamic loading --- Src/system.h 15 Aug 2005 10:01:48 -0000 1.33 +++ Src/system.h 15 Aug 2005 18:22:36 -0000 @@ -692,21 +692,17 @@ extern short ospeed; #endif /* - * This is a subset of ZLE_UNICODE_SUPPORT. It is not all that likely - * that only the subset is supported, however it's easy to make the - * \u and \U escape sequences work with just the following. + * The ZLE_UNICODE_SUPPORT configure-define specifies that we want to enable + * complete Unicode conversion between wide characters and multibyte strings. */ -#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && defined (__STDC_ISO_10646__) -# include -# include - +#if defined ZLE_UNICODE_SUPPORT \ + || (defined HAVE_WCHAR_H && defined HAVE_WCTOMB && defined __STDC_ISO_10646__) /* - * More stringent requirements to enable complete Unicode conversion - * between wide characters and multibyte strings. + * If ZLE_UNICODE_SUPPORT is not defined, these includes provide a subset of + * Unicode support that makes the \u and \U printf escape sequences work. */ -#if defined(HAVE_MBRTOWC) && defined(HAVE_WCRTOMB) -#define ZLE_UNICODE_SUPPORT 1 -#endif +# include +# include #else # ifdef HAVE_LANGINFO_H # include --BRE3mIcgqKzpedwo--