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: Should yaml-ts-mode inherit from prog-mode? Date: Mon, 20 Mar 2023 18:53:20 +0200 Message-ID: <83355z8iv3.fsf@gnu.org> References: <83mt478w48.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28048"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Rudolf Schlatte Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 20 17:54:01 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 1peIlk-0006vk-CI for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Mar 2023 17:54:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peIl3-0003lH-Pe; Mon, 20 Mar 2023 12:53:17 -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 1peIl1-0003kr-Qw for emacs-devel@gnu.org; Mon, 20 Mar 2023 12:53:15 -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 1peIl1-0000bO-4y; Mon, 20 Mar 2023 12:53:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DnqLU4V6q3Vht5qbQl9AWx9CB4xo3IHpWBt5hC6/KYM=; b=Q50APZN8nt/A zmQ+l/Y1XgH093VqafOwINRdJYmLCKzvKK5OZt/nAZs0Q5/CRjYBdMgPXrRTizQYob4g31Z4q7x2u /vZCl7tFPP0xZH6/rhPo0To6Vperv9bHhXT+RnZHgSzw/vUwK+zi3+Re8a+atDpM3ulHXdmodLhY7 vuDU7Pe5SN2J90+vx+f0SXK47d335v2OAY1egj2OfCUQXf+NOzkcpyNjRg2sR3Mje+zbw9WfinvLp f4jAyJWj+kQEAVVMJR7yha4h0RPn/E1PMQv2R1n+3j2fSzfvjpcpwK7HEHovR7VbwZggARYzDXZ/6 aSsm9m64+h9OHYCGZRvRNg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1peIl0-0008QT-FU; Mon, 20 Mar 2023 12:53:14 -0400 In-Reply-To: (message from Rudolf Schlatte on Mon, 20 Mar 2023 15:37:05 +0100) 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:304609 Archived-At: > From: Rudolf Schlatte > Date: Mon, 20 Mar 2023 15:37:05 +0100 > > 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 This just means that yaml-ts-mode should be fixed by defining an appropriate fill-paragraph-function. Many descendants of prog-mode define such functions, so being a descendant of prog-mode doesn't magically make M-q DTRT for a mode. > 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? What useful things does forward-sentence do in C mode or in Emacs Lisp mode? Anyway, this and other similar arguments were already brought up, I believe. And other arguments were brought up in defense of the opposite view. Which is why I think there's no strong justification to make yaml-ts-mode a descendant of prog-mode, after we had it where it is now for some time.