From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Bastien Newsgroups: gmane.emacs.devel Subject: Re: line-start? Date: Fri, 07 Feb 2020 07:42:28 +0100 Message-ID: <87v9oiucdn.fsf@bzg.fr> References: <87ftfof1xl.fsf@gnu.org> <877e0zrhud.fsf@gnu.org> <83o8ubfu9l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="32954"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 07 07:43:08 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 1izxM4-0008TR-NR for ged-emacs-devel@m.gmane-mx.org; Fri, 07 Feb 2020 07:43:08 +0100 Original-Received: from localhost ([::1]:50670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izxM3-0000ey-Px for ged-emacs-devel@m.gmane-mx.org; Fri, 07 Feb 2020 01:43:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46317) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izxLV-0000ED-AW for emacs-devel@gnu.org; Fri, 07 Feb 2020 01:42:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1izxLV-0001bN-6z for emacs-devel@gnu.org; Fri, 07 Feb 2020 01:42:33 -0500 Original-Received: from lns-bzn-32-82-254-31-120.adsl.proxad.net ([82.254.31.120]:47516 helo=guerry) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1izxLU-0001UA-IG; Fri, 07 Feb 2020 01:42:32 -0500 Original-Received: by guerry (Postfix, from userid 1000) id AAB1B1A6030E; Fri, 7 Feb 2020 07:42:28 +0100 (CET) In-Reply-To: <83o8ubfu9l.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 06 Feb 2020 20:25:10 +0200") 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:244887 Archived-At: Hi Eli, Eli Zaretskii writes: > If you need a buffer position of the first (leftmost) visible > character, then I think you want this instead: > > (nth 1 (posn-at-x-y 0 (cdr (posn-x-y (posn-at-point))))) Thanks a lot -- this is indeed more precise. (window-hscroll) does not handle rescaled text very well, whereas this solution does. However, when the cursor is right under the header-line, the expression above returns 'header-line, so I could not use it for my purpose. Also, the same expression returns 'header-line when the cursor is on the _second_ line below the 'header-line -- I haven't looked for why it does so, but if it is reproducible, maybe there is something inconsistent here. Thanks again anyway! -- Bastien