emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestion: two new commands: beginning-of-list and end-of-list


From: Eli Zaretskii
Subject: Re: Suggestion: two new commands: beginning-of-list and end-of-list
Date: Mon, 09 Sep 2024 22:11:26 +0300

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]