From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Yuan Fu <casouri@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#61211: 28.2; Feature request;
 facility for dispatch type  major mode
Date: Thu, 9 Feb 2023 17:29:26 -0800
Message-ID: <1D8721C5-5B3F-49D2-950A-409D984F91E2@gmail.com>
References: <13351.1675254487@localhost>
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\))
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="13649"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: monnier@iro.umontreal.ca, 61211@debbugs.gnu.org
To: ikumi@ikumi.que.jp
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 10 02:30:12 2023
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1pQIEu-0003RS-4k
	for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Feb 2023 02:30:12 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1pQIEp-00034N-3W; Thu, 09 Feb 2023 20:30:07 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1pQIEl-00033o-7U
 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 20:30:05 -0500
Original-Received: from debbugs.gnu.org ([209.51.188.43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1pQIEk-00051M-Q1
 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 20:30:02 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pQIEk-0006QT-Ke
 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 20:30:02 -0500
X-Loop: help-debbugs@gnu.org
In-Reply-To: <13351.1675254487@localhost>
Resent-From: Yuan Fu <casouri@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Fri, 10 Feb 2023 01:30:02 +0000
Resent-Message-ID: <handler.61211.B61211.167599258524655@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 61211
X-GNU-PR-Package: emacs
Original-Received: via spool by 61211-submit@debbugs.gnu.org id=B61211.167599258524655
 (code B ref 61211); Fri, 10 Feb 2023 01:30:02 +0000
Original-Received: (at 61211) by debbugs.gnu.org; 10 Feb 2023 01:29:45 +0000
Original-Received: from localhost ([127.0.0.1]:33955 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1pQIET-0006Pb-Fw
 for submit@debbugs.gnu.org; Thu, 09 Feb 2023 20:29:45 -0500
Original-Received: from mail-pj1-f54.google.com ([209.85.216.54]:53206)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@gmail.com>) id 1pQIEQ-0006PG-VD
 for 61211@debbugs.gnu.org; Thu, 09 Feb 2023 20:29:43 -0500
Original-Received: by mail-pj1-f54.google.com with SMTP id o13so3792536pjg.2
 for <61211@debbugs.gnu.org>; Thu, 09 Feb 2023 17:29:42 -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=VEQJZygow98Qkbdbr8XrvxdMFuHj6AN5Wy9SKZkolLQ=;
 b=BQQ/m4ZKHHLgA0kM0osj519sDs2Zck/yPYEA2826oHSBYkICuZp/uPf4eVqenBT9eC
 QrJx6RoW7AOHSSWFpP+S9EtST+DR/2t0YHvGNrQjI00tltBM3Zco8RYKXjRjj2iwv8zN
 BLY6oEhNOEWYUSH72r0JdFZeHpYK+5A4gPWgTfSsxa1YWRKpdL36wMXbkGBtbOPIsLyh
 u4CZvlpcSMJgvWklA8TAOsFTeESqCK6MD4dSWNls6yrbmugYMcuMJBRGkjUhiPl9qDY5
 yG41UL6V1VPg6IFeJeJJ+dnc0tGyyo3lAOBMsAk/0cY3oQRScUZBgHl3WsjAzGx9WGVV
 5Lug==
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=VEQJZygow98Qkbdbr8XrvxdMFuHj6AN5Wy9SKZkolLQ=;
 b=B0H8QKAyukQqjH6KMR0EtgTYpQeEwsvFcjsqMixISjSiDK6Mn0zwdJeF80Xh/oNGGw
 OIhKJCpmb6cV+sMtZ2sHBLPFfa8l4Uu0h6MIAZq9oJW/OHqsHFQU/q2/KwW+NLaA3cpU
 z2OLOXciUp4z+nBWxsXeOuiIN1wV/u/F7eyh4h8VGoRlG38UdpIm/AIIHg5VHkL6k3dd
 3aEab1tGPx/ZAZQWiKbtlJP8sXOlzYb1qHk5X5V1DFvMlfOBafVDD2X721vcop0gIBp/
 oaL4/zkPFAr7cees9BKlteaT35WXFGm8urx0NF2a3riI6UYxgdf6RCTk0Y/HoLLRCUny
 VM6Q==
X-Gm-Message-State: AO0yUKX38u/qrcBz52t1/+jEcW55sIsj8a4aeqdgE1yz/lUHlmSi78Hl
 fwcwuHRc0bJD1PrETqfwQdM=
X-Google-Smtp-Source: AK7set/Kl6WbbdvOpOy3YYLJEpRAd+Jx+nAW1iF30cQcaf2tofrDLL1swbnPFbhH0IYkXPIuymIFcg==
X-Received: by 2002:a17:902:e414:b0:199:5593:cdba with SMTP id
 m20-20020a170902e41400b001995593cdbamr4596654ple.69.1675992577085; 
 Thu, 09 Feb 2023 17:29:37 -0800 (PST)
Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 m3-20020a632603000000b0049f77341db3sm1839652pgm.42.2023.02.09.17.29.36
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 09 Feb 2023 17:29:36 -0800 (PST)
X-Mailer: Apple Mail (2.3731.300.101.1.3)
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:255260
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/255260>


Ikumi Keita <ikumi@ikumi.que.jp> writes:

> I'd like to discuss dispatch functions or "superficial" major modes.
> AUCTeX has the following major mode functions:
> context-en-mode, context-nl-mode, japanese-latex-mode, =
japanese-plain-tex-mode
> They only do language-specific set-ups and turn into context-mode,
> latex-mode or plain-tex-mode eventually. In some aspects, they are
> similar with dispatch functions `tex--guess-mode' and `TeX-tex-mode'
> (AUCTeX) which guess a proper major mode and call it:
> - They can be specified as `mode' tag of file local variable and entry
>   of `auto-mode-alist'.
> - They never hold their own `major-mode' value.
> - When called, they eventually turn into another proper major mode.
> For these reasons, they can be called "superficial" major modes.
>
> Note that it isn't enough to define them like
> (define-derived-mode japanese-latex-mode latex-mode "LaTeX"
>   ...
>   (setq major-mode 'latex-mode)
>   ...)
> because it doesn't respond to directory local variable entry of the =
form
> ((japanese-latex-mode
>   ...))
> in that case.
>
> So I hope emacs to have facility to handle such superficial major =
modes
> in a clean way.
>
> Regards,
> Ikumi Keita
> #StandWithUkraine #StopWarInUkraine

Another use-case is for tree-sitter modes: we want to dispatch to
tree-sitter/non-tree-sitter major modes automatically.

Yuan