GNU bug report logs - #52864
sgml-tag inserts newlines

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Wed, 29 Dec 2021 03:19:02 UTC

Severity: minor

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 52864 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 52864 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#52864: sgml-tag inserts newlines
Date: Wed, 29 Dec 2021 19:58:50 +0200
>>   (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
    "<div>" > \n _ \n "</div>" >)

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
    "<span>" > _ "</span>")

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)




This bug report was last modified 3 years and 199 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.