From unknown Sat Aug 16 21:12:18 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12679 <12679@debbugs.gnu.org> To: bug#12679 <12679@debbugs.gnu.org> Subject: Status: 24.2.50; Can't font-at for the beginning of a string Reply-To: bug#12679 <12679@debbugs.gnu.org> Date: Sun, 17 Aug 2025 04:12:18 +0000 retitle 12679 24.2.50; Can't font-at for the beginning of a string reassign 12679 emacs submitter 12679 Kazuhiro Ito severity 12679 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 19 05:54:33 2012 Received: (at submit) by debbugs.gnu.org; 19 Oct 2012 09:54:33 +0000 Received: from localhost ([127.0.0.1]:51100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TP9Hk-0007q4-Ul for submit@debbugs.gnu.org; Fri, 19 Oct 2012 05:54:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33828) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TP9Hi-0007ps-U6 for submit@debbugs.gnu.org; Fri, 19 Oct 2012 05:54:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TP9GC-0000j7-7T for submit@debbugs.gnu.org; Fri, 19 Oct 2012 05:52:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:57801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP9GC-0000j3-4I for submit@debbugs.gnu.org; Fri, 19 Oct 2012 05:52:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP9G8-0006NL-Ae for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 05:52:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TP9G7-0000iJ-Em for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 05:52:52 -0400 Received: from msa106.auone-net.jp ([61.117.18.166]:51318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TP9G7-0000U3-5V for bug-gnu-emacs@gnu.org; Fri, 19 Oct 2012 05:52:51 -0400 Received: from GUNGNIR.med.osaka-cu.ac.jp (g1-27-253-251-110.bmobile.ne.jp [27.253.251.110]) by msa106.auone-net.jp (au one net msa) with ESMTP id 03AF84B803A; Fri, 19 Oct 2012 18:52:37 +0900 (JST) Date: Fri, 19 Oct 2012 18:52:21 +0900 Message-ID: <87391an60a.wl%%xmue@d1.dion.ne.jp> From: Kazuhiro Ito To: bug-gnu-emacs@gnu.org Subject: 24.2.50; Can't font-at for the beginning of a string User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.2.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) The below code raises an error on trunk. (font-at 0 nil "A") Please see the below patch. === modified file 'src/font.c' --- src/font.c 2012-09-17 12:07:36 +0000 +++ src/font.c 2012-10-19 09:15:58 +0000 @@ -4775,7 +4775,7 @@ { CHECK_NUMBER (position); CHECK_STRING (string); - if (! (0 < XINT (position) && XINT (position) < SCHARS (string))) + if (! (0 <= XINT (position) && XINT (position) < SCHARS (string))) args_out_of_range (string, position); pos = XINT (position); } -- Kazuhiro Ito From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 19 09:14:53 2012 Received: (at 12679) by debbugs.gnu.org; 19 Oct 2012 13:14:53 +0000 Received: from localhost ([127.0.0.1]:51284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPCPd-0004qT-1L for submit@debbugs.gnu.org; Fri, 19 Oct 2012 09:14:53 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:41954 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPCPa-0004qM-Mh for 12679@debbugs.gnu.org; Fri, 19 Oct 2012 09:14:52 -0400 Received: from 253.240.accsnet.ne.jp ([202.220.240.253]:56529 helo=mongkok) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TPCO7-0007AO-Fe; Fri, 19 Oct 2012 09:13:19 -0400 From: Kenichi Handa To: Kazuhiro Ito Subject: Re: bug#12679: 24.2.50; Can't font-at for the beginning of a string In-Reply-To: <87391an60a.wl%%xmue@d1.dion.ne.jp> (message from Kazuhiro Ito on Fri, 19 Oct 2012 18:52:21 +0900) Date: Fri, 19 Oct 2012 22:11:12 +0900 Message-ID: <87objywqrz.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: 12679 Cc: 12679@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) In article <87391an60a.wl%%xmue@d1.dion.ne.jp>, Kazuhiro Ito writes: > The below code raises an error on trunk. > (font-at 0 nil "A") > Please see the below patch. > === modified file 'src/font.c' > --- src/font.c 2012-09-17 12:07:36 +0000 > +++ src/font.c 2012-10-19 09:15:58 +0000 > @@ -4775,7 +4775,7 @@ > { > CHECK_NUMBER (position); > CHECK_STRING (string); > - if (! (0 < XINT (position) && XINT (position) < SCHARS (string))) > + if (! (0 <= XINT (position) && XINT (position) < SCHARS (string))) > args_out_of_range (string, position); > pos = XINT (position); > } Thank you for the patch. I've just commited it. --- Kenichi Handa handa@gnu.org From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 20 08:21:46 2012 Received: (at 12679) by debbugs.gnu.org; 20 Oct 2012 12:21:47 +0000 Received: from localhost ([127.0.0.1]:52767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TPY3l-0006fF-PX for submit@debbugs.gnu.org; Sat, 20 Oct 2012 08:21:46 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:50488) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TPY3j-0006f2-2H for 12679@debbugs.gnu.org; Sat, 20 Oct 2012 08:21:44 -0400 Received: (qmail invoked by alias); 20 Oct 2012 12:20:01 -0000 Received: from 62-47-59-88.adsl.highway.telekom.at (EHLO [62.47.59.88]) [62.47.59.88] by mail.gmx.net (mp069) with SMTP; 20 Oct 2012 14:20:01 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/e6doPRNzerevInPnLWc+1mGD7NWIjf7j0ks2bZp y4jWqkbXGkuva5 Message-ID: <508296EA.60000@gmx.at> Date: Sat, 20 Oct 2012 14:19:54 +0200 From: martin rudalics MIME-Version: 1.0 To: Kenichi Handa Subject: Re: bug#12679: 24.2.50; Can't font-at for the beginning of a string References: <87391an60a.wl%%xmue@d1.dion.ne.jp> <87objywqrz.fsf@gnu.org> In-Reply-To: <87objywqrz.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 12679 Cc: Kazuhiro Ito , 12679@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) Could you please also (1) add a description of the STRING argument in the doc-string of `font-at', and (2) explain what happens when the selected window or the window passed as argument do not show the current buffer. IIUC face_at_buffer_position expects the window passed to it to show the current buffer but this might not be true when `font-at' calls it. There's also this comment in face_at_buffer_position: /* W must display the current buffer. We could write this function to use the frame and buffer of W, but right now it doesn't. */ /* eassert (XBUFFER (w->buffer) == current_buffer); */ Later in the code of face_at_buffer_position I see that w->buffer is sometimes used explicitly but get the impression that most other parts of the code use the current buffer instead. Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 30 07:50:18 2012 Received: (at 12679) by debbugs.gnu.org; 30 Oct 2012 11:50:18 +0000 Received: from localhost ([127.0.0.1]:39166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTAKo-0006EF-3N for submit@debbugs.gnu.org; Tue, 30 Oct 2012 07:50:18 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:49763) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTAKl-0006E7-2l for 12679@debbugs.gnu.org; Tue, 30 Oct 2012 07:50:16 -0400 Received: from 253.240.accsnet.ne.jp ([202.220.240.253]:61542 helo=mongkok) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TTAII-0000JO-9u; Tue, 30 Oct 2012 07:47:42 -0400 From: Kenichi Handa To: martin rudalics Subject: Re: bug#12679: 24.2.50; Can't font-at for the beginning of a string In-Reply-To: <508296EA.60000@gmx.at> (message from martin rudalics on Sat, 20 Oct 2012 14:19:54 +0200) Date: Tue, 30 Oct 2012 20:45:55 +0900 Message-ID: <87d300uqrw.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.9 (----) X-Debbugs-Envelope-To: 12679 Cc: kzhr@d1.dion.ne.jp, 12679@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.9 (----) In article <508296EA.60000@gmx.at>, martin rudalics writes: > Could you please also (1) add a description of the STRING argument in > the doc-string of `font-at', I added this statement to the docstring. Optional third arg STRING, if non-nil, is a string containing the target character at index specified by POSITION. > and (2) explain what happens when the > selected window or the window passed as argument do not show the current > buffer. > IIUC face_at_buffer_position expects the window passed to it to > show the current buffer but this might not be true when `font-at' calls > it. There's also this comment in face_at_buffer_position: > /* W must display the current buffer. We could write this function > to use the frame and buffer of W, but right now it doesn't. */ > /* eassert (XBUFFER (w->buffer) == current_buffer); */ > Later in the code of face_at_buffer_position I see that w->buffer is > sometimes used explicitly but get the impression that most other parts > of the code use the current buffer instead. I think your worrying is right. So, I changed font-at to signal an error when the specified window is not displaying the current buffer. --- Kenichi Handa handa@gnu.org From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 30 14:52:59 2012 Received: (at 12679) by debbugs.gnu.org; 30 Oct 2012 18:52:59 +0000 Received: from localhost ([127.0.0.1]:40055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTGvr-0007RI-Ce for submit@debbugs.gnu.org; Tue, 30 Oct 2012 14:52:59 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:39964) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TTGvq-0007RB-79 for 12679@debbugs.gnu.org; Tue, 30 Oct 2012 14:52:58 -0400 Received: (qmail invoked by alias); 30 Oct 2012 18:49:04 -0000 Received: from 62-47-63-38.adsl.highway.telekom.at (EHLO [62.47.63.38]) [62.47.63.38] by mail.gmx.net (mp032) with SMTP; 30 Oct 2012 19:49:04 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/fmWRjfxPfoQKpN3QbJsdjiDSlwp1hCgi1NwaTdT jzOxeveAmVHryD Message-ID: <5090211E.50809@gmx.at> Date: Tue, 30 Oct 2012 19:49:02 +0100 From: martin rudalics MIME-Version: 1.0 To: Kenichi Handa Subject: Re: bug#12679: 24.2.50; Can't font-at for the beginning of a string References: <87d300uqrw.fsf@gnu.org> In-Reply-To: <87d300uqrw.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 12679 Cc: kzhr@d1.dion.ne.jp, 12679@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) > I added this statement to the docstring. > > Optional third arg STRING, if non-nil, is a string containing the target > character at index specified by POSITION. Thanks. > I changed font-at to > signal an error when the specified window is not displaying > the current buffer. Yes, I think that's the best solution. Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 31 01:08:37 2012 Received: (at control) by debbugs.gnu.org; 31 Oct 2012 05:08:37 +0000 Received: from localhost ([127.0.0.1]:40533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTQXc-0005XH-KD for submit@debbugs.gnu.org; Wed, 31 Oct 2012 01:08:37 -0400 Received: from mail-da0-f44.google.com ([209.85.210.44]:53275) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTQXa-0005X6-7l for control@debbugs.gnu.org; Wed, 31 Oct 2012 01:08:35 -0400 Received: by mail-da0-f44.google.com with SMTP id h15so458853dan.3 for ; Tue, 30 Oct 2012 22:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=i6x+Z+sskzIrlcumpVwMy36ZB8hPZ45XsxqvqsWd5V8=; b=Lq0aDpJYhSnoLG3ikhjTOC07c2+pjpRP8Tz/SLhIQ7xk8Ap+IhAMFW+6fNzc8bOkOt Ai51vUTSOLtqfd0tPHyQ/3vGVJOkTz8ZbVG4Yh2k6KPhiGo70fIp8v8SKRbOFRPKQ+r6 ZvOftYX4BKxoDqsj7s5Dx2telZVlOShPDH1zPc10J8Tn9ky6vu38+PtkOAxqmj4JUp0y OnnBCDUnNkn9BATKCIKx8F14vnTJ+dj8Dl/BNyPc8sq1mnmAEp7xJp7hUA+tOd9x/r2f wbEQfZMI4AKbQtpJigyotesMpiRoGveYZG/SkMv7lAlTA8/BrtrupC6ILWwYsUweHgS4 FQwQ== Received: by 10.68.235.106 with SMTP id ul10mr110353173pbc.83.1351659958102; Tue, 30 Oct 2012 22:05:58 -0700 (PDT) Received: from ulysses ([155.69.18.16]) by mx.google.com with ESMTPS id hs1sm1688987pbc.33.2012.10.30.22.05.55 (version=SSLv3 cipher=OTHER); Tue, 30 Oct 2012 22:05:56 -0700 (PDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 12679 Date: Wed, 31 Oct 2012 13:05:52 +0800 Message-ID: <87ehkf2pu7.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) close 12679 thanks From unknown Sat Aug 16 21:12:18 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 28 Nov 2012 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator