From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: On treesit preference for "consumer" modes Date: Sat, 26 Aug 2023 20:31:23 +0300 Message-ID: <83edjplnh0.fsf@gnu.org> References: <7649A9B7-3697-4CA4-BCBE-BAC7DA814B12@gmail.com> <83il91loqd.fsf@gnu.org> <54636E96-059D-4087-846D-61E9CF697952@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39449"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: JD Smith Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 26 19:31:56 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 1qZx8d-000A3t-TN for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Aug 2023 19:31:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZx7g-0006dq-VL; Sat, 26 Aug 2023 13:30:56 -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 1qZx7e-0006ck-Dw for emacs-devel@gnu.org; Sat, 26 Aug 2023 13:30:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZx7e-0007TV-4k; Sat, 26 Aug 2023 13:30:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=cB51Q2tJF6pOu0wUIXoyHRIf4U+Rp5IRRcZiH0tS7mQ=; b=YPYRG7/Qiid24Ou5MJJY 63O9X9k++9eqH8mWcadkmbcfBSydxZIkOYW4EMZ606H4GLOjh4iu6aJ/jpEtC2TW5JCih8UEx+re4 xDRVFN7GO1mjsgGG0e9Z52QqFRacpFB+R6d9jMrK0+iH1n0Qlw9KWzD7JdOAE/3ARuHgJyxsMgZLW JPscKQ5fMYIIaudc7GhEzTGWHQYjusfn0Gf9CfPD0G7IUkiOM+mDsVZVbcWoADEZzkop2ByIQDjVJ GSGkFMDt5Y+MHhWq3CK/4v/h+AlsmKtGFu6TFujAw5NrMAC0Vo8OPRxsZRY+YlYdaB/FsdZ1/4c3/ xUbhBOH4LnZPKA==; In-Reply-To: <54636E96-059D-4087-846D-61E9CF697952@gmail.com> (message from JD Smith on Sat, 26 Aug 2023 13:17:54 -0400) 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:309267 Archived-At: > From: JD Smith > Date: Sat, 26 Aug 2023 13:17:54 -0400 > Cc: emacs-devel@gnu.org > > One (likely too) simple idea: a function to ask emacs “What mode would you enable if I opened > /path/to/file.EXT”, without actually having to open it. Consumer modes could check that for relevant > paths and extensions, and opt to use that mode (if everything else checks out). See set-auto-mode--apply-alist.