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: Sat, 06 May 2023 11:49:17 +0300 Message-ID: <83ednthmk2.fsf@gnu.org> References: <835y9jupgg.fsf@gnu.org> <83r0s5se94.fsf@gnu.org> <86ttx19ot4.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11787"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ruijie@netyu.xyz, 62892@debbugs.gnu.org, zkanfer@gmail.com, monnier@iro.umontreal.ca, mardani29@yahoo.es To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 06 10:49:22 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 1pvDbW-0002tM-JK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 May 2023 10:49:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvDbE-0007qM-DV; Sat, 06 May 2023 04:49:04 -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 1pvDbC-0007qA-Rg for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 04:49: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 1pvDbC-0006Rw-JS for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 04:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvDbC-0006DZ-Eb for bug-gnu-emacs@gnu.org; Sat, 06 May 2023 04:49: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: Sat, 06 May 2023 08:49: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.168336291423857 (code B ref 62892); Sat, 06 May 2023 08:49:02 +0000 Original-Received: (at 62892) by debbugs.gnu.org; 6 May 2023 08:48:34 +0000 Original-Received: from localhost ([127.0.0.1]:59385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvDak-0006Cf-2Z for submit@debbugs.gnu.org; Sat, 06 May 2023 04:48:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvDaf-0006Bw-Vy for 62892@debbugs.gnu.org; Sat, 06 May 2023 04:48:32 -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 1pvDaZ-0006O8-Ap; Sat, 06 May 2023 04:48:23 -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=6uRCaGXdpeRLU3JQI7EyAgfAv6Nl3PNxgwJ+oHulcrY=; b=rnobevrhkhTA 4zgcTtYiaKFI3LE0cyv+9kgBg4yTHphEP8IM5JbAYyzoOF4huvATkJZKWorbsJlTA1etuCaXqQfVf l6J62o5I3cCa5MEv8IVcp3G466fn5MTyN35v0shDmXcVC8j2DZUmLigzd3eMIZfuMwSVoQW7gsC0Q Pw5gwS/8eKLE4sb7bRJtRpA7Oeewl7Tkn89jagdsOp7DbdW2GEKxobknLKLYWJKRVHCSsxUERGkhE mDafEoxvFe2vw95RLA3U/p8hMDxp03ZXv5qJKARGZg/nysfsird8yIHcTork7WHmy76CiLD8juW7W lrH1mqxZEJfpyS34s7OYqA==; 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 1pvDaY-0007w2-RC; Sat, 06 May 2023 04:48:23 -0400 In-Reply-To: <86ttx19ot4.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 27 Apr 2023 21:12:55 +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:261166 Archived-At: > From: Juri Linkov > Cc: Zachary Kanfer , mardani29@yahoo.es, > ruijie@netyu.xyz, monnier@iro.umontreal.ca, 62892@debbugs.gnu.org > Date: Thu, 27 Apr 2023 21:12:55 +0300 > > > 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. Done on the emacs-29 branch.