From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 30 22:17:57 2022 Received: (at submit) by debbugs.gnu.org; 31 Dec 2022 03:17:57 +0000 Received: from localhost ([127.0.0.1]:36344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBSNh-0003xR-0D for submit@debbugs.gnu.org; Fri, 30 Dec 2022 22:17:57 -0500 Received: from lists.gnu.org ([209.51.188.17]:56602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBSNe-0003xI-BG for submit@debbugs.gnu.org; Fri, 30 Dec 2022 22:17:55 -0500 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 1pBSNe-0004Wy-3i for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2022 22:17:54 -0500 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBSNc-0004ks-0J for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2022 22:17:53 -0500 Received: (Authenticated sender: sadiq@sadiqpk.org) by mail.gandi.net (Postfix) with ESMTPA id C519A240003 for ; Sat, 31 Dec 2022 03:17:44 +0000 (UTC) MIME-Version: 1.0 Date: Sat, 31 Dec 2022 08:47:44 +0530 From: Mohammed Sadiq To: bug-gnu-emacs@gnu.org Subject: 29.0.60; c-ts-mode: Consider re-using c-file-style and c-basic-offset Message-ID: <0e9e8e06451e13d7bee3fd0c04939902@sadiqpk.org> X-Sender: sadiq@sadiqpk.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2001:4b98:dc4:8::221; envelope-from=sadiq@sadiqpk.org; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) It would be nice if c-ts-mode respects c-file-style and c-basic-offset instead of its own variables. Also I wish c-ts-mode respects other c-mode variables (ie, cc-styles.el) so that I could use the same c-mode conf for c-ts-mode too, eg., I could use: /* -*- c-file-style: "gnu"; c-basic-offset: 4; -*- */ as file variables which would work both in c-mode and c-ts-mode, or the following in dir-locals: ((nil . ((fill-column . 80))) (c-ts-mode . ((c-file-style . "GNU") (c-file-offsets (brace-list-intro . +))))) Whether the mode used for C source file is c-ts-mode or c-mode is an implementation detail as far as the settings are concerned (because I don't want different styles for my code depending on the mode used). I'm not asking about implementing the spacing and indentation rules, but when they do, it would be nice if they re-use the same c-mode variable names. cheers, Mohammed Sadiq In GNU Emacs 29.0.60 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.16.0) of 2022-12-30 built on purism Repository revision: 4922de626f05f0c26bc732b082c30c5c18a88416 Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure --prefix=/usr' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_IN.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 36077 7352) (symbols 48 5148 0) (strings 32 13069 1377) (string-bytes 1 368001) (vectors 16 9289) (vector-slots 8 147664 13259) (floats 8 21 24) (intervals 56 236 0) (buffers 984 11)) From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 30 23:03:05 2022 Received: (at 60443) by debbugs.gnu.org; 31 Dec 2022 04:03:05 +0000 Received: from localhost ([127.0.0.1]:36359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBT5M-00056n-Nj for submit@debbugs.gnu.org; Fri, 30 Dec 2022 23:03:05 -0500 Received: from mail-pj1-f54.google.com ([209.85.216.54]:51850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBT5L-00056K-2A for 60443@debbugs.gnu.org; Fri, 30 Dec 2022 23:03:03 -0500 Received: by mail-pj1-f54.google.com with SMTP id n12so11284203pjp.1 for <60443@debbugs.gnu.org>; Fri, 30 Dec 2022 20:03:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tmZs5gGJrKRqPwLH8oG+rzpyGMMACTkSLr9gcALyGVw=; b=q5pqiSBMzz+57iCd7S6KpgtmKZKgc0FRm8DGhtlxwIy93eW80bgF8mjP2ac8RJuJnj PfYAIGXqXoRzBaj/QWzP/ILsM9ctfk1wJKSowxLLRVImKflA5Ebco165t5saN7Dw+BpL 2iiUfi3n6D6Z0r1l9RQh5hLvVeudv6dvch4zCm7ZgvMpt7/Jo2jMyxcx8EJ9KzsOjJ1L nQxqSUQaDAhH2I3yq1kIgfDx+uYgrB/RZPwfHln5er1OUjvLIm/VOhzP1G5AqkOww0b1 UcrREwmmuaoTKQvM21m2cDJgxw1eid4l0MRc+BI01aCUS+ClsmXHJB9wNIDma2LU56gf 9J2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tmZs5gGJrKRqPwLH8oG+rzpyGMMACTkSLr9gcALyGVw=; b=x15aQkDGtB0UOc2Z7KUdGEYfMirPyeKPyYUxBUC0k8YPLEPrvVVaHV54uYy4sEUU0h 2zeU6Riw/Bl+U1ZZVJzaszcvj0NyyM3mk8zmsoA7SEK4FV253i9OiNJNQJMo0y0btmM0 04eJ/ANvbQvsLbhzuseBOrhcnyOXC0iWUbp2SkQ4kbptyT7cZiGUK/fmojYWeP7K1R/r fUzAFrmoEk+F/8KzAj55m6U4iuZ7+XRdaUntHTbrlqfnismjhhUcV+CGpW2I2jplBOWK 7ChXIhAqWxQwgvzOXMjyCmIOkawAo5hEChNMC/CTlW+lS+9rSSasYExWyafXOW4ctph0 iXDQ== X-Gm-Message-State: AFqh2krEglFWItZegMR7uMO4jRud1MOt0kGEJpT3rf/uT7ta4slNxdPb KcfCAQ591A5H3um7ZBCHnhijd43Ue5Q= X-Google-Smtp-Source: AMrXdXtAkf6jLRNMUYKCOjKFkDMnhIaXDA0Pjc3nwZEANwmz1lyMRsTCAz6+uehTxdPjqpef7utxMw== X-Received: by 2002:a05:6a20:4e1e:b0:9f:2dd1:c2bc with SMTP id gk30-20020a056a204e1e00b0009f2dd1c2bcmr38112045pzb.49.1672459377051; Fri, 30 Dec 2022 20:02:57 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id q1-20020a654941000000b0047917991e83sm13538139pgs.48.2022.12.30.20.02.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Dec 2022 20:02:56 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60443: 29.0.60; c-ts-mode: Consider re-using c-file-style and c-basic-offset From: Yuan Fu In-Reply-To: <0e9e8e06451e13d7bee3fd0c04939902@sadiqpk.org> Date: Fri, 30 Dec 2022 20:02:55 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <0F02DC00-451E-4375-B436-7DB398E4DFB7@gmail.com> References: <0e9e8e06451e13d7bee3fd0c04939902@sadiqpk.org> To: Mohammed Sadiq X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60443 Cc: 60443@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 30, 2022, at 7:17 PM, Mohammed Sadiq wrote: >=20 > It would be nice if c-ts-mode respects c-file-style and c-basic-offset > instead of its own variables. Also I wish c-ts-mode respects other = c-mode > variables (ie, cc-styles.el) so that I could use the same c-mode conf = for > c-ts-mode too, eg., I could use: >=20 > /* -*- c-file-style: "gnu"; c-basic-offset: 4; -*- */ >=20 > as file variables which would work both in c-mode and c-ts-mode, or = the > following in dir-locals: >=20 > ((nil . ((fill-column . 80))) > (c-ts-mode . ((c-file-style . "GNU") > (c-file-offsets > (brace-list-intro . +))))) >=20 > Whether the mode used for C source file is c-ts-mode or c-mode is an > implementation detail as far as the settings are concerned (because I > don't want different styles for my code depending on the mode used). >=20 > I'm not asking about implementing the spacing and indentation rules, = but > when they do, it would be nice if they re-use the same c-mode variable > names. IIUC part of the reason why we created separate major modes is that we = don=E2=80=99t want to share configuration variables between the = tree-sitter and elisp implementation. If they share some of the = configuration variable but not all, it would be very confusing; it they = share all variables, well that=E2=80=99s not possible because c-ts-mode = doesn=E2=80=99t support all of c-mode=E2=80=99s features. Also, since = c-ts-mode and c-mode=E2=80=99s implementation differs greatly, some of = c-mode=E2=80=99s configuration wouldn=E2=80=99t make sense, or is hard = to recreate, in c-ts-mode. I=E2=80=99m sorry that there will inevitably be differences between = c-ts-mode and c-mode. We=E2=80=99ll try to minimize the annoyance but it = won=E2=80=99t be perfect. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 05:32:02 2022 Received: (at 60443) by debbugs.gnu.org; 31 Dec 2022 10:32:02 +0000 Received: from localhost ([127.0.0.1]:36597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBZ9m-00088P-D0 for submit@debbugs.gnu.org; Sat, 31 Dec 2022 05:32:02 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:44000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBZ9j-00087m-UI for 60443@debbugs.gnu.org; Sat, 31 Dec 2022 05:32:00 -0500 Received: by mail-wm1-f51.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so16961563wms.2 for <60443@debbugs.gnu.org>; Sat, 31 Dec 2022 02:31:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=8FPlaH0KJCHrRnvh5IyV9FAuccLom/VZdin9OdecEvU=; b=D1PeXjA9FySSRZd3XNsXvfKMAApc++lcQd1pW5wFQ7yISiguuAIVIjiP0QlgdEhZlQ GgiOi6JTaas8OTqiXgUeEq6RBr3SQEquNusqndy7pUi/orcOPyAmgKUAZtJq5jyy6+pG oLWEg48v9hrpGdF4yZUruYyeOrMalvsnOh1qzKKj9Q+5wrEgYHKnIWCuQakxzfvuWGVi P3paA372NXMlkuqwSlTk7hvUfGzvzxV4Cp89HRLZbdBtmVI8IEoUxgHQZs2RjjmA14/f 95Z78vEUaORUxxXdWSwcpKQBMfkpPqHRGpRWYuL3ihgdBkDToEnC/Cwl2V6zYFTT5XgJ qVZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8FPlaH0KJCHrRnvh5IyV9FAuccLom/VZdin9OdecEvU=; b=QFerHTTaUTyUtDWk8MjsD5yJgj5L6blTb7mBJ0ApTWUPYQUWLcY13xL+VF/DSP1zi3 VLv3x3/Q8Ftpmcnfz2MushPKu6pCirR9wpr3dV0bqq5ToYGvsH0R0DfFvh7dTn37u2+m ux4wSLfUUAWdiSCXFM91I44bwQmc42w0mLVecudOJucV0gswiS8zXmVj1uN5YdnkV1tk Y/iOnt40uzu5iBduPLaGEamvvuXxzPgDe3eIwkJFglcOB2T7gHzTT1LnIC4trDi9WeKp U9763e4JnBxU72nmQEP0cuWHRhYjEa2bbSnCRtjLIrZ+NRSP3Z47PAZr8P1qPvLvvL70 hHzA== X-Gm-Message-State: AFqh2krc9B4EWDtIGpg70HtilStN9Qa+cPVv6QkZhF4TWbkl0HnxFjcF THTDRj57fIPhY8+8lA8NZ1E= X-Google-Smtp-Source: AMrXdXuapx25DhHmGMpOF2CRfuSu+pR/nFRWFDeMaDWHzez28mG8U8fCm1LfzTryYVkki7pw4SGtRw== X-Received: by 2002:a05:600c:2d85:b0:3d0:7d89:2256 with SMTP id i5-20020a05600c2d8500b003d07d892256mr24002503wmg.13.1672482713862; Sat, 31 Dec 2022 02:31:53 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id w12-20020a5d680c000000b002302dc43d77sm22643221wru.115.2022.12.31.02.31.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 31 Dec 2022 02:31:53 -0800 (PST) Message-ID: <6837f516-7634-b580-6e04-97208552d0a1@yandex.ru> Date: Sat, 31 Dec 2022 12:31:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: bug#60443: 29.0.60; c-ts-mode: Consider re-using c-file-style and c-basic-offset Content-Language: en-US To: Yuan Fu , Mohammed Sadiq References: <0e9e8e06451e13d7bee3fd0c04939902@sadiqpk.org> <0F02DC00-451E-4375-B436-7DB398E4DFB7@gmail.com> From: Dmitry Gutov In-Reply-To: <0F02DC00-451E-4375-B436-7DB398E4DFB7@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60443 Cc: 60443@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 31/12/2022 06:02, Yuan Fu wrote: > IIUC part of the reason why we created separate major modes is that we don’t want to share configuration variables between the tree-sitter and elisp implementation. If they share some of the configuration variable but not all, it would be very confusing; it they share all variables, well that’s not possible because c-ts-mode doesn’t support all of c-mode’s features. js-ts-mode uses js-indent-level. css-ts-mode uses css-indent-offset. python-ts-mode and bash-ts-mode don't have their own indentation settings, so I suppose they reuse the "regular" indentation code. There are a lot of other ts modes which don't have anything to reuse ("regular" mode is not in Emacs). FWIW, that's my plan for ruby-ts-mode: to share those options where it's feasible, to avoid random duplication, and to make comparing and switching easier. The test suite can be shared more easily too. > Also, since c-ts-mode and c-mode’s implementation differs greatly, some of c-mode’s configuration wouldn’t make sense, or is hard to recreate, in c-ts-mode. I suppose the CC styles might be trickier to implement exactly the same. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 01 19:24:17 2023 Received: (at 60443) by debbugs.gnu.org; 2 Jan 2023 00:24:17 +0000 Received: from localhost ([127.0.0.1]:42025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC8ci-0006dw-VL for submit@debbugs.gnu.org; Sun, 01 Jan 2023 19:24:17 -0500 Received: from mail-pj1-f50.google.com ([209.85.216.50]:45944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC8ch-0006dj-0f for 60443@debbugs.gnu.org; Sun, 01 Jan 2023 19:24:15 -0500 Received: by mail-pj1-f50.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so26883558pjj.4 for <60443@debbugs.gnu.org>; Sun, 01 Jan 2023 16:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=Ca5yIn4q9neyslZgA28SbcshmnDrtefj4t6SAJqzsgs=; b=IGXDNsPNLMGPmifj0bzCIvZd7ZyJSYaLKj3PPAzBLwyZpNlJ2y9+7YU7XIKmfu0Jfp wYEVqTUDG/Nhu/psHZ/d/NdT6ZA7jaF+aPKHWdE46HIB3DKSuVS0ltTEx0sxNNahGxh0 hN3fmRKP616kbfI0nvfwjU3Sp+qJWn0nIf6Oi+2xB1XLsci+6kITEQ21XT1eiM+aXo+8 FXh0vh7CRUE+BI8GlssO0UQpf7w8MKHgOZUUW3RYvH8jtDQw96QPBK9qcZ+mpQWYRcLB PgwGe0+9ulrTe7kjF1XXAlvFp771rjsWTNik6a4O6uCgg7B7yp8VRPgykHZUJrJA+HCm 6g2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ca5yIn4q9neyslZgA28SbcshmnDrtefj4t6SAJqzsgs=; b=BwZZt7xhEJ+o+XCcjw2DMPEU7UOe+eiqAyB1Lt42w7BHj2jvFv3w3lLpiyenWOuUrh uQzk53hHkV8KCzTjTj4yWiUaXOGVMqfLnWBOQSPHHG2Ev58hJks2LmgYhSUij6r0mQ2X HfRi+DRTqJPjklWHMKqsbjiUI+5oMraTxfCVooXFfqmE5jF768ds1pm4lwXMfRPRQo3m bq1O41av1Ttj+TgFcMXoKfbTCzE9LnzDNa5RDRQxOyOJ44lKodBA8yajA8o5Uqv8Nsmw 4+uTTye9zNor5MoQeMt4S6Eg87K5j85Lge4jUe9L1NFNsqN8rZdydRAC2P8uL4zMa8Th 0MBw== X-Gm-Message-State: AFqh2ko/CUfScMtOSz6HQt5/gxNtOEqXUnxaWFDf+MsTJNcZr8C86+Y8 e1V1y5OBtfH8uJ93sD97z7o= X-Google-Smtp-Source: AMrXdXuIX3br64IK4enjcctKcS4vn5jOnQaGmTos6jYdKkPxFj4wdfqO/ZuOB5ZpY5KOUeQspMTChg== X-Received: by 2002:a05:6a20:8f0c:b0:af:cc4e:f2f with SMTP id b12-20020a056a208f0c00b000afcc4e0f2fmr61678164pzk.34.1672619049393; Sun, 01 Jan 2023 16:24:09 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id k187-20020a6284c4000000b005769b23260fsm17713208pfd.18.2023.01.01.16.24.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jan 2023 16:24:09 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60443: 29.0.60; c-ts-mode: Consider re-using c-file-style and c-basic-offset Message-Id: <3A4D5651-D41E-4733-8625-BDB4EE12B2E9@gmail.com> Date: Sun, 1 Jan 2023 16:24:07 -0800 To: Dmitry Gutov X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60443 Cc: Mohammed Sadiq , 60443@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 31/12/2022 06:02, Yuan Fu wrote: >> IIUC part of the reason why we created separate major modes is that >> we don=E2=80=99t want to share configuration variables between the >> tree-sitter and elisp implementation. If they share some of the >> configuration variable but not all, it would be very confusing; it >> they share all variables, well that=E2=80=99s not possible because = c-ts-mode >> doesn=E2=80=99t support all of c-mode=E2=80=99s features. > > js-ts-mode uses js-indent-level. css-ts-mode uses css-indent-offset. > python-ts-mode and bash-ts-mode don't have their own indentation > settings, so I suppose they reuse the "regular" indentation code. > > There are a lot of other ts modes which don't have anything to reuse > ("regular" mode is not in Emacs). > > FWIW, that's my plan for ruby-ts-mode: to share those options where > it's feasible, to avoid random duplication, and to make comparing and > switching easier. The test suite can be shared more easily too. Hmm, yes, those modes live in the same file, and can be considered the same package. c-ts-mode.el is separate from cc-mode.el so it makes less sense to share variables. Maybe we can say "same package, share vars, different package, different vars", to avoid confusion? Yuan From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 01 20:30:39 2023 Received: (at 60443) by debbugs.gnu.org; 2 Jan 2023 01:30:39 +0000 Received: from localhost ([127.0.0.1]:42124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC9ex-0008RB-3t for submit@debbugs.gnu.org; Sun, 01 Jan 2023 20:30:39 -0500 Received: from mail-ej1-f50.google.com ([209.85.218.50]:39524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC9ev-0008Qy-CK for 60443@debbugs.gnu.org; Sun, 01 Jan 2023 20:30:37 -0500 Received: by mail-ej1-f50.google.com with SMTP id gh17so63770322ejb.6 for <60443@debbugs.gnu.org>; Sun, 01 Jan 2023 17:30:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=4/S4Zzf0/2eBmecLrS9cq0BoCr1Wo0wC7vTwH7pL4M4=; b=MCf3vYJIKRA0H9EguPJoQSLPg4QXaN+deUS7NGFqAFXHJsgnC/1rb/GtTAzey1PSUH XBGHsePVPDOwFC7y8rhsZ7JNR7m8NeVwUFaSZxiCRZYBrUt8ubsUDDM7b5Am9v4Z90ve GhMDhlWh7Vu+ezkt/MQRMad6jjk7F8kf/UulfNaZHkM4N5yh2mLKvwf/fWAVz2N0N5Nk wTUVcRW1XYmcPt8vHcMIJIf5o4RftmkBBXK6xTMIEqub3QPOIYPWgz670Wd1vvDXghqA QV4N6wSOSAvFAk9TmeS2sz8d3I76xHsjSrLPbcL/vKTjYm40kLCbuwhZdn/SG3pHQgRa hiXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4/S4Zzf0/2eBmecLrS9cq0BoCr1Wo0wC7vTwH7pL4M4=; b=l9DuUCCJf1z1NiokaZNgutLfjSCt1Tam250sv9aBqN4Iti8h5buptMZlTtnUjrpIot IoOzwBN3zvgckjl+g7/bHwbq3Vfv7ruT1ENo3QOj7o/uD/Gm9O+F0eY7Zq5aQvNCEUma 1uT3LLXivN6JYR5TUFlaEfP5QD1mkJDZkKE9SxeaFt3eaNRoUQmaewy6fWFJcyITgVS0 9AbWWh+3A8Ibnz+yk8NcAfv5ZtJA6RPD/bCmgfCKDTFEZnXW9uSBXZBHOv3AIXsDuztp O+R4WCX67y3h/FLi19VmU08QqTHfVrtPJrTzH4Vn/2DhMJhTPgMnY1hAaQiSsqPC7JpT qWtA== X-Gm-Message-State: AFqh2kqrCvEEBBX4CsmEGpO1+xTCsEPaH0UklU/bsvh1THpP8hK0PY9q iA+fnpOZR5umHs6BWYuX0SA= X-Google-Smtp-Source: AMrXdXtOaz+1JGkOQusE1wMFHvykYekUc/WwxG0/MHSWIbiSXR4pECcJuH86Fh4lBx30x1Z5NiSPQw== X-Received: by 2002:a17:906:2816:b0:7c0:d452:2e74 with SMTP id r22-20020a170906281600b007c0d4522e74mr33632492ejc.4.1672623031260; Sun, 01 Jan 2023 17:30:31 -0800 (PST) Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id t19-20020a170906609300b007bf71053d97sm12360408ejj.40.2023.01.01.17.30.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Jan 2023 17:30:30 -0800 (PST) Message-ID: <60a26e8c-1971-64d3-27b9-fca037661963@yandex.ru> Date: Mon, 2 Jan 2023 03:30:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: bug#60443: 29.0.60; c-ts-mode: Consider re-using c-file-style and c-basic-offset Content-Language: en-US To: Yuan Fu References: <0e9e8e06451e13d7bee3fd0c04939902@sadiqpk.org> <3A4D5651-D41E-4733-8625-BDB4EE12B2E9@gmail.com> From: Dmitry Gutov In-Reply-To: <3A4D5651-D41E-4733-8625-BDB4EE12B2E9@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60443 Cc: Mohammed Sadiq , 60443@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) On 02/01/2023 02:24, Yuan Fu wrote: > Maybe we can say "same package, share vars, > different package, different vars", to avoid confusion? That would make sense. Though ruby-ts-mode would break that convention too. :) I suppose it might depend on whether the modes are considered to be interrelated anyway, even if not residing in the same file. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 19:42:58 2023 Received: (at 60443) by debbugs.gnu.org; 8 Jan 2023 00:42:58 +0000 Received: from localhost ([127.0.0.1]:59363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEJm6-0002Ed-47 for submit@debbugs.gnu.org; Sat, 07 Jan 2023 19:42:58 -0500 Received: from mail-pj1-f46.google.com ([209.85.216.46]:44779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEJm3-0002EI-KE for 60443@debbugs.gnu.org; Sat, 07 Jan 2023 19:42:56 -0500 Received: by mail-pj1-f46.google.com with SMTP id o7-20020a17090a0a0700b00226c9b82c3aso5662915pjo.3 for <60443@debbugs.gnu.org>; Sat, 07 Jan 2023 16:42:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=1EKrS5a6aCKiCRILgGODOI6uLL0ngwxjPKtnJH5ckjY=; b=WCmC6qw4tr8SfYr1+39EY3pLkjNoQf0L6F6beHDQvylYBL+n3weUEzoWNeprChjqY1 Topr0lf5F2Kj3hWsNreax+Q2ZZhJRZHrXWLBNRsHldTdfO4XV+dfVSIHBIBBtJIF/bha oRJdh2FKAk1TkBNoERAw0wLh5IsZTXXGJlTGLNKODxuSWkFhw4Bapd5ZGAQ791f0Bz1b CsasQNH+UBQwOKmpK2D26sV0VLMj9rFHikbcEQR/2oSZEngmQhPCGkItzFKVBUP5XdUU yBuSNRo+NXzAP6GfuWKHngmdTxYoy/RwtuqzsZPTdwcryBiwy4+l2mGxfgy17K1rf5rl iI/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1EKrS5a6aCKiCRILgGODOI6uLL0ngwxjPKtnJH5ckjY=; b=rLkjp49kYS0s5+Lfubh0M0poS6jBQ6mz9NEBu0CR7sCjSAOCQ6MtESymeWsOmFub// RzmFxiGAHHeDSKFxtnUosrUCNB32w1e8OHBhI7BmBQKFt7QO7RhIZmj7nE6jqxWuIxA5 nPUS5zKDtTpbaibr4lKdIEO/YxDhpLxFpyA7nLfuj2PlcHZpguHzWPzVHcNYO1LmOTog Z6JH27z062PZxjQe4jjcIQylo12vX788Z/EwYdByzaDz9MBqa2NfCf7Pq7Zww58pNRIg rDy+UjqdME4LXqCqwDkYNY1nq7j+wSFs7XW3X3ES2ufm80BAX1eb37XKhoR4Rz6qkOXu xgZQ== X-Gm-Message-State: AFqh2koFsTqlMC3lLMcR57YLMvp/U6WP9OHFr3ySSpXJwzwR7IBoju2L R0Fk7ZrH6aNdJgVECAl81aI= X-Google-Smtp-Source: AMrXdXtnYSuBH2tPeKa1NxEbbOPAOgd0QTyjtp1VBPzIfBPJp1IA7pCGKrrMbBs5jxskdyJI9D8EXQ== X-Received: by 2002:a17:90b:4cc2:b0:225:f095:a3dc with SMTP id nd2-20020a17090b4cc200b00225f095a3dcmr45842003pjb.14.1673138569628; Sat, 07 Jan 2023 16:42:49 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id q3-20020a17090a2e0300b0020ae09e9724sm2888800pjd.53.2023.01.07.16.42.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jan 2023 16:42:49 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60443: 29.0.60; c-ts-mode: Consider re-using c-file-style and c-basic-offset Message-Id: Date: Sat, 7 Jan 2023 16:42:48 -0800 To: Dmitry Gutov X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60443 Cc: sadiq@sadiqpk.org, 60443@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 02/01/2023 02:24, Yuan Fu wrote: >> Maybe we can say "same package, share vars, >> different package, different vars", to avoid confusion? > > That would make sense. > > Though ruby-ts-mode would break that convention too. :) > > I suppose it might depend on whether the modes are considered to be > interrelated anyway, even if not residing in the same file. Right. It probably helps if "independent" modes mention this in their docstring. I added some text in c-ts-mode and c++-ts-mode=E2=80=99s = docstring. Yuan From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 03:40:34 2023 Received: (at 60443) by debbugs.gnu.org; 8 Jan 2023 08:40:34 +0000 Received: from localhost ([127.0.0.1]:59810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEREH-0000Wk-RP for submit@debbugs.gnu.org; Sun, 08 Jan 2023 03:40:34 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:46541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEREG-0000WX-0b for 60443@debbugs.gnu.org; Sun, 08 Jan 2023 03:40:32 -0500 Received: (Authenticated sender: sadiq@sadiqpk.org) by mail.gandi.net (Postfix) with ESMTPA id 172AB1BF204; Sun, 8 Jan 2023 08:40:25 +0000 (UTC) MIME-Version: 1.0 Date: Sun, 08 Jan 2023 14:10:25 +0530 From: Mohammed Sadiq To: Yuan Fu Subject: Re: bug#60443: 29.0.60; c-ts-mode: Consider re-using c-file-style and c-basic-offset In-Reply-To: References: Message-ID: <20f9dbdd4e087f1f6b67d94a669cf16f@sadiqpk.org> X-Sender: sadiq@sadiqpk.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60443 Cc: 60443@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2023-01-08 06:12, Yuan Fu wrote: > Dmitry Gutov writes: > >> On 02/01/2023 02:24, Yuan Fu wrote: >>> Maybe we can say "same package, share vars, >>> different package, different vars", to avoid confusion? >> >> That would make sense. >> >> Though ruby-ts-mode would break that convention too. :) >> >> I suppose it might depend on whether the modes are considered to be >> interrelated anyway, even if not residing in the same file. > > Right. It probably helps if "independent" modes mention this in their > docstring. I added some text in c-ts-mode and c++-ts-mode’s docstring. > I personally (as a user) prefers to have single variable for both modes, but if using different variables helps it maintain better, that might be a better choice