GNU bug report logs - #50345
28.0.50; [PATCH] Filling holes in css-mode.el

Previous Next

Package: emacs;

Reported by: Theodor Thornhill <theo <at> thornhill.no>

Date: Thu, 2 Sep 2021 18:47:01 UTC

Severity: normal

Tags: patch

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50345 in the body.
You can then email your comments to 50345 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#50345; Package emacs. (Thu, 02 Sep 2021 18:47:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Theodor Thornhill <theo <at> thornhill.no>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 02 Sep 2021 18:47:01 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; [PATCH] Filling holes in css-mode.el
Date: Thu, 02 Sep 2021 20:46:12 +0200
[Message part 1 (text/plain, inline)]
Hello!

In $DAYJOB, right now we are working on a larger redesign of our
customer facing web app.  As such I'm knee deep in css these days.  I've
noticed there are some holes in the completion keywords, and I'd like to
start addressing those.  Hence the first, simple starting-point patch.
Before I continue adding patches, I'd like some pointers as to how I
should structure them.  For example - lots of keywords are now shared
between grid and flex. An example is `align-content', which is now
under a section devoted to flex.  However, there are some newer,
grid-related completion keywords that are not in this section, nor
anywhere else.  See line 306 in css-mode.el. I guess the solution here
is to add `start' and `end' there, but I want to check first.

Should I add several, smaller patches, or one big correction of most of
the things I see at the moment?  

Best,
Theodor Thornhill


[0001-Add-selection-to-css-pseudo-element-ids.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50345; Package emacs. (Thu, 02 Sep 2021 21:23:01 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: 50345 <at> debbugs.gnu.org
Subject: 28.0.50; [PATCH] Filling holes in css-mode.el
Date: Thu, 02 Sep 2021 23:22:17 +0200
[Message part 1 (text/plain, inline)]
Hi again!

I took the liberty to add the keywords from [0].

I moved the justify and align parts out from the flex block and into its
own block.  I also took the liberty to add the `place' variants as well.
These are used a lot when using grid to set up your web page.  I hope
this is usable.  I see that some properties are extracted out into
variables, but not sure what is standard practice here.

Good evening,
Theodor


[0]: https://www.w3.org/TR/css-align-3

[0001-Add-CSS-Box-Alignment-Module-Level-3-to-css-mode.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50345; Package emacs. (Fri, 03 Sep 2021 06:16:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 50345 <at> debbugs.gnu.org
Subject: Re: bug#50345: 28.0.50; [PATCH] Filling holes in css-mode.el
Date: Fri, 03 Sep 2021 08:15:46 +0200
Theodor Thornhill <theo <at> thornhill.no> writes:

> Should I add several, smaller patches, or one big correction of most of
> the things I see at the moment?  

Smaller patches are best, I think.

Theodor Thornhill <theo <at> thornhill.no> writes:

> I moved the justify and align parts out from the flex block and into its
> own block.  I also took the liberty to add the `place' variants as well.
> These are used a lot when using grid to set up your web page.  I hope
> this is usable.  I see that some properties are extracted out into
> variables, but not sure what is standard practice here.

Both patches look good to me; pushed to Emacs 28 now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 50345 <at> debbugs.gnu.org and Theodor Thornhill <theo <at> thornhill.no> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 03 Sep 2021 06:17:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50345; Package emacs. (Fri, 03 Sep 2021 07:48:02 GMT) Full text and rfc822 format available.

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

From: Simen Heggestøyl <simenheg <at> runbox.com>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 50345 <at> debbugs.gnu.org
Subject: Re: bug#50345: 28.0.50; [PATCH] Filling holes in css-mode.el
Date: Fri, 03 Sep 2021 09:46:52 +0200
Hi Theodor,

Theodor Thornhill <theo <at> thornhill.no> <bug-gnu-emacs <at> gnu.org> writes:

> I took the liberty to add the keywords from [0].

Thanks!

> I see that some properties are extracted out into variables, but not
> sure what is standard practice here.

I've previously tried keeping them one-to-one with the property index
grammars (https://www.w3.org/TR/css-align-3/#property-index).

So for instance `place-content` would just refer back to `align-content`
and `justify-content` without the need to repeat their properties:

  ("place-content" align-content justify-content)

`align-content` is a bit more convoluted, with a mix of a literal value
and value classes in the grammar:

  ("align-content" "normal" baseline-position content-distribution
   overflow-position content-position)

The value classes aren't properties, so their values go into
`css-value-class-alist`. For instance, `baseline-position` can take
values:

  (baseline-position "first" "last" "baseline")

This can then be reused by other properties again.

Does this make sense? I should probably document this practice a bit
better. 😅

-- Simen




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50345; Package emacs. (Fri, 03 Sep 2021 09:09:02 GMT) Full text and rfc822 format available.

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

From: Theodor Thornhill <theo <at> thornhill.no>
To: Simen Heggestøyl <simenheg <at> runbox.com>
Cc: 50345 <at> debbugs.gnu.org
Subject: Re: bug#50345: 28.0.50; [PATCH] Filling holes in css-mode.el
Date: Fri, 03 Sep 2021 11:08:02 +0200
Hi, Simen!

>
> Thanks!

My pleasure!

>
>> I see that some properties are extracted out into variables, but not
>> sure what is standard practice here.
>
> I've previously tried keeping them one-to-one with the property index
> grammars (https://www.w3.org/TR/css-align-3/#property-index).
>
> So for instance `place-content` would just refer back to `align-content`
> and `justify-content` without the need to repeat their properties:
>
>   ("place-content" align-content justify-content)
>
> `align-content` is a bit more convoluted, with a mix of a literal value
> and value classes in the grammar:
>
>   ("align-content" "normal" baseline-position content-distribution
>    overflow-position content-position)
>
> The value classes aren't properties, so their values go into
> `css-value-class-alist`. For instance, `baseline-position` can take
> values:
>
>   (baseline-position "first" "last" "baseline")
>
> This can then be reused by other properties again.
>
> Does this make sense? I should probably document this practice a bit
> better. 😅
>

Yeah, this is the answer I wanted. I'll look into doing this in the next
patches I send.  I think it would be nice to document this down the line
as well, yes.  I can see what I can do about that too :)

Have a nice weekend!

Theodor







bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Oct 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 200 days ago.

Previous Next


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