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, 08 Sep 2023 08:25:50 +0100 Message-ID: <871qf9ktxd.fsf@gmail.com> 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> 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="2803"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Theodor Thornhill , 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 09:24:08 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 1qeVqZ-0000VP-Ml for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Sep 2023 09:24:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeVph-0001Fm-Cj; Fri, 08 Sep 2023 03:23:13 -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 1qeVpf-0001FV-1M for emacs-devel@gnu.org; Fri, 08 Sep 2023 03:23:11 -0400 Original-Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeVpc-0006C1-NK; Fri, 08 Sep 2023 03:23:10 -0400 Original-Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-31dd10c2b8bso1632650f8f.3; Fri, 08 Sep 2023 00:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694157786; x=1694762586; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+JC8QvB8Nz2x+65XjqmfA+5Wo3XOY3pXCTYPrFyEWkw=; b=JRCa89S5yICWQbnh5ikOX9ijOdiQjcyJfJiuR1H3ZCIVDMh1BstkexZwX+H7fK1rxK Yyt8wv2sVaTrEmMqZcgJZ0FpXzBpNFannrsC0+pAsGd6qp291ffpQDBw6xsqssZL+OQk xhkqC9XOwEZkwbP6uTCOv2ricmp33e5orRXCJ6kRghfkUir6QNDhpBuOTXW0aFJyLu5b BJaBTTLbDc5cuOMvNpBEW4H6yfK2gekMS7Le5s01dFhb/1lM1fqEpFETyyCVKo/6f1Hy cNU8Q5m4avHSxGh+q3n0l7o//Tnrcv2p5lbARP+b+qancfjqFjtJdvpDjVP1RvFl7SlL lrIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694157786; x=1694762586; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+JC8QvB8Nz2x+65XjqmfA+5Wo3XOY3pXCTYPrFyEWkw=; b=alKoYCdQyPOM2uVXPfksXYIah8gtgKUcgq+lnCAjH//LhJEm3BnXClE43bIN5mM3Sm Yzqi89PeO2Ki/YNGHKXposRqqlGXw4eLEuPaqLCYeWYxEDgwg6DIT+D49AfWAomUdk/6 lrKrkTNITNZ4mRFhKHp2k4jLjNmfMcx/1IGlw02l084KLjpBi5u2Rk+gJ7vEQSPRn6yp TooKC5VXCN0mN2713N7N9JmEnqxW8jfIcRGTH+f9WRj23yR+JmO4tUmIzG0qKbr1yGxw o9hvJMez9eKCS56/nugRpvQ6T2uAhQF1na89eLm4YHMNkRKoI4UMbhF8jQXPyo3uUCHs QtgQ== X-Gm-Message-State: AOJu0Yzdz7aWikSxF5RmTvfYJPM6tiuSUG5G51WsjLJ1B1haYTyWl0LQ Q/8a3UTGmHeV8IBk2RB+upKViFXbkbUvKw== X-Google-Smtp-Source: AGHT+IHUO2r+eHCngxyDbou3ws8TM+YxE+n6HzrvgSs67RiK83drm1zWS52s0g7ZS6p7TO0ZXV1mSA== X-Received: by 2002:a5d:55cf:0:b0:313:ef24:6fe6 with SMTP id i15-20020a5d55cf000000b00313ef246fe6mr1277630wrw.1.1694157786119; Fri, 08 Sep 2023 00:23:06 -0700 (PDT) Original-Received: from krug (87-196-72-223.net.novis.pt. [87.196.72.223]) by smtp.gmail.com with ESMTPSA id q8-20020adfea08000000b0031f2dea4810sm1315106wrm.61.2023.09.08.00.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Sep 2023 00:23:05 -0700 (PDT) In-Reply-To: <83msxxxkc0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 08 Sep 2023 09:14:39 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x42e.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:310310 Archived-At: Eli Zaretskii writes: >> IMHO making c-ts-mode--indent-styles a public CL-style >> generic function would be a good possibility. > > Sorry, I don't understand: since we already allow > c-ts-mode-indent-style to be a function, why do we need any other > function-based feature? Not all functions are the same, and my idea is fundamentally different than the current mechanism. The current variable offered which can be indeed a function has no concept of the "base set of rules" that you can extend, modify, or splice your lists into them and neither does it formalized way of when to do these things. So in the current interface, the user has to specifically know where and how to get the bae set, (which includes )exposing implementation details). In my proposed interface, she doesn't. She just codes the delta and the conditions for overridding if she so wishe. > If the only reason is that the function form of c-ts-mode-indent-style > looks ugly to you, then I think this is in the eyes of the beholder; > it doesn't look ugly to me, FWIW. You may be confusing my proposal with one of a non-generic "normal" function that you modify with add-function. That's more-or-less the same as a generic funtion (with :around, :before, :after, etc...) So if you don't like CL stuff that has a more emacsy feel (but is generally the same). And of course a hook has an even more emacsy feel. The advantage of my approach is the specialization in the arguments. >> A defcustom-style thing for customize lovers can also be added, >> later for people that don't like defgeneric. Seems like a pretty >> large DSL to code up in customize, though. > > What I had in mind was a simple alist, like CC Mode uses, with an > infrastructure function to install it. Patches are welcome. It would certainly work for me, at least for my very simple case, and I would be happy for this. Not sure it is half as powerful, for example how would you make that simple alist express cases where you want to add the rules _after_ the base set? Two alists? I don't know if that is useful, but I seem to have read somewhere in ts code that ordering is important. Anyway, looking forward to see those patches, for the moment I've supplied one. Jo=C3=A3o