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#62892: proposal to extend mark-sexp to go forward and backward on command Date: Wed, 31 May 2023 15:01:39 +0300 Message-ID: <83mt1kg15o.fsf@gnu.org> References: <86jzxwuedr.fsf@mail.linkov.net> <83ttvzlj88.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25393"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, juri@linkov.net, ruijie@netyu.xyz, 62892@debbugs.gnu.org, drew.adams@oracle.com, monnier@iro.umontreal.ca To: Zachary Kanfer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 31 14:02:24 2023 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 1q4KX1-0006PO-I9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 31 May 2023 14:02:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4KWj-0008QC-DQ; Wed, 31 May 2023 08:02:05 -0400 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 1q4KWh-0008PT-FL for bug-gnu-emacs@gnu.org; Wed, 31 May 2023 08:02:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q4KWh-0005fC-6O for bug-gnu-emacs@gnu.org; Wed, 31 May 2023 08:02:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q4KWg-0006Ur-1g for bug-gnu-emacs@gnu.org; Wed, 31 May 2023 08:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 May 2023 12:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62892 X-GNU-PR-Package: emacs Original-Received: via spool by 62892-submit@debbugs.gnu.org id=B62892.168553447724917 (code B ref 62892); Wed, 31 May 2023 12:02:02 +0000 Original-Received: (at 62892) by debbugs.gnu.org; 31 May 2023 12:01:17 +0000 Original-Received: from localhost ([127.0.0.1]:34957 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4KVx-0006Tp-Ay for submit@debbugs.gnu.org; Wed, 31 May 2023 08:01:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q4KVs-0006TY-A0 for 62892@debbugs.gnu.org; Wed, 31 May 2023 08:01:15 -0400 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 1q4KVk-0005Rt-81; Wed, 31 May 2023 08:01:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UqcB/XNX3V76bIg12fwt2rWwDQ199nG68uilL/oZpwM=; b=WXql5p9udUOn kYbsezPZXNZiy2/wLqOFvWuebKAl+H+qLT4q+bDVEfHcFyIiJFmQIen5reoGHw1BdFxolnWrx8ZEV +pNrvttwbDZLfAgt2eSn9I7Sehtn6iE+hTNbU8JxPQbJT25TI267p9QHbbztZZQu0sC/3sgoa56QE NUnCxpSJb8Gj6wV9L07HUvNF7yTMl8lkjUwpBgURYPvFrX3TKkhyzcCoQJ+V/69CkR5aYSb6Oi6gt oFgtKoJZfWBR9nEJ9QFDjQfkgejoxPCe+kSBMswiAxeckQmJktcOn3M0OlcOIdNYE+UlHIBgQtV1i oHVOBX4Al7c1inEWaCUYMA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4KVc-0002HC-QH; Wed, 31 May 2023 08:00:57 -0400 In-Reply-To: (message from Zachary Kanfer on Tue, 30 May 2023 23:23:13 -0400) 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:262651 Archived-At: > From: Zachary Kanfer > Date: Tue, 30 May 2023 23:23:13 -0400 > Cc: rms@gnu.org, ruijie@netyu.xyz, 62892@debbugs.gnu.org, > monnier@iro.umontreal.ca, drew.adams@oracle.com, juri@linkov.net > > This is interesting. Let me see if I'm understanding properly. In this, I'll talk only about sexps, but I > believe this argument should apply to all the forms we've talked about (word, sexp, paragraph, defun, > page). These commands should: > > 1. Always move forward/back by ARG sexps (defaulting to 1), setting the region on all sexps it moves > across. > > I'm in agreement with #1, for sure. That is the basis for what I wanted initially. > > 2. Ignore whether transient-mark-mode is enabled. > 3. Don't change behavior if the region is active or not. > > #2 and #3 I believe can be considered together. There are a few things that could do this, but I think > what you're saying is that this function should *only* move mark.That is, point should stay the same no > matter what is called here. Additionally, it should activate mark. Is that what you meant? No, it should only move point, not the mark. The mark should stay where point was before invoking the command. Whether it should activate the mark is open to discussion. One possibility is that the command will work like shift-select commands. Another possibility is that it should activate the mark only if transient-mark-mode is turned ON, like other commands that push the mark. > My understanding was that #'use-region-p (which checks transient-mark-mode, and whether the region > is active) is a standard way for determining whether to act on the region or not, and should generally > be looked at before acting on the region. Is that not accurate? This is correct, but only for commands that do something with the text in the region: limit search/replace to it, or spell-check the text in it, etc. mark-sexp doesn't do anything like that, it actually _modifies_ the region. So the fact that it changes its effect depending on whether the region is active is IMO pretty confusing and unexpected.