all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: arthur miller <arthur.miller@live.com>
Cc: emacs-devel@gnu.org
Subject: Re: Suggestion: two new commands: beginning-of-list and end-of-list
Date: Mon, 09 Sep 2024 22:11:26 +0300	[thread overview]
Message-ID: <86le00ve01.fsf@gnu.org> (raw)
In-Reply-To: <AS8PR02MB1010719914E39AC2151D8225D96992@AS8PR02MB10107.eurprd02.prod.outlook.com> (message from arthur miller on Mon, 9 Sep 2024 18:32:33 +0000)

> From: arthur miller <arthur.miller@live.com>
> Date: Mon, 9 Sep 2024 18:32:33 +0000
> 
> In elisp-mode.el, there is a function, IMO somewhat unfortunately named
> "elisp--beginning-of-sexp".  What this function does is to place cursor at the
> beginning of the innermost list, which we can perhaps call more conveniently,
> "current list".
> 
> The function does so always, and is relatively well written, minor the case when
> the cursor is placed in a literal string or outside a symbolic expression, say
> between two top-level forms. In those cases, it jumps into the first string
> before the current string, which might be anywhere in the file prior to the
> current string, or to the beginning of the file.
> 
> I took me a liberty to rename this function and update the doc to a more
> appropriate wording, and turn it into a command. I have also patched the 
> above mentioned cases when it is invoked in a literal string or outside of
>  an expression.
> 
> As another consideration, I have moved this function into lisp.el (in
> lisp/emacs-lisp/) in the sources.  It does not look like it has nothing
> particularly specific to EmacsLisp per se, seems like it should work on any
> "parenthesis"-language. I have tested it successfully in both CommonLisp and
> EmacsLisp files.
> 
> I found only one user of elisp--beginning-of-sexp in the entire Emacs, and that
> is the function directly above: elisp--fnsym-in-current-sexp.
> 
> Emacs already has few functions for motion over lists and symbolic expressions,
> but actually not the one that places the cursor at the beginning of a list.

I think we do have it: C-M-u, backward-up-list.  What's more, it works
not only in Lisp.  I use it all the time.

So I wonder why we need another function that does basically the same.

Thanks.



  reply	other threads:[~2024-09-09 19:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09 18:32 Suggestion: two new commands: beginning-of-list and end-of-list arthur miller
2024-09-09 19:11 ` Eli Zaretskii [this message]
2024-09-09 19:41   ` Sv: " arthur miller
2024-09-09 19:41     ` arthur miller
2024-09-10 11:30     ` Eli Zaretskii
2024-09-10 15:10       ` Sv: " arthur miller
2024-09-10 15:48         ` Eli Zaretskii
2024-09-11  5:39           ` Sv: " arthur miller
2024-09-12  4:24             ` Emanuel Berg
2024-09-11  3:17     ` Sv: " Karthik Chikmagalur
2024-09-11  5:48       ` Sv: " arthur miller
2024-09-10 12:05 ` Yuri Khan
  -- strict thread matches above, loose matches on Subject: below --
2024-09-13 13:30 arthur miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86le00ve01.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=arthur.miller@live.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.