unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Pogonyshev <pogonyshev@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15467-done@debbugs.gnu.org
Subject: bug#15467: CSS-mode gives weird indentation when you put opening bracket on its own line
Date: Mon, 7 Oct 2013 09:14:05 +0200	[thread overview]
Message-ID: <CAG7Bpardo-v-tuYOC_VvdTdsrDLvqB+bTSbES3QqgYqTvyyf7w@mail.gmail.com> (raw)
In-Reply-To: <jwv8uy8d84p.fsf-monnier+emacsbugs@gnu.org>

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

This fixes the problem I originally reported, but there seem to be more:

.x1
{
}

.x2
 {
 }

div.x3
   {
   }

As you see only the first rule is indented properly.

As a feature request, it would be nice if '}' triggered auto-indent on
insertion, as in e.g. various programming modes.

Paul


On 4 October 2013 23:46, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> > For example, if you create a CSS buffer and put
> > .xxx
> > {
> > }
> > into it, indentation adds one space before '{'. Confusingly, if you add
> one
>
> Indeed, thanks.  Should be fixed now in the trunk thanks to the
> patch below.
>
>
>         Stefan
>
>
> --- lisp/textmodes/css-mode.el  2013-08-29 21:00:18 +0000
> +++ lisp/textmodes/css-mode.el  2013-10-04 21:40:55 +0000
> @@ -302,6 +302,7 @@
>    (pcase (cons kind token)
>      (`(:elem . basic) css-indent-offset)
>      (`(:elem . arg) 0)
> +    (`(:list-intro . "") t)             ;"" stands for BOB (bug#15467).
>      (`(:before . "{") (if (smie-rule-hanging-p)
>                           (smie-rule-parent 0)))))
>
>
>

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

  reply	other threads:[~2013-10-07  7:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 14:23 bug#15467: CSS-mode gives weird indentation when you put opening bracket on its own line Paul Pogonyshev
2013-10-04 21:46 ` Stefan Monnier
2013-10-07  7:14   ` Paul Pogonyshev [this message]
2013-10-07 15:41     ` Stefan Monnier
2013-10-08  7:04       ` Paul Pogonyshev

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAG7Bpardo-v-tuYOC_VvdTdsrDLvqB+bTSbES3QqgYqTvyyf7w@mail.gmail.com \
    --to=pogonyshev@gmail.com \
    --cc=15467-done@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).