From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#52864: sgml-tag inserts newlines Date: Wed, 29 Dec 2021 19:58:50 +0200 Organization: LINKOV.NET Message-ID: <865yr7z411.fsf@mail.linkov.net> References: <875yr8412e.5.fsf@jidanni.org> <86k0fn3if8.fsf@mail.linkov.net> <86bl0z3i81.fsf@mail.linkov.net> <87wnjn5suv.fsf@gnus.org> 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="17797"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 52864@debbugs.gnu.org, =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 29 19:01:16 2021 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 1n2dGG-0004Sr-4p for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Dec 2021 19:01:16 +0100 Original-Received: from localhost ([::1]:38090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2dGF-0006Ky-4v for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Dec 2021 13:01:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2dG2-0006Kl-Um for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2021 13:01:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2dG2-0006f8-LR for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2021 13:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2dG2-0003Mo-F5 for bug-gnu-emacs@gnu.org; Wed, 29 Dec 2021 13:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Dec 2021 18:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52864 X-GNU-PR-Package: emacs Original-Received: via spool by 52864-submit@debbugs.gnu.org id=B52864.164080083012894 (code B ref 52864); Wed, 29 Dec 2021 18:01:02 +0000 Original-Received: (at 52864) by debbugs.gnu.org; 29 Dec 2021 18:00:30 +0000 Original-Received: from localhost ([127.0.0.1]:50290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2dFW-0003Lu-K2 for submit@debbugs.gnu.org; Wed, 29 Dec 2021 13:00:30 -0500 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:38351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2dFU-0003Lh-Ey for 52864@debbugs.gnu.org; Wed, 29 Dec 2021 13:00:29 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 48D99240003; Wed, 29 Dec 2021 18:00:19 +0000 (UTC) In-Reply-To: <87wnjn5suv.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 29 Dec 2021 16:32:56 +0100") 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" Xref: news.gmane.io gmane.emacs.bugs:223369 Archived-At: >> (defcustom sgml-tag-end-newline skeleton-end-newline > > Doesn't it depend on what tag you're inserting whether it's likely you > want to have a newline at the end, though? The more "block"-like tags > would normally be preferably have a newline at the end, while others > don't. All necessary newlines are explicitly defined in skeletons, e.g. a block-like div: (define-skeleton html-div "HTML div tag." nil "
" > \n _ \n "
" >) where ‘>’ at the end inserts a newline too and indents. But non-block tags are defined without newlines, e.g.: (define-skeleton html-span "HTML span tag." nil "" > _ "") and skeleton-end-newline inserts an unrequested newline. > On the other hand, if you're inserting a tag in the middle of the line, > you probably don't want to insert a newline, I think? So perhaps just > adding that defcustom is the right option... Given the examples above, I don't know what the default value should it have, maybe nil? For example, 'texinfo-mode' does this: ;; Prevent skeleton.el from adding a newline to each inserted ;; skeleton. Those which do want a newline do that explicitly in ;; their define-skeleton form. (setq-local skeleton-end-newline nil)