all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: emacs-29 02e046566e 3/3: Set beginning/end-of-defun-function in treesit-major-mode-setup
       [not found] ` <20221222084623.4FFA8C0061B@vcs2.savannah.gnu.org>
@ 2022-12-22 14:59   ` Stefan Monnier
  2022-12-22 15:21     ` Theodor Thornhill
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2022-12-22 14:59 UTC (permalink / raw)
  To: emacs-devel; +Cc: Yuan Fu

> +    ;; `end-of-defun' will not work completely correctly in nested
> +    ;; defuns due to its implementation.  However, many lisp programs
> +    ;; use `beginning/end-of-defun', so we should still set
> +    ;; `beginning/end-of-defun-function' so they still mostly work.
> +    ;; This is also what `cc-mode' does: rebind user commands and set
> +    ;; the variables.  In future we should update `end-of-defun' to
> +    ;; work with nested defuns.
> +    (setq-local beginning-of-defun-function #'treesit-beginning-of-defun)
> +    (setq-local end-of-defun-function #'treesit-end-of-defun)))

Is there a bug report for that?


        Stefan




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: emacs-29 02e046566e 3/3: Set beginning/end-of-defun-function in treesit-major-mode-setup
  2022-12-22 14:59   ` emacs-29 02e046566e 3/3: Set beginning/end-of-defun-function in treesit-major-mode-setup Stefan Monnier
@ 2022-12-22 15:21     ` Theodor Thornhill
  0 siblings, 0 replies; 2+ messages in thread
From: Theodor Thornhill @ 2022-12-22 15:21 UTC (permalink / raw)
  To: Stefan Monnier, emacs-devel; +Cc: Yuan Fu

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> +    ;; `end-of-defun' will not work completely correctly in nested
>> +    ;; defuns due to its implementation.  However, many lisp programs
>> +    ;; use `beginning/end-of-defun', so we should still set
>> +    ;; `beginning/end-of-defun-function' so they still mostly work.
>> +    ;; This is also what `cc-mode' does: rebind user commands and set
>> +    ;; the variables.  In future we should update `end-of-defun' to
>> +    ;; work with nested defuns.
>> +    (setq-local beginning-of-defun-function #'treesit-beginning-of-defun)
>> +    (setq-local end-of-defun-function #'treesit-end-of-defun)))
>
> Is there a bug report for that?
>
>
>         Stefan


bug#60197

Theo



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-22 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <167169878178.1257.12592279240667535659@vcs2.savannah.gnu.org>
     [not found] ` <20221222084623.4FFA8C0061B@vcs2.savannah.gnu.org>
2022-12-22 14:59   ` emacs-29 02e046566e 3/3: Set beginning/end-of-defun-function in treesit-major-mode-setup Stefan Monnier
2022-12-22 15:21     ` Theodor Thornhill

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.