From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: line-start? Date: Fri, 07 Feb 2020 17:56:01 +0200 Message-ID: <83tv42e6i6.fsf@gnu.org> References: <87ftfof1xl.fsf@gnu.org> <877e0zrhud.fsf@gnu.org> <83o8ubfu9l.fsf@gnu.org> <87v9oiucdn.fsf@bzg.fr> <838sleg3d6.fsf@gnu.org> <87lfpe7lmk.fsf@bzg.fr> <83zhduelui.fsf@gnu.org> <878sle7jx9.fsf@gnu.org> <83wo8yecm9.fsf@gnu.org> <87h802a21a.fsf@bzg.fr> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="22574"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Bastien Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 07 16:56:58 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j0601-0005kS-Jm for ged-emacs-devel@m.gmane-mx.org; Fri, 07 Feb 2020 16:56:57 +0100 Original-Received: from localhost ([::1]:59830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0600-0004Ue-KE for ged-emacs-devel@m.gmane-mx.org; Fri, 07 Feb 2020 10:56:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47139) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j05zS-0003xf-Sw for emacs-devel@gnu.org; Fri, 07 Feb 2020 10:56:23 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j05zS-0005lD-Q4 for emacs-devel@gnu.org; Fri, 07 Feb 2020 10:56:22 -0500 Original-Received: from [176.228.60.248] (port=2087 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j05zR-00064o-M2; Fri, 07 Feb 2020 10:56:22 -0500 In-reply-to: <87h802a21a.fsf@bzg.fr> (message from Bastien on Fri, 07 Feb 2020 15:46:09 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244895 Archived-At: > From: Bastien > Cc: emacs-devel@gnu.org > Date: Fri, 07 Feb 2020 15:46:09 +0100 > > Eli Zaretskii writes: > > > But that gives a buffer position, not column number. > > (- (window-line-start) (line-beginning-position)) > > gives me the column number. That's not the column number, that's the ordinal number of the character on a line. It doesn't take into account characters that take more than one column, it doesn't take into account characters that are composed to produce a single grapheme cluster (or even a single glyph), and it doesn't take into account variable-size fonts. Of course, if all these are unimportant in your use case, you can disregard them. But a general-purpose function cannot disregard them.