From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#68246: 30.0.50; Add non-TS mode as extra parent of TS modes Date: Sat, 6 Jan 2024 13:52:48 +0000 Message-ID: References: <83edeww73j.fsf@gnu.org> <83o7dzvrmf.fsf@gnu.org> <838r53vlo5.fsf@gnu.org> <831qavvcbo.fsf@gnu.org> <83v886ubpu.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="420"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68246@debbugs.gnu.org, casouri@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 06 14:54:30 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rM78A-000AUm-HM for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jan 2024 14:54:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rM77f-00080I-1e; Sat, 06 Jan 2024 08:53:59 -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 1rM77d-000807-Nr for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2024 08:53:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rM77d-00061K-FH for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2024 08:53:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rM77h-0005ke-TG for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2024 08:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jan 2024 13:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68246 X-GNU-PR-Package: emacs Original-Received: via spool by 68246-submit@debbugs.gnu.org id=B68246.170454919522047 (code B ref 68246); Sat, 06 Jan 2024 13:54:01 +0000 Original-Received: (at 68246) by debbugs.gnu.org; 6 Jan 2024 13:53:15 +0000 Original-Received: from localhost ([127.0.0.1]:58831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rM76w-0005jX-O5 for submit@debbugs.gnu.org; Sat, 06 Jan 2024 08:53:15 -0500 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:42294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rM76v-0005jL-C1 for 68246@debbugs.gnu.org; Sat, 06 Jan 2024 08:53:14 -0500 Original-Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50e7b51b0ceso433337e87.1 for <68246@debbugs.gnu.org>; Sat, 06 Jan 2024 05:53:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704549182; x=1705153982; darn=debbugs.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=dXTFHcfePDkuGdRDjLp1fcFz24qjeDFKKs9Lw4YNI5U=; b=X2IT9xcy7hTWd4klZ/UOGJWAqqg+daiXY/ryYFYE6JAEayYQY5CcoXfYuQMDmQXuf/ sAzbNjvQdJpSZnhRT/yUPut4kDgOdAn69543KhhdyrXH51ddEqjnXrP/lPdXfbVPm7au e5xHa1t0x/dtcelGHpSwH10qKExuleHE6gCRzwPcoXf7ZI/E8xZSUVUAASoGVzF9Lwuf PzYpGdlb5RrVMkvClWzx8VEt7dhr1ovWQ58Nr2Hc68Bxd8BbKoZ1R6KL66qsnsgaLVsR K9nCc9Q5FN1rc/FFXIUnSogACKilWoapD/QuXa87FLLeRDRoweKmzIjAhuNlTRWop0F6 92Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704549182; x=1705153982; 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=dXTFHcfePDkuGdRDjLp1fcFz24qjeDFKKs9Lw4YNI5U=; b=C4z8Tk7XWyt4/RW/rOFjhaByfUddD/SydWb3BPLNL48YUu84ZQ30XqjN98LPRT8uRy 3Y774cNylDf+SX1Z+u7K6XcdFHXIRXknCiFN02CFk18wm/7WRcptHrTy/Q3XgxtkgyhH Wp5/FTuU61nVU8namladXuAIDt2C/jlte+3eRPs0S5Bf9LZiUj9FGrJJS4Fj7CZGbxfm d+vp/fff3n5mHX91j8l8qHhJKntuEioZvauiAtAI8Q7zs/T5w10a4Tf0nTxctnpe4h4L 3qewTBfNKLvjXm4YEOtaaRJwYaTFV2sMqO/4xU4rmdKIGyAvfqsacst9KpBtXNAbt9yU N3sQ== X-Gm-Message-State: AOJu0Yx8QHICWLGEpp3nrktID+J5raKJGFiCCdzWR2mp7+AXduBo2Nov xU1i7ND0stBlpLQwk4iGIlIjNerZTrHBwrlyrWs= X-Google-Smtp-Source: AGHT+IFZeIDNE/1khVrgWMG59vgcYv8pDwUtHQY8DwzgfSO4/LuOk/R4Knvy5V16e8SeCzJVQtXNo+CFyFM43TqbePQ= X-Received: by 2002:a05:6512:ace:b0:50e:74e1:2e35 with SMTP id n14-20020a0565120ace00b0050e74e12e35mr2264975lfu.5.1704549181881; Sat, 06 Jan 2024 05:53:01 -0800 (PST) In-Reply-To: <83v886ubpu.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277463 Archived-At: On Sat, Jan 6, 2024 at 8:07=E2=80=AFAM Eli Zaretskii wrote: > let's agree to disagree, because I already explained this twice at > least. I was just commenting on your earlier words "That's because a language parser will not have any notion of a sexp, so it cannot help." That's manifestly wrong. Even with a limited understanding of what a sexp is, it can definitely contribute to sexp navigation as used by scan-sexp clients. > Again, if you disagree, let's agree to disagree. Yes, let's. But what you said doesn't contradict my assertion that TS the can feed into scan-sexps in ways that are useful. > > And the way this could work in Emacs is for TreeSitter to feed into > > scan-sexps. > > I'm not sure I understand how TS could feed scan-sexps. Did you look > at the implementation of scan-sexps? AFAICT, there's no way to base > the code there on TS, except by providing a completely different > implementation (assuming TS parsers even provide the required > information). One reasonably effective way to do it is just have syntax-propertize-function propertize text based on TS nodes, which is what c-ts-mode does today to make show-paren-mode do the right thing to angle brackets. Pretty useful already. You're still running through text properties and that's maybe not very pretty, but an implementation detail all the same. There could be be some more efficient connection between sexps and TS (or whatever parser) later on. > > > > > I invite you to compare CC mode with c-ts-mode, and see for yours= elf > > > > > how the common grounds are very small. It seems surprising at fi= rst > > > > > sight, but once you look at the code, it is very clear. > > > > > > > > And this is mainly because CC mode is, well, rather corpulent softw= are, > > > > let's put it like that. This is why I wrote it makes sense to star= t > > > > from scratch for this one. > > > > > > A discussion where you brush aside any argument that doesn't fit your > > > theory is not a useful one. > > > > ? You write this precisely in the point where I _agree_ with you. > > You "agree" for the wrong reasons. You are, in fact, claiming that > the CC mode cannot be an example of a problem because of unrelated > reasons. I'm saying that the reasons are related. Actually it _could_ be an example. A c-uber-base-mode would have _some_ benefit, like it would be a good place to stash snippets. Just not as much benefit as others which have code. > > > This means that the > > > base-mode hook will not see a mode that is ready for work, only its > > > beginning. > > > > Correct. But a major-mode doesn't have to be "ready for work" (I presu= me > > you mean ready for editing) for the hook to be useful. That hook would > > be perfectly suitable for setting variables used by minor modes and oth= er > > things. (eglot-server-program, flymake-diagnostic-functions, company-b= ackends, > > mode-line-format, etc etc) > > For turning on minor modes (eglot-ensure, company-mode, yasnippet-minor= -mode,) > > For binding commands. > > Stefan's patch solves these cases in a simpler manner. I don't oppose Stefan's patch strongly, but I don't think it's simpler. For one, it's innovative, a new way to do things that we could already do with a simpler-to-reason inheritance that we've had much longer. As far as motivation goes, the problems in Eglot and Yasnippet are easily solvable without it. Not sure about CEDET. As Stefan K points out this needs calling out in *Help*. > > I couldn't see the problem in either python.el or sh-script.el. > > Search for bugs in those two files, and you will see the issues that I > had in mind. Yes, will most definitely start my "search for bugs" in two files totalling 10000 lines and you know in 200 years or so. Jo=C3=A3o