emacs-devel
[Top][All Lists]
Advanced

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

Re: Merge haskell-ts-mode in upstream


From: Philip Kaludercic
Subject: Re: Merge haskell-ts-mode in upstream
Date: Sun, 29 Dec 2024 14:46:18 +0000

Pranshu Sharma <pranshu@bauherren.ovh> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Pranshu Sharma <pranshu@bauherren.ovh> writes:
>>
>>> Philip Kaludercic <philipk@posteo.net> writes:
>>>
>>>> I see that you have started a new repository.  Do you want us to mirror
>>>> your changes with all the commit history, or are you OK with us just
>>>> copying over the coded periodically whenever you want to update the code?
>>>
>>> Ok, it seems like I'll be sticking to git one anyway, since
>>> git-hg-bridge or something doesn't work.  I am fine with using the old
>>> repo.
>>
>> Wait, I am confused.  The initial proposal was to add the package to
>> emacs.git, right?
>
> Yes, but iiuc it will still have own repo and emacs will just mirror it
> or smth.

Ok, that is fine.  You'll just have to ping the mailing list whenever
there is a new release.

[...]

>>>>> (defun haskell-ts-indent-defun (pos)
>>>>>   "Indent the current function."
>>>>>   (interactive "d")
>>>>>   (let ((node (treesit-node-at pos)))
>>>>>     (while (not (string-match
>>>>>            "^declarations$\\|haskell"
>>>>>            (treesit-node-type (treesit-node-parent node))))
>>>>>       (setq node (treesit-node-parent node)))
>>>>>     (indent-region (treesit-node-start node) (treesit-node-end node))))
>>>>
>>>> Why is this function necessary, if we already have the general commands
>>>> for indenting a defun?  If it is, it should probably be explained in the
>>>> docstring.
>>>
>>> Haskell functions are not paren wrapped(opptionally they are), so when I
>>> tested those functions don't work. C-M-h works, but the indentation is a
>>> little different in treesitter based mode, it works differently in
>>> incomplete sentences.  Meaning newline-indent would rarley be the final
>>> indentation of any expression.  I think the reason is too techical to
>>> include in docstring.
>>
>> So regular C-M-h would just re-indent a single equation, while this
>> matches all equations that constitute a total definition?
>
> Not really, it is mostly convince for C-M-h TAB, but since it is meant ot be
> used a lot, it get it's own special binding.  The rules are tiny bit
> different.

But then my question is why doesn't M-q in Emacs 30 do the same as well?
If it is invoked in a prog-mode outside of a comment or a string, it
should mark the defun and indent it, or does it not do that for
tree-sitter modes?


[...]

>>> I attach new file, I have also pushed changes to codebrg repo.
>>
>> I think it would be someone with more Tree Sitter experience could take
>> a look at the code as well.  Perhaps we should make this more formal by
>> moving over to the bug tracker?
>
> Sounds good.

1+



reply via email to

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