From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Merge haskell-ts-mode in upstream Date: Sun, 29 Dec 2024 14:46:18 +0000 Message-ID: <87cyhazgw5.fsf@posteo.net> References: <87cyhh7t00.fsf@bauherren.ovh> <87msglb89y.fsf@posteo.net> <87ed1s1akm.fsf@bauherren.ovh> <87msgfzsvl.fsf@posteo.net> <87r05rmxhm.fsf@bauherren.ovh> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37153"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Pranshu Sharma via "Emacs development discussions." To: Pranshu Sharma Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 29 15:49:18 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tRubW-0009Vj-0C for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Dec 2024 15:49:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRuat-0002Yd-2R; Sun, 29 Dec 2024 09:48:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRuar-0002YP-Qv for emacs-devel@gnu.org; Sun, 29 Dec 2024 09:48:38 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRuap-0003h0-NB for emacs-devel@gnu.org; Sun, 29 Dec 2024 09:48:37 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A2FA9240027 for ; Sun, 29 Dec 2024 15:48:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1735483713; bh=1Fm8S33QyDR8iKystcHFC/MmIypd5QVDQPVz+SKFedk=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=kBsKW0rviEt49vWd4tHnBnydxNHjhnoncYm6arHgjyd2ZtpzZiGoLRLOWECTtZyWS cDbwJb/U6ZivQV/jjh0Bin1wYjcCWuDh/gFajfza/VVg6hIRddAArkzTSnRfPMZLqd OxtrlRx/7XOJk5o3JgznaIvAz+2ECoM9EivVryP7LUg4ZcvAmz64cRjgGZ55fRjtnC KB3UczCPZXdXXBnHYoHpHclZW79BbDlXPmvtNZt8Z56rY6e5VLv3P/rM05d/UXMwor fs3BWSkoufoMfbUBnkMYS+oFNPcBr5P2DOb0pYoAlA6VDLQkGjngB+YnhaarnJzYAX ZCWjqr5Jto4dw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YLhtm2GfRz6tyW; Sun, 29 Dec 2024 15:48:32 +0100 (CET) In-Reply-To: <87r05rmxhm.fsf@bauherren.ovh> (Pranshu Sharma's message of "Sun, 29 Dec 2024 05:13:57 +1000") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327340 Archived-At: Pranshu Sharma writes: > Philip Kaludercic writes: > >> Pranshu Sharma writes: >> >>> Philip Kaludercic 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+