all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-devel@gnu.org
Subject: Re: some proposed tweaks to HTML mode
Date: Fri, 22 Mar 2019 15:55:01 -0700	[thread overview]
Message-ID: <875zsatt8a.fsf@ericabrahamsen.net> (raw)
In-Reply-To: jwv5zsa65yj.fsf-monnier+emacs@gnu.org

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> Indeed, `class` and `id` should be automatically added to all elements
>>> (i.e. not in the above list but directly in the sgml-attributes code).
>>> But for many elements it makes sense to not query any attributes at all
>>> since they almost never have any attributes (not even "class" nor "id").
>>
>> I was also thinking `sgml-attributes', but I'm less sure about excluding
>> elements.
>
> I didn't mean to exclude elements.  I meant that if attributes are
> queried then we do want to include `class` and `id`, but if they're not
> then we shouldn't change it just on the premise that `class` or `id`
> could be added.

Yes, that makes more sense.

>> Making sure I follow you, the definition of eg `html-ordered-list' would
>> then look like:
>>
>> (define-skeleton html-ordered-list
>>   "HTML ordered list tags."
>>   nil
>>   \n "<ol>" \n
>>   "<li>" _ (if sgml-xml-mode "</li>") \n
>>   "</ol>" > \n)
>
> Right.
>
>> Is that right? This does more or less the right thing, though it does in
>> some cases still insert a newline. In the text below, with point at the
>> vertical bar, the above definition still inserts another closing
>> newline:
>>
>> <div>
>>   <div>|
>>     
>>   </div>
>> </div>
>
> I don't think it adds a closing newline any more than the current
> code does: you start with point in front of 2 newlines and you end with
> 2 newlines after </ol>.

That was some sort of thinko, or temporary blindness.

>> I found this bit of the Autotype manual confusing:
>>
>> ‘?\n’
>>      Insert a newline and align under current line, but not if this is
>>      the last element of a skeleton and the newline would be inserted at
>>      end of line, or this is the first element and the newline would be
>>      inserted at beginning of line.  Use newline character ‘?\n’ to
>>      prevent alignment.  Use ‘"\n"’ as the first or last string element
>>      of a skeleton to insert a newline unconditionally.
>>
>> Here, "align" has nothing to do with "indent", right?
>
> Right.
>
>> This appears to
>> describe the behavior of ?\n as newline-and-align, but then goes on to
>> say we should use ?\n to *prevent* alignment.
>
> Indeed, \n is the magic one while ?\n just inserts the LF char
> without any extra processing (just like "\n").

Okay, I will work up the html-mode changes as a proper bug report in the
next few days, and maybe do another doc patch for this bit of the
manual.

Thanks,
Eric




  reply	other threads:[~2019-03-22 22:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 22:11 some proposed tweaks to HTML mode Eric Abrahamsen
2019-03-21 22:21 ` Andreas Schwab
2019-03-21 22:32   ` Eric Abrahamsen
2019-03-21 22:44     ` Eric Abrahamsen
2019-03-21 22:53     ` Eric Abrahamsen
2019-03-22 17:58 ` Stefan Monnier
2019-03-22 19:26   ` Eric Abrahamsen
2019-03-22 20:04     ` Stefan Monnier
2019-03-22 22:55       ` Eric Abrahamsen [this message]
2019-03-23 15:29         ` Eric Abrahamsen
2019-05-05 18:43         ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zsatt8a.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.