GNU bug report logs - #10633
Please mark invalid "; !important;" in CSS

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Sat, 28 Jan 2012 22:03:02 UTC

Severity: wishlist

Tags: wontfix

Done: Chong Yidong <cyd <at> gnu.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 10633 in the body.
You can then email your comments to 10633 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#10633; Package emacs. (Sat, 28 Jan 2012 22:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 28 Jan 2012 22:03:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>,
	Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Please mark invalid "; !important;" in CSS
Date: Sat, 28 Jan 2012 23:01:50 +0100
One of my most common mistakes when editing CSS files is that I leave
a ";" before "!important", like this:

   width: 500px; !important;

This should have been

   width: 500px !important;

Could Emacs please help me with this?;-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sat, 28 Jan 2012 23:20:01 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: monnier <at> iro.umontreal.ca, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 00:18:44 +0100
On Sat, Jan 28, 2012 at 23:01, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> One of my most common mistakes when editing CSS files is that I leave
> a ";" before "!important", like this:
>
>   width: 500px; !important;
>
> This should have been
>
>   width: 500px !important;
>
> Could Emacs please help me with this?;-)

Sure. Use hi-lock-mode, add a "; +!important" regexp as a file
pattern, set the mode in the css-mode-hook, and for added simplicity
do also

(setq hi-lock-file-patterns-policy (lambda (patterns)
                                            (if (eq major-mode 'css-mode)
                                                t
                                              (y-or-n-p "Add patterns
from this buffer to hi-lock? "))))

Look, ma, no hands.

    Juanma




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sat, 28 Jan 2012 23:27:01 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: monnier <at> iro.umontreal.ca, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 00:26:25 +0100
On Sun, Jan 29, 2012 at 00:18, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Sat, Jan 28, 2012 at 23:01, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> One of my most common mistakes when editing CSS files is that I leave
>> a ";" before "!important", like this:
>>
>>   width: 500px; !important;
>>
>> This should have been
>>
>>   width: 500px !important;
>>
>> Could Emacs please help me with this?;-)
>
> Sure. Use hi-lock-mode, add a "; +!important" regexp as a file
> pattern, set the mode in the css-mode-hook, and for added simplicity
> do also
>
> (setq hi-lock-file-patterns-policy (lambda (patterns)
>                                            (if (eq major-mode 'css-mode)
>                                                t
>                                              (y-or-n-p "Add patterns
> from this buffer to hi-lock? "))))
>
> Look, ma, no hands.

Thanks, it is a great tip until it is fixed!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sat, 28 Jan 2012 23:53:01 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: monnier <at> iro.umontreal.ca, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 00:52:25 +0100
On Sun, Jan 29, 2012 at 00:26, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:
> On Sun, Jan 29, 2012 at 00:18, Juanma Barranquero <lekktu <at> gmail.com> wrote:
>> On Sat, Jan 28, 2012 at 23:01, Lennart Borgman
>> <lennart.borgman <at> gmail.com> wrote:
>>
>>> One of my most common mistakes when editing CSS files is that I leave
>>> a ";" before "!important", like this:
>>>
>>>   width: 500px; !important;
>>>
>>> This should have been
>>>
>>>   width: 500px !important;
>>>
>>> Could Emacs please help me with this?;-)
>>
>> Sure. Use hi-lock-mode, add a "; +!important" regexp as a file
>> pattern, set the mode in the css-mode-hook, and for added simplicity
>> do also
>>
>> (setq hi-lock-file-patterns-policy (lambda (patterns)
>>                                            (if (eq major-mode 'css-mode)
>>                                                t
>>                                              (y-or-n-p "Add patterns
>> from this buffer to hi-lock? "))))
>>
>> Look, ma, no hands.
>
> Thanks, it is a great tip until it is fixed!

Though it was a bit unpractical. It would be easier to just add it to
css-mode-hook and forget hi-lock-mode. Since isearch does it without
hi-lock-mode that is doable. Anyone remember how to do it offhand? (Or
do I have to search the isearch code... ?;-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 00:12:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: monnier <at> iro.umontreal.ca, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 01:10:57 +0100
On Sun, Jan 29, 2012 at 00:52, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:
> On Sun, Jan 29, 2012 at 00:26, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>> On Sun, Jan 29, 2012 at 00:18, Juanma Barranquero <lekktu <at> gmail.com> wrote:
>>> On Sat, Jan 28, 2012 at 23:01, Lennart Borgman
>>> <lennart.borgman <at> gmail.com> wrote:
>>>
>>>> One of my most common mistakes when editing CSS files is that I leave
>>>> a ";" before "!important", like this:
>>>>
>>>>   width: 500px; !important;
>>>>
>>>> This should have been
>>>>
>>>>   width: 500px !important;
>>>>
>>>> Could Emacs please help me with this?;-)
>>>
>>> Sure. Use hi-lock-mode, add a "; +!important" regexp as a file
>>> pattern, set the mode in the css-mode-hook, and for added simplicity
>>> do also
>>>
>>> (setq hi-lock-file-patterns-policy (lambda (patterns)
>>>                                            (if (eq major-mode 'css-mode)
>>>                                                t
>>>                                              (y-or-n-p "Add patterns
>>> from this buffer to hi-lock? "))))
>>>
>>> Look, ma, no hands.
>>
>> Thanks, it is a great tip until it is fixed!
>
> Though it was a bit unpractical. It would be easier to just add it to
> css-mode-hook and forget hi-lock-mode. Since isearch does it without
> hi-lock-mode that is doable. Anyone remember how to do it offhand? (Or
> do I have to search the isearch code... ?;-)

Here is a way to do it:

- In isearch-forward-regexp do M-s-h-r to hilight the pattern.
- Then use hi-lock-write-interactive-patterns to write it down in the
buffer for the moment (so you do not have to think about it...;-)
- Now to css-mode-hook add something like this (hi-lock-face-buffer ";
+!important;" 'hi-my-face)

In my .emacs I added:

(add-hook 'css-mode-hook 'my-hilock-css-important-errors)
(defun my-hilock-css-important-errors()
  (hi-lock-face-buffer "; +!important;" 'hi-my-magenta))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 00:36:01 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 01:34:41 +0100
On Sun, Jan 29, 2012 at 01:10, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> Here is a way to do it:
>
> - In isearch-forward-regexp do M-s-h-r to hilight the pattern.
> - Then use hi-lock-write-interactive-patterns to write it down in the
> buffer for the moment (so you do not have to think about it...;-)
> - Now to css-mode-hook add something like this (hi-lock-face-buffer ";
> +!important;" 'hi-my-face)
>
> In my .emacs I added:
>
> (add-hook 'css-mode-hook 'my-hilock-css-important-errors)
> (defun my-hilock-css-important-errors()
>  (hi-lock-face-buffer "; +!important;" 'hi-my-magenta))

So you're reimplementing what the file patterns of hi-lock-mode are
already designed to do. Congratulations ;-)

    Juanma




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 01:21:01 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 02:19:50 +0100
On Sun, Jan 29, 2012 at 01:34, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Sun, Jan 29, 2012 at 01:10, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> Here is a way to do it:
>>
>> - In isearch-forward-regexp do M-s-h-r to hilight the pattern.
>> - Then use hi-lock-write-interactive-patterns to write it down in the
>> buffer for the moment (so you do not have to think about it...;-)
>> - Now to css-mode-hook add something like this (hi-lock-face-buffer ";
>> +!important;" 'hi-my-face)
>>
>> In my .emacs I added:
>>
>> (add-hook 'css-mode-hook 'my-hilock-css-important-errors)
>> (defun my-hilock-css-important-errors()
>>  (hi-lock-face-buffer "; +!important;" 'hi-my-magenta))
>
> So you're reimplementing what the file patterns of hi-lock-mode are
> already designed to do. Congratulations ;-)

Did I miss something? I can't see that I can directly add it to
css-mode-hook. Please tell me how to do it!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 01:39:03 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 02:37:52 +0100
On Sun, Jan 29, 2012 at 02:19, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> Did I miss something? I can't see that I can directly add it to
> css-mode-hook. Please tell me how to do it!

Add what? The regexp? No, it's not supported (other than how you're
doing it) but it is not required either. The file patterns method is
more flexible (you can have multiple regexps, and they don't have to
be the same for every file), and easy to set up

C-x C-f yourfile.css <RET>
M-s h r ; +!important <RET> <RET>
C-x w b
C-x C-s <RET>

which you have to repeat in each .css file, but you can copy&paste, or
use a template for new .css, and you can set up other regexps to warn
you of other common pitfalls, etc.

And in your .emacs:

(add-hook 'css-mode-hook 'hi-lock-mode)
(setq hi-lock-file-patterns-policy t)
;; or the function I described before, or the default `ask'... Your choice.

But hey, whatever works for you.

    Juanma




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 01:55:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sat, 28 Jan 2012 20:54:20 -0500
Lennart Borgman wrote:

> Thanks, it is a great tip until it is fixed!

Why should this be added to css-mode - do you have some data showing
that many people writing CSS make the same mistake as you?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 01:57:01 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 02:56:06 +0100
On Sun, Jan 29, 2012 at 02:37, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Sun, Jan 29, 2012 at 02:19, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> Did I miss something? I can't see that I can directly add it to
>> css-mode-hook. Please tell me how to do it!
>
> Add what? The regexp? No, it's not supported (other than how you're
> doing it) but it is not required either. The file patterns method is
> more flexible (you can have multiple regexps, and they don't have to
> be the same for every file), and easy to set up

I found the way I do it much easier. It essentially behaves as if it
were a part of the normal syntax highliting and that is what I wanted.

I suggest that the manual might include some information like the one I gave.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 02:02:03 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 03:00:58 +0100
On Sun, Jan 29, 2012 at 02:54, Glenn Morris <rgm <at> gnu.org> wrote:
> Lennart Borgman wrote:
>
>> Thanks, it is a great tip until it is fixed!
>
> Why should this be added to css-mode - do you have some data showing
> that many people writing CSS make the same mistake as you?

I have no idea. A lot of people are writing css files, but only a few
of them probably are using "!important" (since it is a more advanced
concept and needed mostly in special cases).

However there are a lot of things that can go wrong when you work with
things like css. The browser casch was maybe not updated, the css
parser in the browser maybe did not care about the mistake in your css
file - or it did care very much and misinterprets a lot after that.
Trying to get things to work in different browsers is a bit difficult
because of this.

So at least knowning your css file is correct makes it very much easier.

(I have previously tried to explain the difficulties with complities,
but I am not sure anyone cared or understood. That was some years ago,
though.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 02:03:01 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 03:01:19 +0100
On Sun, Jan 29, 2012 at 02:56, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> I found the way I do it much easier. It essentially behaves as if it
> were a part of the normal syntax highliting and that is what I wanted.

If you want it to be "a part of the normal syntax higlighting", use
font-lock-add-keywords in your css-mode-hook instead of using hi-lock.

    Juanma




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 02:06:01 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 03:04:59 +0100
On Sun, Jan 29, 2012 at 03:00, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> A lot of people are writing css files, but only a few
> of them probably are using "!important" (since it is a more advanced
> concept and needed mostly in special cases).

I've used quite a few times !important, and I've never written "XXX;
!important;".

    Juanma




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 02:08:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 03:07:07 +0100
On Sun, Jan 29, 2012 at 03:04, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Sun, Jan 29, 2012 at 03:00, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> A lot of people are writing css files, but only a few
>> of them probably are using "!important" (since it is a more advanced
>> concept and needed mostly in special cases).
>
> I've used quite a few times !important, and I've never written "XXX;
> !important;".

That is good, but unfortunately it does not help others.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 02:13:01 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 03:12:11 +0100
On Sun, Jan 29, 2012 at 03:07, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> That is good, but unfortunately it does not help others.

Of course. It was just a way to express that what you find a common
problem it is perhaps not so outside your event horizon.

    Juanma




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 04:08:02 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> gnu.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 12:07:09 +0800
Lennart Borgman <lennart.borgman <at> gmail.com> writes:

> However there are a lot of things that can go wrong when you work with
> things like css.

I don't think it should be the job of CSS mode to highlight ad-hoc
mistake conditions like that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Sun, 29 Jan 2012 04:14:01 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Chong Yidong <cyd <at> gnu.org>
Cc: Glenn Morris <rgm <at> gnu.org>, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 05:12:38 +0100
On Sun, Jan 29, 2012 at 05:07, Chong Yidong <cyd <at> gnu.org> wrote:
> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>
>> However there are a lot of things that can go wrong when you work with
>> things like css.
>
> I don't think it should be the job of CSS mode to highlight ad-hoc
> mistake conditions like that.

Please make a non-syntax marking a standard in all modes. ;-)




Added tag(s) wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 30 Jan 2012 01:18:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Mon, 30 Jan 2012 04:32:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Chong Yidong <cyd <at> gnu.org>
Cc: Lennart Borgman <lennart.borgman <at> gmail.com>, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Sun, 29 Jan 2012 23:31:31 -0500
>> However there are a lot of things that can go wrong when you work with
>> things like css.
> I don't think it should be the job of CSS mode to highlight ad-hoc
> mistake conditions like that.

There's cwarn-mode for something similar, so the question really is
whether this error is common or specific to a particular user.
I have no idea which it is.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Mon, 30 Jan 2012 04:45:02 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Chong Yidong <cyd <at> gnu.org>, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Mon, 30 Jan 2012 05:44:24 +0100
On Mon, Jan 30, 2012 at 05:31, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
>
> >> However there are a lot of things that can go wrong when you work with
> >> things like css.
> > I don't think it should be the job of CSS mode to highlight ad-hoc
> > mistake conditions like that.
>
> There's cwarn-mode for something similar, so the question really is
> whether this error is common or specific to a particular user.
> I have no idea which it is.

The "!important" is colored as it is now even when I happen to put it
after the ";". Not syntax coloring that would be enough to easily
detect the problem.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Tue, 31 Jan 2012 01:49:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Chong Yidong <cyd <at> gnu.org>, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Mon, 30 Jan 2012 20:48:22 -0500
>> >> However there are a lot of things that can go wrong when you work with
>> >> things like css.
>> > I don't think it should be the job of CSS mode to highlight ad-hoc
>> > mistake conditions like that.
>> There's cwarn-mode for something similar, so the question really is
>> whether this error is common or specific to a particular user.
>> I have no idea which it is.
> The "!important" is colored as it is now even when I happen to put it
> after the ";". Not syntax coloring that would be enough to easily
> detect the problem.

That would be perfect, yes.  Patch welcome,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10633; Package emacs. (Tue, 31 Jan 2012 02:37:01 GMT) Full text and rfc822 format available.

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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Chong Yidong <cyd <at> gnu.org>, 10633 <at> debbugs.gnu.org
Subject: Re: bug#10633: Please mark invalid "; !important;" in CSS
Date: Tue, 31 Jan 2012 03:36:11 +0100
[Message part 1 (text/plain, inline)]
On Tue, Jan 31, 2012 at 02:48, Stefan Monnier <monnier <at> iro.umontreal.ca>wrote:

> >> >> However there are a lot of things that can go wrong when you work
> with
> >> >> things like css.
> >> > I don't think it should be the job of CSS mode to highlight ad-hoc
> >> > mistake conditions like that.
> >> There's cwarn-mode for something similar, so the question really is
> >> whether this error is common or specific to a particular user.
> >> I have no idea which it is.
> > The "!important" is colored as it is now even when I happen to put it
> > after the ";". Not syntax coloring that would be enough to easily
> > detect the problem.
>
> That would be perfect, yes.  Patch welcome,
>
> I think this is enough:

    ;;("!\\s-*important" . font-lock-builtin-face)
    ("[^; \t\n]\\s-*\\(!\\s-*important\\)"
     (1 'font-lock-builtin-face))
[Message part 2 (text/html, inline)]

bug closed, send any further explanations to 10633 <at> debbugs.gnu.org and Lennart Borgman <lennart.borgman <at> gmail.com> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 08 Dec 2012 03:00:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 05 Jan 2013 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 224 days ago.

Previous Next


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