all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21328: 25.0.50; css-mode: Indenting brackets in presence of pseudo-selectors
@ 2015-08-23 10:57 Simen Heggestøyl
  2015-08-25 13:06 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Simen Heggestøyl @ 2015-08-23 10:57 UTC (permalink / raw)
  To: 21328

[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]

The current indentation rules in css-mode work well both for a style
where opening brackets are put at the the same line of selectors, like
so: "body { …", and when they are put on their own line, like in the
following example:

body
{
    background: white;

    main
    {
        background: green;
    }
}

However in the presence of a pseudo-class or pseudo-element, the
opening bracket that follows runs amok:

body
{
    background: white;

    main:first
             {
                 background: green;
             }
}

This should be fixed to accommodate both styles. It seems to me that
removing the `smie-rule-hanging-p' test from the following rule fixes
the problem:

(`(:before . "{")
 (when (smie-rule-hanging-p)
   (smie-backward-sexp ";")
   (smie-indent-virtual)))

However I haven't been able to fully understand how SMIE works yet, so
I'm not sure what that check was meant for in the first place, or
whether it breaks some other cases (though I haven't been able to find
such a case).

-- Simen


In GNU Emacs 25.0.50.15 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
 of 2015-08-23 on x240
Repository revision: 7372c1ab067ba93054fbb042cd13211042b83614
Windowing system distributor `The X.Org Foundation', version 
11.0.11702000
System Description:	Debian GNU/Linux testing (stretch)

Configured features:
XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS NOTIFY LIBXML2 FREETYPE XFT
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: CSS

[-- Attachment #2: Type: text/html, Size: 2492 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-28 18:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-23 10:57 bug#21328: 25.0.50; css-mode: Indenting brackets in presence of pseudo-selectors Simen Heggestøyl
2015-08-25 13:06 ` Stefan Monnier
2015-08-26 20:55   ` Simen Heggestøyl
2015-08-28  1:36     ` Stefan Monnier
2015-08-28 18:14       ` Simen Heggestøyl

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.