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: Thu, 7 Sep 2023 19:23:33 +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> 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="40572"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 Thu Sep 07 20:21:59 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 1qeJdd-000AK9-WD for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Sep 2023 20:21:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeJcr-0008PY-Ao; Thu, 07 Sep 2023 14:21:09 -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 1qeJcp-0008PQ-4n for emacs-devel@gnu.org; Thu, 07 Sep 2023 14:21:07 -0400 Original-Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeJcl-0007ZU-5t; Thu, 07 Sep 2023 14:21:05 -0400 Original-Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2bcc187e0b5so22565381fa.1; Thu, 07 Sep 2023 11:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694110859; x=1694715659; 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=6IK4dGkEph83IHtZFNUBl/oUM1oMkVZYKCDJ7YgqJ14=; b=jjv5F5D1bNtnk0npSeV+Q29eRynQfGsWYcrVQd6V80DakRMUS3SUEHof04kFXIN7tB 82D7SBdRbt9kCRrMIEtW7P08clIVzcWgtYZXrnmRbp4Jst36gDik4enJnyBgyM1Ptq+Y RpQ/kxxHM2DQrga+usQr5OfuRVDJJoh4KYpZG6RkbCpQKE9ALfGIqdAcUuQ+Izd/8FiY HZOKQ17/VGWCBexuETOzkfO5OnduAHxBrYk5sXDy8FXjsWWOkhzZm/ZgSxOb3P5jazIt CO4nDv5M/Z8eG/LG62nrr4EcuZESRI0s36So4ALA+WTIKZwyuaPY3R/5TGOkwxstSxor H4gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694110859; x=1694715659; 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=6IK4dGkEph83IHtZFNUBl/oUM1oMkVZYKCDJ7YgqJ14=; b=VZvf2c/PbJOMqZzYyxa/ZAc656v00WsumgMwfk0PBD5neiKyDSfhOAcU/TAz1kL5YL La2bVykux0KNFreR424iwzofu8Wj57UY1WiytGRAvEyp56H3mpUx6b4jWhuPhaKMPgHL PN6j943V0Tgjy2P5uHZE8UbKSuZvbxuC3EKqemXu8+ePStebhpRSPq62EyuCy+94zvk7 AD2bSckOqukTQxOTuVsg3mfMPuZFpqS0CfPw07RwVxMi/yB3BcuT5O7zv5W5qIg1VNVL Eppxg6cJ2b+j9WwYqJdzUjacvK/I86sJwJd8ZWy+DL+JGXHKSgk2S8oRS0b2N5gBCsE0 sM2w== X-Gm-Message-State: AOJu0YzMQ+j1yRUc0tKHKgpjjPSKPklRmLUkQAWyRQlL0S4/a7E/0jKd Xtyx6EBPwVq5kSydRQ5Qx+UBnEKpm9x+J0mMOk7zyeSOvPw= X-Google-Smtp-Source: AGHT+IFPVtR5jhk3ijGE2YF52D7PjRWAtr75dfKI9yW9B0W1d0dtMpedUH+bXEIkMlDAo8P4Uk0qtc9DKSdrsmwF5Cg= X-Received: by 2002:a2e:9e45:0:b0:2bc:c064:7252 with SMTP id g5-20020a2e9e45000000b002bcc0647252mr49423ljk.5.1694110858893; Thu, 07 Sep 2023 11:20:58 -0700 (PDT) In-Reply-To: <83v8clyhqi.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=joaotavora@gmail.com; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_NONE=-0.0001, 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:310277 Archived-At: On Thu, Sep 7, 2023 at 7:13=E2=80=AFPM Eli Zaretskii wrote: > > I've been doing some experiments with c-ts-mode-indent-style, which can > > be set to a function that returns a list that adds new items in front o= f > > the list returned by with: > > > > (alist-get 'gnu (c-ts-mode--indent-styles 'cpp)) > > > > It's not super clean (notice the '--'), but not very dirty either. > > My preference would be to provide the same interface as CC Mode: an > alist with the parameters and their values, or something similar > (e.g., a keyword/value plist). Asking users to write Lisp functions > to customize indentation style is less friendly, especially if the > user comes from CC Mode. Agree. The function I'm writing is so simple that it needn't really be a function. If there was a public way to "grab" the rules named of a indentation style (like 'gnu' in my case) it would be almost trivial to get rid of the function. The real challenge is writing the rules themselves. I'm missing a kind of "debug rule" that doesn't do anything but prints out contextual information from the node, parent-node, grandparents. I made one but it's not very good. Is there something like that? Wouldn't even need to be an indentation rule, more like a "describe AST at point"... Jo=C3=A3o PS: I see in the meantime you reproduced the c++-ts-mode-bug. Great!