From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#35898: 26.1; line-beginning-position sometimes does not yield line beginning position Date: Tue, 25 Aug 2020 17:57:05 -0700 Message-ID: References: <878suullaz.fsf@metalevel.at> <83blzq4orm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26865"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 35898@debbugs.gnu.org, Markus Triska To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 26 02:58:20 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kAjlc-0006tV-62 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Aug 2020 02:58:20 +0200 Original-Received: from localhost ([::1]:50582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAjlb-0004mz-9F for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Aug 2020 20:58:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAjlL-0004Yi-5O for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 20:58:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAjlK-0005l0-Sd for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 20:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kAjlK-00023A-Sd for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 20:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Aug 2020 00:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35898 X-GNU-PR-Package: emacs Original-Received: via spool by 35898-submit@debbugs.gnu.org id=B35898.15984034397799 (code B ref 35898); Wed, 26 Aug 2020 00:58:02 +0000 Original-Received: (at 35898) by debbugs.gnu.org; 26 Aug 2020 00:57:19 +0000 Original-Received: from localhost ([127.0.0.1]:36711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAjkd-00021h-1q for submit@debbugs.gnu.org; Tue, 25 Aug 2020 20:57:19 -0400 Original-Received: from mail-yb1-f193.google.com ([209.85.219.193]:41507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAjkV-000215-F7 for 35898@debbugs.gnu.org; Tue, 25 Aug 2020 20:57:11 -0400 Original-Received: by mail-yb1-f193.google.com with SMTP id s195so12744ybc.8 for <35898@debbugs.gnu.org>; Tue, 25 Aug 2020 17:57:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=ugShx89ksxqTIn/Ht6T3EWIS1qNRmZjweu7pihrrsDA=; b=s3nAwfwTJVwkfA5586gFyjzVRYiWPZHRkYrX6jCDBVNJZ5+o0R0v4BjqTeousGlz6b uOxDebdunahaA6SEB3KRPmJJJqgAOB7RYXk3kIjrGa2Ks8o+7Snd1EHJWsCf/m2nIKA4 Q8hQUiIyEv6KP/0vZD0nPxefuPqPq6w/7B7AOxrkDxRBg/BpohJ+rqg6hy5IudtKxrdy 03WZop79lISgU18tGIDXlrhmeDNC9t+3j/kn6t/4TNUqMun6bdRDAJ5saUGxKHikr7+M R7b74KXWatmshwRE6PM/0I06ded3wtlvnxSI2omRWYgRmycpAgXqpFap8n+qjux2F0Ic 3NKA== X-Gm-Message-State: AOAM532vRH6Jj2eBBnTBOn463nxAc4g+XmUh81NfI5QJkCeL+RNP8JVG cO5cTTEWKkDTTO56Q6PDwLAmitSXo+bRE9U90Yo= X-Google-Smtp-Source: ABdhPJxNbVIBFtYDhm0EKY7XhkyYTHVzxp1S+ChOir7MkmD3tucHV3Ai3/h3uFhYyPx8oCNaNz3VADW30ynNO8TvGWs= X-Received: by 2002:a25:4ed7:: with SMTP id c206mr19037559ybb.129.1598403425954; Tue, 25 Aug 2020 17:57:05 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 25 Aug 2020 17:57:05 -0700 In-Reply-To: <83blzq4orm.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 25 May 2019 17:01:01 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186387 Archived-At: tags 35898 + notabug close 35898 thanks Eli Zaretskii writes: >> From: Markus Triska >> Date: Sat, 25 May 2019 15:23:48 +0200 >> >> $ wget https://www.metalevel.at/ei/hello.png >> >> and then, starting Emacs with "emacs -Q", evaluate the following form: >> >> (progn >> (goto-char (point-min)) >> (save-excursion (insert "\n")) >> (goto-char (+ (point) (cadr (insert-image-file "hello.png")))) >> (line-beginning-position)) >> >> This yields 592, whereas I expect it to yield 1. > > Your expectations are unjustified, because line-beginning-position is > not supposed to work on visual lines, it works on logical/physical > lines, i.e. it scans the buffer for newline characters. > > For visual-line operation, you can use either beginning-of-visual-line > or vertical-motion (the former actually calls the latter internally). > >> Is there a way to make line-beginning-position yield the line beginning >> position in cases like this? Would you please consider adding this feature? > > We already have features to query about the visual lines, so I don't > see why we would need line-beginning-position work in terms of visual > lines. It will fail Lisp programs that want to disregard the visual > appearance of the buffer. As Eli has correctly explained, this is the expected behaviour. So I'm therefore closing this bug report. If this conclusion is incorrect, please reply to this email (use "Reply to all" in your email client) and we can reopen the bug report. Best regards, Stefan Kangas