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

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

bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun


From: Theodor Thornhill
Subject: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun
Date: Fri, 02 Dec 2022 19:32:33 +0100

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Theodor Thornhill <theo@thornhill.no>
>> Cc: casouri@gmail.com, 59662@debbugs.gnu.org
>> Date: Fri, 02 Dec 2022 16:06:46 +0100
>> 
>> > Why in lisp.el? we are talking about a feature of C-like languages.  The
>> > current binding of "C-c C-q" is in cc-cmds.el, so what I had in mind is to
>> > have its counterpart in c-ts-mode.el.
>> 
>> Something like this?
>
> Yes, thanks.
>
> But a command should not have "--" in its name, since every command is by
> definition a public function, not an internal one.

That makes sense.  I was in doubt about that, but decided to go the
(wrong) direction.  Updated in latest patch.

However - mark-defun signals an error on some constructs because of
number-or-marker error:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  treesit-end-of-defun()
  c-ts-mode--end-of-defun()
  end-of-defun()
  mark-defun(1 nil)
  mark-defun(1 23209)
  funcall-interactively(mark-defun 1 23209)
  call-interactively(mark-defun record nil)
  command-execute(mark-defun record)
  execute-extended-command(nil "mark-defun" nil)
  funcall-interactively(execute-extended-command nil "mark-defun" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

I'll file a separate bug report for this one, if that's ok?  Yuan, are
you ok with this patch?

Theo

Attachment: 0001-Add-c-ts-mode-indent-defun.patch
Description: Text Data


reply via email to

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