From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: c-ts-mode Date: Fri, 8 Sep 2023 16:56:20 +0100 Message-ID: References: <5F73CB5D-DB00-439F-AD7C-7E209EC83A35@gmail.com> <83jzt2z5mk.fsf@gnu.org> <83y1hhykni.fsf@gnu.org> <877cp1lvih.fsf@gmail.com> <83v8clyhqi.fsf@gnu.org> <83tts5ygv2.fsf@gnu.org> <83msxxxkc0.fsf@gnu.org> <871qf9ktxd.fsf@gmail.com> <838r9gykia.fsf@gnu.org> <83pm2sx10t.fsf@gnu.org> <83msxwx02s.fsf@gnu.org> <83jzt0wueo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4520"; mail-complaints-to="usenet@ciao.gmane.io" Cc: theo@thornhill.no, casouri@gmail.com, spacibba@aol.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 08 17:57:32 2023 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 1qedrP-0000yG-Fg for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Sep 2023 17:57:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qedqZ-0003vL-Om; Fri, 08 Sep 2023 11:56:39 -0400 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 1qedqX-0003v5-Pb for emacs-devel@gnu.org; Fri, 08 Sep 2023 11:56:37 -0400 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qedqV-00081t-Ch; Fri, 08 Sep 2023 11:56:37 -0400 Original-Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-501b9f27eb2so4105489e87.0; Fri, 08 Sep 2023 08:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694188592; x=1694793392; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lUtVYmG4z9fVk74C1+xFi8yBwsp+pK4cTid0Xoy1UT4=; b=kKdc+ylDLOWm/bbRuh2cAyRKQu9D3jXHOLKzpbtyMY8f9zRp/uYn1iZyUI9ppzC6SS SPUdDOH064OZDL0HlOt3vZhWkgzaPkYDf4OMtn7qwgP7G2FcHFPUiGsXPE4fVDzrAGCs kTet2S/hIh07IngVqTQ7TIl015uFs4G0BlD5RpyoWPLxsAPd4aj3TGQuaZCnOhOGzJXZ 0YgUZUQne+s5zp76TYKogjzf65uict6+ZVjU54nFi7ode5fwKx0OnFBcVN4EwCHSwxKn /S2IDyWzhtU0+iJCAlfFYVMEeOj6IL6MxR+mRItA7y9Twpw3lvv2JH1civd1bAiiWJJS yt6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694188592; x=1694793392; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lUtVYmG4z9fVk74C1+xFi8yBwsp+pK4cTid0Xoy1UT4=; b=XOq0DTpq5ljvO2/faBFp3WNsKBZi22JyHHBwCSlkr1owHj15eqIfBJOLU90Ixbsd+q DCsriI9t7X8WETTHZCjUX65mETY66muvbvDvPCPIhdHZHiYxR+UwbJXN4fUfg0L8SQfx moNUeZbcRk8rgBV/OmtwP+YSYvJ3npGKOhoyEAuMgnzeNUBYnKQr/kWaeGJKjflKUKny OZIdpVH0aZJ8EVmUwlnoLMSgd8QNVVEHivSaz+vZgrMub01j5gLD94V1kg/Zh4i6LNfd fiZibMtAf/3HTa9PsHMCCj0LqxvOrgD8srOWzhxD0nBsX9m6L/A8Gz2pOOl919eRj/El Su8w== X-Gm-Message-State: AOJu0YyKt5xMsWn5CTvENoHjGm0qrGUsjEfQtAJx02Rsv2C1a4NGVAfT n54MKcY6hqVK+J7gWP/9eO856nIAHkLwc33uqZs9OKgm1qdlOA== X-Google-Smtp-Source: AGHT+IEUCvQCXGRK8oDi29hXGPQQTS7WJDRWky4WYNs/gD7TFRsTQWyJqKspfKi/aBAr5peDVc8d08BnzACfuf2Lw2Q= X-Received: by 2002:a05:6512:3d8e:b0:4fe:8be:6065 with SMTP id k14-20020a0565123d8e00b004fe08be6065mr1292346lfv.5.1694188592111; Fri, 08 Sep 2023 08:56:32 -0700 (PDT) In-Reply-To: <83jzt0wueo.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 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, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:310339 Archived-At: On Fri, Sep 8, 2023 at 4:34=E2=80=AFPM Eli Zaretskii wrote: > > > From: Jo=C3=A3o T=C3=A1vora > > Date: Fri, 8 Sep 2023 16:15:09 +0100 > > Cc: theo@thornhill.no, casouri@gmail.com, spacibba@aol.com, > > emacs-devel@gnu.org > > > > > > I guess this means we should add a TODO item for supporting such > > > > external specifications? > > > > > > Done; patches welcome. > > > > I couldn't find your TODO item (in etc/TODO at least). > > Chrystal ball says you looked on master. I made my change on the > emacs-29 branch instead. Ah yes. > I think we should try to support this without LSP servers. OK, but then you'll have to deal with the abstraction problem which is being solved by LSP servers at the moment, quite effectively. It's fine to want this but the motivation you'll find for working on this item is affected That's because that "minimum command" you mention already exists in practice Are you aware of eslint, prettier, gofmt, rustfmt, and whatever other formatter programs are out there? Or do you just want to support clang-format for the Emacs project and other C/C++ projects? Also I'm not sure that formatters for some languages aren't exclusively LSP. Anyway, do you also want to support this without external tools at all (i.e. without relying on the clang-format program at all?) Your TODO item seems to say so. If so, then going that route means basically writing a translator of clang-format -> Emacs treesitter rules. Maybe it's easier than I think, and the main advantage is it will plug into indent-line-function and indent-region-function rather easily. And, who knows, some code can be reused for writing translators of other formatters. Anyway I wouldn't discard the "LSP shortcut" idea. Jo=C3=A3o