bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp


From: Dmitry Gutov
Subject: bug#60894: 30.0.50; [PATCH] Add treesit-forward-sexp
Date: Tue, 17 Jan 2023 22:53:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 17/01/2023 22:44, Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote:
1. What should a sexp be?

   Is it basically "everything", or is there a distincition between
   "word", "sexp" and "sentence"?  For lisp forward-sexp looks like a
   "jump over words, or a balanced pair of parens".  In other languages
   that can look a little weird - consider:

   ```
   foo().|bar().baz(); -> foo().bar|().baz(); -> foo().bar()|.baz();
   ```
In a sense it could be considered "better", or at least distinct from
   forward-word to:

   ```
   foo().|bar().baz(); -> foo().bar()|.baz(); -> foo().bar().baz()|;

One of the key things for Ruby, I think, is to jump over expressions.

E.g. when the point is before 'def' in

  def foo
    ...
  end

forward-sexp jumps to after 'end'. And backward-sexp jumps back.

Same for

  if 2 == 3
    ...
  end

, parenthesized expressions and (less important) method calls and statements as well.





reply via email to

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