From unknown Tue Jun 17 23:59:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15467 <15467@debbugs.gnu.org> To: bug#15467 <15467@debbugs.gnu.org> Subject: Status: CSS-mode gives weird indentation when you put opening bracket on its own line Reply-To: bug#15467 <15467@debbugs.gnu.org> Date: Wed, 18 Jun 2025 06:59:30 +0000 retitle 15467 CSS-mode gives weird indentation when you put opening bracket= on its own line reassign 15467 emacs submitter 15467 Paul Pogonyshev severity 15467 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 26 10:23:52 2013 Received: (at submit) by debbugs.gnu.org; 26 Sep 2013 14:23:52 +0000 Received: from localhost ([127.0.0.1]:37998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VPCTv-0008Tx-HC for submit@debbugs.gnu.org; Thu, 26 Sep 2013 10:23:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52496) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VPCTt-0008Tn-2G for submit@debbugs.gnu.org; Thu, 26 Sep 2013 10:23:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPCTr-0002om-RB for submit@debbugs.gnu.org; Thu, 26 Sep 2013 10:23:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPCTr-0002oi-Mj for submit@debbugs.gnu.org; Thu, 26 Sep 2013 10:23:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPCTq-000306-99 for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2013 10:23:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPCTn-0002mj-6X for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2013 10:23:46 -0400 Received: from mail-oa0-x233.google.com ([2607:f8b0:4003:c02::233]:62492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPCTn-0002mb-1F for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2013 10:23:43 -0400 Received: by mail-oa0-f51.google.com with SMTP id h16so756210oag.10 for ; Thu, 26 Sep 2013 07:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=+F9k5CV3GV2LZTnH9WGQMYh3EZLGruRlDwU4Ab0AtAU=; b=Mzld02N+fx1RmasB+fLr1nr7WP+hZy4ZfGcIGq7rW3TTxLgUNizJfT0hs1lPT/F9nq 1n7L8QjVjNazdMucX+nn8n4iW9ooe4W3+NNGIcbT1gVx/EC45VUTkrXeuZGkRAZ1K40T 8DGXbDGqKWUwRN16/4r9vCAeFXurQQrH75c2TlCFjZoaCIswYRYo0xLTOnrWDfj8SZuo jBWtNEjEYObSJLerKNw18yEUEnUV+Xc8vD9PzdwSqktbr4ol0T9g2jJ3Tmn2R5wepbBP JsciCKEj71620FdqAw0b/uLQbqYhYejCKcTgxRb+59bLnIO/eciRce6tpouN7arJg/27 o4aw== MIME-Version: 1.0 X-Received: by 10.182.242.37 with SMTP id wn5mr994053obc.56.1380205422164; Thu, 26 Sep 2013 07:23:42 -0700 (PDT) Received: by 10.182.200.163 with HTTP; Thu, 26 Sep 2013 07:23:42 -0700 (PDT) Date: Thu, 26 Sep 2013 16:23:42 +0200 Message-ID: Subject: CSS-mode gives weird indentation when you put opening bracket on its own line From: Paul Pogonyshev To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=e89a8ff1cd66e7bec504e74a1d3f X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --e89a8ff1cd66e7bec504e74a1d3f Content-Type: text/plain; charset=UTF-8 For example, if you create a CSS buffer and put .xxx { } into it, indentation adds one space before '{'. Confusingly, if you add one or more empty line at the start (i.e. before this only rule), indentation is back to normal, with '{' in the column 0. However, this seems to apply only to the very first rule, all others are always broken. Paul --e89a8ff1cd66e7bec504e74a1d3f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
For example, if you create a CSS buffer and= put

.xxx
{
}

into it, indentation adds one= space before '{'. Confusingly, if you add one or more empty line a= t the start (i.e. before this only rule), indentation is back to normal, wi= th '{' in the column 0. However, this seems to apply only to the ve= ry first rule, all others are always broken.

Paul


--e89a8ff1cd66e7bec504e74a1d3f-- From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 04 17:46:21 2013 Received: (at 15467-done) by debbugs.gnu.org; 4 Oct 2013 21:46:21 +0000 Received: from localhost ([127.0.0.1]:54695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VSDCV-0004tO-Ss for submit@debbugs.gnu.org; Fri, 04 Oct 2013 17:46:20 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:46088) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VSDCT-0004tE-BD for 15467-done@debbugs.gnu.org; Fri, 04 Oct 2013 17:46:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFpY4U/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFFFpY4U/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="34790896" Received: from 69-165-142-20.dsl.teksavvy.com (HELO pastel.home) ([69.165.142.20]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Oct 2013 17:42:48 -0400 Received: by pastel.home (Postfix, from userid 20848) id 870E8604C8; Fri, 4 Oct 2013 17:46:15 -0400 (EDT) From: Stefan Monnier To: Paul Pogonyshev Subject: Re: bug#15467: CSS-mode gives weird indentation when you put opening bracket on its own line Message-ID: References: Date: Fri, 04 Oct 2013 17:46:15 -0400 In-Reply-To: (Paul Pogonyshev's message of "Thu, 26 Sep 2013 16:23:42 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15467-done Cc: 15467-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > 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))))) From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 07 03:14:11 2013 Received: (at 15467-done) by debbugs.gnu.org; 7 Oct 2013 07:14:11 +0000 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 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 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== MIME-Version: 1.0 X-Received: by 10.42.208.211 with SMTP id gd19mr16653718icb.15.1381130045930; Mon, 07 Oct 2013 00:14:05 -0700 (PDT) Received: by 10.42.240.66 with HTTP; Mon, 7 Oct 2013 00:14:05 -0700 (PDT) In-Reply-To: References: Date: Mon, 7 Oct 2013 09:14:05 +0200 Message-ID: Subject: Re: bug#15467: CSS-mode gives weird indentation when you put opening bracket on its own line From: Paul Pogonyshev To: Stefan Monnier Content-Type: multipart/alternative; boundary=20cf303ea90ac6cc7804e82165be X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15467-done Cc: 15467-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --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-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 07 11:41:32 2013 Received: (at 15467-done) by debbugs.gnu.org; 7 Oct 2013 15:41:32 +0000 Received: from localhost ([127.0.0.1]:60517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTCw8-0003M7-9m for submit@debbugs.gnu.org; Mon, 07 Oct 2013 11:41:32 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:14045) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTCw6-0003Ly-J0 for 15467-done@debbugs.gnu.org; Mon, 07 Oct 2013 11:41:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+K8t/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av4EABK/CFHO+K8t/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="34933229" Received: from 206-248-175-45.dsl.teksavvy.com (HELO pastel.home) ([206.248.175.45]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 07 Oct 2013 11:37:52 -0400 Received: by pastel.home (Postfix, from userid 20848) id 7192060C2E; Mon, 7 Oct 2013 11:41:29 -0400 (EDT) From: Stefan Monnier To: Paul Pogonyshev Subject: Re: bug#15467: CSS-mode gives weird indentation when you put opening bracket on its own line Message-ID: References: Date: Mon, 07 Oct 2013 11:41:29 -0400 In-Reply-To: (Paul Pogonyshev's message of "Mon, 7 Oct 2013 09:14:05 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15467-done Cc: 15467-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > This fixes the problem I originally reported, but there seem to be more: > .x1 > { > } > .x2 > { > } > div.x3 > { > } Thanks. Should be fixed now. > As a feature request, it would be nice if '}' triggered auto-indent on > insertion, as in e.g. various programming modes. Now electric-indent-mode obeys css-electric-keys. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 08 03:04:18 2013 Received: (at 15467-done) by debbugs.gnu.org; 8 Oct 2013 07:04:18 +0000 Received: from localhost ([127.0.0.1]:33787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTRL6-0003A9-1Y for submit@debbugs.gnu.org; Tue, 08 Oct 2013 03:04:17 -0400 Received: from mail-ie0-f171.google.com ([209.85.223.171]:41080) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTRL3-0003A0-NJ for 15467-done@debbugs.gnu.org; Tue, 08 Oct 2013 03:04:14 -0400 Received: by mail-ie0-f171.google.com with SMTP id at1so18573831iec.16 for <15467-done@debbugs.gnu.org>; Tue, 08 Oct 2013 00:04:13 -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=j2okLViUr6ojziEgz6Dn8sA/2/j/myvYYfH2AyyfHwk=; b=wDTNJT6G1LUkkGMJto4PWLrKki/Szwmo2GX514djlP6mvUsz/HVqOE/5BGVNvqZQbo ZuZRYru/YNGaap1MBzFz5By/HuxbKyZnvHWYDM5h9TPhxRsyJJzd4NQe/fsOyYMtJfFY 09Ci5RgA3ZbpAKdnC5qDfLLdLWu/g2CFUeHCHFMPJwkhkRsCF5k5eqX1VQf8koFwVync bHSPs/Va1a5X+SZol3dmGQ53oF7Vx6lg5tPMZd6FdzXMHNx1CNYQ2h2wlCp8/OFwgtwc M8aqda2Ikf4X23fCiYsnywgidaweKtbF/zTXoILetkiweqv1IcfwgvL5JQY2PayolH7J eQwQ== MIME-Version: 1.0 X-Received: by 10.43.157.71 with SMTP id lp7mr91738icc.117.1381215853028; Tue, 08 Oct 2013 00:04:13 -0700 (PDT) Received: by 10.42.240.66 with HTTP; Tue, 8 Oct 2013 00:04:12 -0700 (PDT) In-Reply-To: References: Date: Tue, 8 Oct 2013 09:04:12 +0200 Message-ID: Subject: Re: bug#15467: CSS-mode gives weird indentation when you put opening bracket on its own line From: Paul Pogonyshev To: Stefan Monnier Content-Type: multipart/alternative; boundary=001a11c2fed6472e8104e8356018 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15467-done Cc: 15467-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c2fed6472e8104e8356018 Content-Type: text/plain; charset=UTF-8 Thank you, now everything works fine. Paul On 7 October 2013 17:41, Stefan Monnier wrote: > > This fixes the problem I originally reported, but there seem to be more: > > .x1 > > { > > } > > > .x2 > > { > > } > > > div.x3 > > { > > } > > Thanks. Should be fixed now. > > > As a feature request, it would be nice if '}' triggered auto-indent on > > insertion, as in e.g. various programming modes. > > Now electric-indent-mode obeys css-electric-keys. > > > Stefan > --001a11c2fed6472e8104e8356018 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you, now everything works fine.

Pa= ul
--001a11c2fed6472e8104e8356018-- From unknown Tue Jun 17 23:59:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 05 Nov 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator