From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#62892: proposal to extend mark-sexp to go forward and backward on command Date: Thu, 27 Apr 2023 21:12:55 +0300 Organization: LINKOV.NET Message-ID: <86ttx19ot4.fsf@mail.linkov.net> References: <835y9jupgg.fsf@gnu.org> <83r0s5se94.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13930"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: ruijie@netyu.xyz, 62892@debbugs.gnu.org, Zachary Kanfer , monnier@iro.umontreal.ca, mardani29@yahoo.es To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 27 20:15:33 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 1ps69T-0003Lw-Kh for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Apr 2023 20:15:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ps696-0000lG-VJ; Thu, 27 Apr 2023 14:15:09 -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 1ps690-0000kl-IQ for bug-gnu-emacs@gnu.org; Thu, 27 Apr 2023 14:15:02 -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 1ps690-0002Sl-9N for bug-gnu-emacs@gnu.org; Thu, 27 Apr 2023 14:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ps68z-00063P-P8 for bug-gnu-emacs@gnu.org; Thu, 27 Apr 2023 14:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Apr 2023 18:15:01 +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.168261926323209 (code B ref 62892); Thu, 27 Apr 2023 18:15:01 +0000 Original-Received: (at 62892) by debbugs.gnu.org; 27 Apr 2023 18:14:23 +0000 Original-Received: from localhost ([127.0.0.1]:59779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ps68N-00062H-4A for submit@debbugs.gnu.org; Thu, 27 Apr 2023 14:14:23 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:44161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ps68K-000621-9d for 62892@debbugs.gnu.org; Thu, 27 Apr 2023 14:14:21 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id B61E91C0008; Thu, 27 Apr 2023 18:14:11 +0000 (UTC) In-Reply-To: <83r0s5se94.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Apr 2023 15:25:59 +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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260730 Archived-At: > I tried to describe the behavior in the doc string as follows: > > (defun mark-sexp (&optional arg allow-extend) > "Set mark ARG sexps from point or move mark one sexp. > When called from Lisp with ALLOW-EXTEND ommitted or nil, mark is > set ARG sexps from point; ARG defaults to 1. > With ALLOW-EXTEND non-nil (interactively, with prefix argument), > the place mark goes is the same place \\[forward-sexp] would move > with the same value of ARG; if the mark is active, it moves ARG > sexps from its current position, otherwise it is set ARG sexps > from point; ARG defaults to 1. > When invoked interactively without a prefix argument and no active > region, mark moves one sexp forward. > When invoked interactively without a prefix argument, and region > is active, mark moves one sexp away of point (i.e., forward > if mark is at or after point, back if mark is before point), thus > extending the region by one sexp. Since the direction of region > extension depends on the relative position of mark and point, you > can change the direction by \\[exchange-point-and-mark]. > This command assumes point is not in a string or comment." > > It is still somewhat complicated and confusing, but at least it's > accurate, I think. mark-sexp has a counterpart mark-word that has almost the same implementation and docstring. So this could be fixed in both places.