From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.bugs 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 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf303ea90ac6cc7804e82165be X-Trace: ger.gmane.org 1381130116 1805 80.91.229.3 (7 Oct 2013 07:15:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Oct 2013 07:15:16 +0000 (UTC) Cc: 15467-done@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 07 09:15:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VT52C-0003iJ-JJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2013 09:15:16 +0200 Original-Received: from localhost ([::1]:57703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT52C-0003Ih-3s for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2013 03:15:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT524-0003HA-L8 for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2013 03:15:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VT51z-0001Mp-RA for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2013 03:15:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT51z-0001ME-ML for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2013 03:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VT51y-0006ym-3c for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2013 03:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Oct 2013 07:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15467 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15467-done@debbugs.gnu.org id=D15467.138113005126757 (code D ref 15467); Mon, 07 Oct 2013 07:15:01 +0000 Original-Received: (at 15467-done) by debbugs.gnu.org; 7 Oct 2013 07:14:11 +0000 Original-Received: from localhost ([127.0.0.1]:59152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VT518-0006xU-75 for submit@debbugs.gnu.org; Mon, 07 Oct 2013 03:14:10 -0400 Original-Received: from mail-ie0-f173.google.com ([209.85.223.173]:39291) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VT514-0006xJ-Mp for 15467-done@debbugs.gnu.org; Mon, 07 Oct 2013 03:14:07 -0400 Original-Received: by mail-ie0-f173.google.com with SMTP id ar20so15096927iec.32 for <15467-done@debbugs.gnu.org>; Mon, 07 Oct 2013 00:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zXmZxI4SMeDKTfs2hC3wkElaqy8JELjJF8JtJTLozwk=; b=EzfkZkYRVedME4iSt/9ccAMS0o5a6ltbhcHHhZWzNVN82+eVeuZ1lYnqWO5KL32d2N QFCKhRDk67TXy+xSt3uRNj25YgAGdWrS5yC375r5KUdVOr3vzcgXw7uwHoYvuIhahWHD IIU2EMU8+6v9iXLZaD+SaIx1tkaEL/5n8VvqdD+/mYhJaVm/dZgwUj7sgjSBLGP0e5X5 K7MVeD1o/W+sJDcNebljCEkacqU85nRoocbT0GM4Wn5r4r+Bj8E7xEfUkx4EoukTf1oB qDKjkhPiF3AMIRUFwESyVZG9Y1TNYE9p9Qa7I4wK9C8q1DrjVlSfu5EZsYEvGy7aa6qF 2ygg== X-Received: by 10.42.208.211 with SMTP id gd19mr16653718icb.15.1381130045930; Mon, 07 Oct 2013 00:14:05 -0700 (PDT) Original-Received: by 10.42.240.66 with HTTP; Mon, 7 Oct 2013 00:14:05 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78978 Archived-At: --20cf303ea90ac6cc7804e82165be Content-Type: text/plain; charset=UTF-8 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 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))))) > > > --20cf303ea90ac6cc7804e82165be Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This fixes the problem I originally reported, bu= t there seem to be more:

.x1
{
}

.x2
=C2=A0{
=C2= =A0}

div.x3
=C2=A0=C2=A0 {
=C2=A0=C2=A0 }

As you = see only the first rule is indented properly.

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

Paul
--20cf303ea90ac6cc7804e82165be--