all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: emacs-29 fb5d9ff559 1/2: Fix c-ts-mode defun movement (bug#59628)
@ 2022-12-01 15:30 Eli Zaretskii
  2022-12-02  2:53 ` Yuan Fu
  2022-12-02  6:30 ` Gerd Möllmann
  0 siblings, 2 replies; 4+ messages in thread
From: Eli Zaretskii @ 2022-12-01 15:30 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

>    ;; Navigation.
>    (setq-local treesit-defun-type-regexp
> -              (rx (or "specifier"
> -                      "definition")))
> +              (rx (or "function_definition"
> +                      "type_definition"
> +                      "struct_specifier"
> +                      "enum_specifier"
> +                      "union_specifier")))

Shouldn't we use regex-opt here?



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

* Re: emacs-29 fb5d9ff559 1/2: Fix c-ts-mode defun movement (bug#59628)
  2022-12-01 15:30 emacs-29 fb5d9ff559 1/2: Fix c-ts-mode defun movement (bug#59628) Eli Zaretskii
@ 2022-12-02  2:53 ` Yuan Fu
  2022-12-02  6:30 ` Gerd Möllmann
  1 sibling, 0 replies; 4+ messages in thread
From: Yuan Fu @ 2022-12-02  2:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel



> On Dec 1, 2022, at 7:30 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>>   ;; Navigation.
>>   (setq-local treesit-defun-type-regexp
>> -              (rx (or "specifier"
>> -                      "definition")))
>> +              (rx (or "function_definition"
>> +                      "type_definition"
>> +                      "struct_specifier"
>> +                      "enum_specifier"
>> +                      "union_specifier")))
> 
> Shouldn't we use regex-opt here?

I wasn’t aware of this function. Though it doesn’t seems to make a difference, I would expect it to transform the regex into something like

(rx (or (seq (or "function" "type") "_definition")
        (seq (or "struct" "enum" "union") "_specifier")))

Anyway, I changed it to use regexp-opt.

Yuan


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

* Re: emacs-29 fb5d9ff559 1/2: Fix c-ts-mode defun movement (bug#59628)
  2022-12-01 15:30 emacs-29 fb5d9ff559 1/2: Fix c-ts-mode defun movement (bug#59628) Eli Zaretskii
  2022-12-02  2:53 ` Yuan Fu
@ 2022-12-02  6:30 ` Gerd Möllmann
  2022-12-02  8:39   ` Eli Zaretskii
  1 sibling, 1 reply; 4+ messages in thread
From: Gerd Möllmann @ 2022-12-02  6:30 UTC (permalink / raw)
  To: eliz; +Cc: casouri, emacs-devel

>>    ;; Navigation.
>>    (setq-local treesit-defun-type-regexp
>> -              (rx (or "specifier"
>> -                      "definition")))
>> +              (rx (or "function_definition"
>> +                      "type_definition"
>> +                      "struct_specifier"
>> +                      "enum_specifier"
>> +                      "union_specifier")))
> 
> Shouldn't we use regex-opt here?

The or-clause of rx does that already.



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

* Re: emacs-29 fb5d9ff559 1/2: Fix c-ts-mode defun movement (bug#59628)
  2022-12-02  6:30 ` Gerd Möllmann
@ 2022-12-02  8:39   ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2022-12-02  8:39 UTC (permalink / raw)
  To: Gerd Möllmann; +Cc: casouri, emacs-devel

> Date: Fri, 2 Dec 2022 07:30:44 +0100
> Cc: casouri@gmail.com, emacs-devel@gnu.org
> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> 
> >>    ;; Navigation.
> >>    (setq-local treesit-defun-type-regexp
> >> -              (rx (or "specifier"
> >> -                      "definition")))
> >> +              (rx (or "function_definition"
> >> +                      "type_definition"
> >> +                      "struct_specifier"
> >> +                      "enum_specifier"
> >> +                      "union_specifier")))
> > 
> > Shouldn't we use regex-opt here?
> 
> The or-clause of rx does that already.

Good to know, thanks.



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

end of thread, other threads:[~2022-12-02  8:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 15:30 emacs-29 fb5d9ff559 1/2: Fix c-ts-mode defun movement (bug#59628) Eli Zaretskii
2022-12-02  2:53 ` Yuan Fu
2022-12-02  6:30 ` Gerd Möllmann
2022-12-02  8:39   ` Eli Zaretskii

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.