From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ognyan Kulev Newsgroups: gmane.emacs.devel Subject: Re: TUTORIAL.bg and windows-1251 Date: Wed, 14 Jan 2004 13:42:28 +0200 Organization: Faculty of Mathematics and Informatics, University of Sofia Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <40052B24.2030803@fmi.uni-sofia.bg> References: <3FB52552.6090302@fmi.uni-sofia.bg> <200311170721.QAA11735@etlken.m17n.org> <3FBA3F81.4010602@fmi.uni-sofia.bg> <200311242355.IAA24563@etlken.m17n.org> <3FC45367.6070504@fmi.uni-sofia.bg> <200311260747.QAA27236@etlken.m17n.org> <3FC464C2.7010504@fmi.uni-sofia.bg> <200311261317.WAA27673@etlken.m17n.org> <200312030834.RAA03004@etlken.m17n.org> <3FCF60C9.8060009@fmi.uni-sofia.bg> <200312042328.IAA06933@etlken.m17n.org> <3FF2E5DF.4090906@fmi.uni-sofia.bg> <200401050414.NAA00014@etlken.m17n.org> <3FFC3249.3010501@fmi.uni-sofia.bg> <200401072358.IAA05239@etlken.m17n.org> <3FFED268.3020908@fmi.uni-sofia.bg> <200401130407.NAA13705@etlken.m17n.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040408010005000708060502" X-Trace: sea.gmane.org 1074080555 19385 80.91.224.253 (14 Jan 2004 11:42:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Jan 2004 11:42:35 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jan 14 12:42:30 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AgjPq-0005nd-00 for ; Wed, 14 Jan 2004 12:42:30 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AgjPq-0004yc-00 for ; Wed, 14 Jan 2004 12:42:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AgjPQ-0006Po-QL for emacs-devel@quimby.gnus.org; Wed, 14 Jan 2004 06:42:04 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AgjOL-0006Mp-7o for emacs-devel@gnu.org; Wed, 14 Jan 2004 06:40:57 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AgjNl-0006Eo-Do for emacs-devel@gnu.org; Wed, 14 Jan 2004 06:40:52 -0500 Original-Received: from [62.44.101.9] (helo=smtp.fmi.uni-sofia.bg) by monty-python.gnu.org with esmtp (SSLv3:DES-CBC3-SHA:168) (Exim 4.24) id 1AgjNg-000691-20 for emacs-devel@gnu.org; Wed, 14 Jan 2004 06:40:16 -0500 Original-Received: from fmi.uni-sofia.bg ([62.44.101.57]) by smtp.fmi.uni-sofia.bg (FMI MAIL EXCHANGING SYSTEM) with ESMTP id 5JI1J; Wed, 14 Jan 2004 13:39:40 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4 X-Accept-Language: en-us, en Original-To: Kenichi Handa In-Reply-To: <200401130407.NAA13705@etlken.m17n.org> X-Enigmail-Version: 0.82.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19172 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19172 This is a multi-part message in MIME format. --------------040408010005000708060502 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Kenichi Handa wrote: > In article <3FFED268.3020908@fmi.uni-sofia.bg>, Ognyan Kulev writes: > >>Just copy&paste in both directions works fine. But how can I be sure >>that the text is encoded with microsoft-cp1251, not with iso10646-1? >>What program would show the difference? > > > If (encode-coding-string CYRILLIC_STRING > 'ctext-with-extensions) produces a string that contains > "microsoft-cp1251", it means that Emacs is using > microsoft-cp1251 extended seqement in X selection. And if > copy&paste works fine, that means that the encoding is in a > correct format. I tested with encode-coding-string and all is OK. > Hmmm strange. What is the result of this? > > (x-resolve-font-name "*-microsoft-cp1251") We can exchange mails this way for another month, so I decided to dive into the Source ;-) It seems override-fontspec hasn't enough "priority". To see what I mean, take a look at the attached patch. After applying it, microsoft-cp1251 is used in rendering. Regards, ogi --------------040408010005000708060502 Content-Type: text/x-patch; name="fontset.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fontset.diff" Index: fontset.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/fontset.c,v retrieving revision 1.83 diff -u -p -r1.83 fontset.c --- fontset.c 7 Jan 2004 00:21:53 -0000 1.83 +++ fontset.c 14 Jan 2004 11:36:24 -0000 @@ -254,6 +254,9 @@ lookup_overriding_fontspec (frame, c) { Lisp_Object tail; + printf ("lookup_overriding_fontspec %#x\n", c); + fflush (stdout); + for (tail = Voverriding_fontspec_alist; CONSP (tail); tail = XCDR (tail)) { Lisp_Object val, target, elt; @@ -300,11 +303,17 @@ fontset_ref_via_base (fontset, c) if (SINGLE_BYTE_CHAR_P (*c)) return FONTSET_ASCII (fontset); +#if 0 elt = Qnil; if (! EQ (FONTSET_BASE (fontset), Vdefault_fontset)) elt = FONTSET_REF (FONTSET_BASE (fontset), *c); if (NILP (elt)) elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c); +#else + elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c); + if (NILP (elt) && ! EQ (FONTSET_BASE (fontset), Vdefault_fontset)) + elt = FONTSET_REF (FONTSET_BASE (fontset), *c); +#endif if (NILP (elt)) elt = FONTSET_REF (Vdefault_fontset, *c); if (NILP (elt)) @@ -592,6 +601,7 @@ fontset_font_pattern (f, id, c) Lisp_Object fontset, elt; struct font_info *fontp; +#if 0 elt = Qnil; if (fontset_id_valid_p (id)) { @@ -607,6 +617,21 @@ fontset_font_pattern (f, id, c) XSETFRAME (frame, f); elt = lookup_overriding_fontspec (frame, c); } +#else + { + Lisp_Object frame; + + XSETFRAME (frame, f); + elt = lookup_overriding_fontspec (frame, c); + } + if (NILP (elt) && fontset_id_valid_p (id)) + { + fontset = FONTSET_FROM_ID (id); + xassert (!BASE_FONTSET_P (fontset)); + fontset = FONTSET_BASE (fontset); + elt = FONTSET_REF (fontset, c); + } +#endif if (NILP (elt)) elt = FONTSET_REF (Vdefault_fontset, c); --------------040408010005000708060502 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel --------------040408010005000708060502--