From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68900: 29.1; Inconsistent Cursor Behavior when Executed as Lisp Code vs. Run by Key Binding Date: Sat, 03 Feb 2024 09:31:01 +0200 Message-ID: <86jznm3sy2.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8441"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68900@debbugs.gnu.org To: Jaft Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 03 08:32:25 2024 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 1rWAVl-00021Y-1B for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Feb 2024 08:32:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rWAVE-0007lt-Px; Sat, 03 Feb 2024 02:31:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWAVD-0007lY-Nm for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2024 02:31:51 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rWAVD-0000XN-Fp for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2024 02:31:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rWAVO-0004bu-Cs for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2024 02:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Feb 2024 07:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68900 X-GNU-PR-Package: emacs Original-Received: via spool by 68900-submit@debbugs.gnu.org id=B68900.170694548217665 (code B ref 68900); Sat, 03 Feb 2024 07:32:02 +0000 Original-Received: (at 68900) by debbugs.gnu.org; 3 Feb 2024 07:31:22 +0000 Original-Received: from localhost ([127.0.0.1]:45810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWAUj-0004aq-Mt for submit@debbugs.gnu.org; Sat, 03 Feb 2024 02:31:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rWAUi-0004aa-0Z; Sat, 03 Feb 2024 02:31:20 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rWAUR-0000C5-5H; Sat, 03 Feb 2024 02:31:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=UbrFAdWiREhzEpcSkj+3pRkMe+UkkgsM9R6zgXwVuqE=; b=PyH1mm+EdN0k+zWl8Bw5 JXi+fM1LUocuo+7psYEW6QBXAkujhNdHlBfGLbgKHSpDD4ua4R5hLS0PdBZ4+hEVfBK9Ksq11uiIw mxmM9Fm67zuGmIzsYQ5dmRsy+0i6Pq40tg0y9/Kow8WnAw+GH4+9G44iH70VbWXAAEHcYoGvQOa/z 74k7ecVKBwkHewvrAmtxff3RYxweAZEYZ1zRX9soyypXqYepowHKYf7Iw0rq+6MClPUNV8EF6t1OL gs+wuiasqaAVrjEUJO4yjUL+QpHzHHLxIgeruHMLNOg9O6lOuF5wxCF4BWtIME5bi7FW0/icy+BdQ 8UeMOq+4/bdi4w==; In-Reply-To: (message from Jaft on Fri, 02 Feb 2024 16:47:57 -0600) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279362 Archived-At: tags 68900 notabug thanks > Date: Fri, 02 Feb 2024 16:47:57 -0600 > From: Jaft > > This is where the inconsistent behavior is: if we M-: (forward-line -1) > or M-: (previous-line) and, then, M-: (point), we'll get what (I would > think) we'd expect: point 72, the point of the beginning of the second > line. > > BUT, if we do the above via key-binding ¡V i.e. if, from point 145, we > press C-p to get to the line above ¡V and, then, run M-: (point), we > get back the number 1. This is the point-adjustment feature in action: it moves point out of the invisible text in the direction of the last movement. If you want to disable it, set global-disable-point-adjustment to a non-nil value; if you want to disable that temporarily in a Lisp program, set disable-point-adjustment non-nil before invoking some cursor-movement command. In your recipe, if you set global-disable-point-adjustment non-nil, the behavior of previous-line, whether via M-: or C-p, will be consistent: it will end at position 72. This is not a bug, but the intended behavior. Read all about it in the "Adjusting Point" section of the ELisp manual. Admittedly, this feature can sometimes cause surprising behavior.