GNU bug report logs - #62892
proposal to extend mark-sexp to go forward and backward on command

Previous Next

Package: emacs;

Reported by: Zachary Kanfer <zkanfer <at> gmail.com>

Date: Mon, 17 Apr 2023 02:26:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: ruijie <at> netyu.xyz, 62892 <at> debbugs.gnu.org, Zachary Kanfer <zkanfer <at> gmail.com>, monnier <at> iro.umontreal.ca, mardani29 <at> yahoo.es
Subject: bug#62892: proposal to extend mark-sexp to go forward and backward on command
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.




This bug report was last modified 2 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.