From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rudolf Schlatte Newsgroups: gmane.emacs.devel Subject: Re: Should yaml-ts-mode inherit from prog-mode? Date: Mon, 20 Mar 2023 15:37:05 +0100 Message-ID: References: <83mt478w48.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13542"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) To: emacs-devel@gnu.org Cancel-Lock: sha1:Qhu9gb574LarI7YqROJxH4tDg5I= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 20 17:14:55 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 1peI9s-0003Ft-Gf for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Mar 2023 17:14:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peI9P-00038i-FQ; Mon, 20 Mar 2023 12:14:23 -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 1peGdR-0003Cy-Lk for emacs-devel@gnu.org; Mon, 20 Mar 2023 10:37:17 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1peGdP-0006DX-TR for emacs-devel@gnu.org; Mon, 20 Mar 2023 10:37:17 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1peGdN-00049X-97 for emacs-devel@gnu.org; Mon, 20 Mar 2023 15:37:13 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 20 Mar 2023 12:14:21 -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:304606 Archived-At: Eli Zaretskii writes: >> Date: Mon, 20 Mar 2023 01:52:47 +0000 >> From: Randy Taylor >> Cc: rms@gnu.org, Romanos Skiadas , philipk@posteo.net, emacs-devel@gnu.org >> >> Eli, do you have any comments? > > Nothing substantial, no. > >> The general consensus seems to be that yaml-ts-mode should inherit from prog-mode instead of >> text-mode. >> The arguments in favour make sense to me. > > That's not my impression. My impression is that there are arguments > both ways, and therefore the original decision of having it in > textmodes still stands. The arguments to the contrary were not strong > enough to justify the move, IMO. Let me try one last argument for making the switch to prog-mode. Put the following yaml fragment into a file and hit M-q ("fill-paragraph"). This destroys the yaml structure: Before fill-paragraph: jobs: check: runs-on: ubuntu-latest strategy: fail-fast: false matrix: emacs_version: - 27.1 - 27.2 - 28.1 - 28.2 After fill-paragraph: jobs: check: runs-on: ubuntu-latest strategy: fail-fast: false matrix: emacs_version: - 27.1 - 27.2 - 28.1 - 28.2 I'd argue that many commands offered by text-mode would have to be audited or adapted to be meaningful in a yaml file; for example, what is `forward-sentence' supposed to do in the context of yaml? Most yaml files "in the wild" are configuration files (for Kubernetes, ansible, and other "modern" tools), so in practice yaml-mode is much closer to json-mode and lisp-data-mode, both of which derive from prog-mode. >From memory, my (probably unfair) impression of the arguments against the change were "I checked the spec, and it isn't a programming language and has no keywords, so it's clearly text", with the arguments for the change were more like "these are the things I'd have to adjust to make it more like prog-mode"; in my case, this would be changing to a fixed-width font, turning off flyspell, and unbinding (for safety) lots of text-mode keybindings as I run afoul of them.