From unknown Tue Jun 24 20:54:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19815: 25.0.50; [PATCH] css-mode: function call indentation Resent-From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Feb 2015 12:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 19815@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.142339800512324 (code B ref -1); Sun, 08 Feb 2015 12:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Feb 2015 12:20:05 +0000 Received: from localhost ([127.0.0.1]:37178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKQqJ-0003Cd-Ba for submit@debbugs.gnu.org; Sun, 08 Feb 2015 07:20:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35993) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKQqF-0003C5-SO for submit@debbugs.gnu.org; Sun, 08 Feb 2015 07:20:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKQq9-0007Ol-4j for submit@debbugs.gnu.org; Sun, 08 Feb 2015 07:19:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKQq9-0007Og-0O for submit@debbugs.gnu.org; Sun, 08 Feb 2015 07:19:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKQq7-0005Nl-Bf for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 07:19:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKQq4-0007KU-4c for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 07:19:51 -0500 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:36184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKQq3-0007KJ-PP for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 07:19:48 -0500 Received: by mail-lb0-f180.google.com with SMTP id z12so4126345lbi.11 for ; Sun, 08 Feb 2015 04:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:message-id:mime-version:content-type; bh=1Y4sk1X5xOC7FLI7n+Li4Y3xAZC5VoIikZWAyO+7P68=; b=PnbVnw2n0LKGEnAcjMcIkVo8bMps1KOLY6ySjbwUBz/hK8TL9quJTH+yt5sf0djsj3 0jpxPRcc25FsTCQudYqqY5hCE5xzml5MjQKvS6fstL6P/hQm2T9BXz5ayr2IJzMFb1A9 w7T4PW6R/vuU1MNRMfPrlV86KTQ+9p/aftNu7Xh9Vyy6EnnyDInb0iyZ91PFLB4d0RMD +toeHSdrKxpTOCycx0mz4nWMhezJTpUOMPNI7O/zhewLQkJNpiGqd/Hos+3hjyGfkqxS D6PJzYjCYhlZXtOql2TDaODPXzRbhNbHoBIrx6FKpGxODvV6l4GmTZwtayJ3Lyggw3ye 4iIg== X-Received: by 10.112.44.171 with SMTP id f11mr11608877lbm.65.1423397986763; Sun, 08 Feb 2015 04:19:46 -0800 (PST) Received: from [192.168.1.114] (cm-84.215.48.98.getinternet.no. [84.215.48.98]) by mx.google.com with ESMTPSA id rm3sm1445115lbb.47.2015.02.08.04.19.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Feb 2015 04:19:46 -0800 (PST) Date: Sun, 08 Feb 2015 13:19:44 +0100 From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Message-Id: <1423397984.7427.0@smtp.gmail.com> X-Mailer: geary/0.8.2 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-vapKFm8WH3QM2+yHAcyg" 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-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 (----) --=-vapKFm8WH3QM2+yHAcyg Content-Type: text/plain; charset=utf-8; format=flowed Sometimes it is convenient to break CSS function calls up in multiple lines. The current CSS indentation engine does not handle this well when the parameters don't begin at the same line as the opening paren. For instance: div { background: linear-gradient( to right, red, orange, yellow, green, blue, indigo, violet ); } div { background: linear-gradient( 135deg, red, blue ); } I would instead expect the following indentation: div { background: linear-gradient( to right, red, orange, yellow, green, blue, indigo, violet ); } div { background: linear-gradient( 135deg, red, blue ); } The following patch accomplishes this: diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index f6a3ca6..ab911ce 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -331,8 +331,9 @@ (`(:elem . basic) css-indent-offset) (`(:elem . arg) 0) (`(:list-intro . ,(or `";" `"")) t) ;"" stands for BOB (bug#15467). - (`(:before . "{") (if (smie-rule-hanging-p) - (smie-rule-parent 0))))) + (`(:before . ,(or "{" "(")) + (if (smie-rule-hanging-p) + (smie-rule-parent 0))))) ;;;###autoload (define-derived-mode css-mode fundamental-mode "CSS" In GNU Emacs 25.0.50.11 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5) of 2015-02-08 on x240 Repository revision: dcec731abfc110f719f0890fd0769e099393af7d Windowing system distributor `The X.Org Foundation', version 11.0.11602901 System Description: Debian GNU/Linux 8.0 (jessie) Configured using: `configure --without-makeinfo' Configured features: XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS NOTIFY LIBXML2 FREETYPE XFT ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message dired format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils time-date tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 74953 5948) (symbols 48 17996 0) (miscs 40 43 124) (strings 32 10952 5168) (string-bytes 1 296625) (vectors 16 9370) (vector-slots 8 386714 15587) (floats 8 70 63) (intervals 56 175 9) (buffers 976 11) (heap 1024 23572 1045)) --=-vapKFm8WH3QM2+yHAcyg Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Sometimes it is convenient to break CSS function calls up in multiple<= /div>
lines. The current CSS indentation engine does not handle this we= ll
when the parameters don't begin at the same line as the openin= g
paren. For instance:

div {
&= nbsp;   background: linear-gradient(
      &n= bsp;                 to right, red,= orange, yellow,
             =           green, blue, indigo, violet
&= nbsp;                   );
}

div {
    background:= linear-gradient(
             = ;           135deg,
     =                   red,
<= div>                    &= nbsp;   blue
             = ;       );
}

I would inst= ead expect the following indentation:

div {
<= div>    background: linear-gradient(
    &nbs= p;   to right, red, orange, yellow,
      &nb= sp; green, blue, indigo, violet
    );
}

div {
    background: linear-gradi= ent(
        135deg,
    =     red,
        blue
&nb= sp;   );
}

The following patch acco= mplishes this:

diff --git a/lisp/textmodes/css-mod= e.el b/lisp/textmodes/css-mode.el
index f6a3ca6..ab911ce 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/cs= s-mode.el
@@ -331,8 +331,9 @@
     (`(:e= lem . basic) css-indent-offset)
     (`(:elem . ar= g) 0)
     (`(:list-intro . ,(or `";" `"")) t) ;""= stands for BOB (bug#15467).
-    (`(:before . "{") (if= (smie-rule-hanging-p)
-            = ;             (smie-rule-parent 0)))))
<= div>+    (`(:before . ,(or "{" "("))
+     (i= f (smie-rule-hanging-p)
+         (smie-rule-= parent 0)))))
 
 ;;;###autoload
&nb= sp;(define-derived-mode css-mode fundamental-mode "CSS"


In GNU Emacs 25.0.50.11 (x86_64-unknown-linux-gnu, GTK= + Version 3.14.5)
 of 2015-02-08 on x240
Repositor= y revision: dcec731abfc110f719f0890fd0769e099393af7d
Windowing sy= stem distributor `The X.Org Foundation', version 11.0.11602901
Sy= stem Description: = Debian GNU/Linux 8.0 (jessie)

Configured us= ing:
 `configure --without-makeinfo'

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

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

Major mode: Lisp= Interaction

Minor modes in effect:
&nbs= p; tooltip-mode: t
  global-eldoc-mode: t
  e= lectric-indent-mode: t
  mouse-wheel-mode: t
 = ; tool-bar-mode: t
  menu-bar-mode: t
  file-= name-shadow-mode: t
  global-font-lock-mode: t
&nb= sp; font-lock-mode: t
  blink-cursor-mode: t
 = ; auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent messages:
For information about GNU = Emacs and the GNU system, type C-h C-a.

Load-path = shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
<= div>rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mail-utils time-date tooltip=
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwhe= el x-win
x-dnd tool-bar dnd fontset image regexp-opt fringe tabul= ated-list
newcomment elisp-mode lisp-mode prog-mode register page= menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font= -lock syntax
facemenu font-core frame cham georgian utf-8-lang mi= sc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebr= ew greek romanian slovak
czech european ethiopic indian cyrillic = chinese case-table epa-hook
jka-cmpr-hook help simple abbrev mini= buffer cl-preloaded nadvice
loaddefs button faces cus-face macroe= xp files text-properties overlay
sha1 md5 base64 format env code-= pages mule custom widget
hashtable-print-readable backquote make-= network-process dbusbind
gfilenotify dynamic-setting system-font-= setting font-render-setting
move-toolbar gtk x-toolkit x multi-tt= y emacs)

Memory information:
((conses 16= 74953 5948)
 (symbols 48 17996 0)
 (miscs 40= 43 124)
 (strings 32 10952 5168)
 (string-by= tes 1 296625)
 (vectors 16 9370)
 (vector-slo= ts 8 386714 15587)
 (floats 8 70 63)
 (interv= als 56 175 9)
 (buffers 976 11)
 (heap 1024 2= 3572 1045))
= --=-vapKFm8WH3QM2+yHAcyg-- From unknown Tue Jun 24 20:54:18 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Subject: bug#19815: closed (Re: bug#19815: 25.0.50; [PATCH] css-mode: function call indentation) Message-ID: References: <1423397984.7427.0@smtp.gmail.com> X-Gnu-PR-Message: they-closed 19815 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 19815@debbugs.gnu.org Date: Mon, 09 Feb 2015 17:28:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1423502882-5398-1" This is a multi-part message in MIME format... ------------=_1423502882-5398-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #19815: 25.0.50; [PATCH] css-mode: function call indentation which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 19815@debbugs.gnu.org. --=20 19815: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19815 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1423502882-5398-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 19815-done) by debbugs.gnu.org; 9 Feb 2015 17:27:51 +0000 Received: from localhost ([127.0.0.1]:38502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKs7i-0001Of-Pf for submit@debbugs.gnu.org; Mon, 09 Feb 2015 12:27:50 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:54732) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKs7g-0001OX-Gr for 19815-done@debbugs.gnu.org; Mon, 09 Feb 2015 12:27:49 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t19HRjTA010711; Mon, 9 Feb 2015 12:27:46 -0500 Received: by pastel.home (Postfix, from userid 20848) id 6267A1240; Mon, 9 Feb 2015 12:27:45 -0500 (EST) From: Stefan Monnier To: Simen =?windows-1252?Q?Heggest=F8yl?= Subject: Re: bug#19815: 25.0.50; [PATCH] css-mode: function call indentation Message-ID: References: <1423397984.7427.0@smtp.gmail.com> Date: Mon, 09 Feb 2015 12:27:45 -0500 In-Reply-To: <1423397984.7427.0@smtp.gmail.com> ("Simen =?windows-1252?Q?H?= =?windows-1252?Q?eggest=F8yl=22's?= message of "Sun, 08 Feb 2015 13:19:44 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5212=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5212> : inlines <2060> : streams <1387459> : uri <1850639> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 19815-done Cc: 19815-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: -1.3 (-) > - (`(:before . "{") (if (smie-rule-hanging-p) > - (smie-rule-parent 0))))) > + (`(:before . ,(or "{" "(")) > + (if (smie-rule-hanging-p) > + (smie-rule-parent 0))))) Thanks, installed, Stefan ------------=_1423502882-5398-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 8 Feb 2015 12:20:05 +0000 Received: from localhost ([127.0.0.1]:37178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKQqJ-0003Cd-Ba for submit@debbugs.gnu.org; Sun, 08 Feb 2015 07:20:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35993) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKQqF-0003C5-SO for submit@debbugs.gnu.org; Sun, 08 Feb 2015 07:20:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKQq9-0007Ol-4j for submit@debbugs.gnu.org; Sun, 08 Feb 2015 07:19:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKQq9-0007Og-0O for submit@debbugs.gnu.org; Sun, 08 Feb 2015 07:19:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKQq7-0005Nl-Bf for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 07:19:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKQq4-0007KU-4c for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 07:19:51 -0500 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:36184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKQq3-0007KJ-PP for bug-gnu-emacs@gnu.org; Sun, 08 Feb 2015 07:19:48 -0500 Received: by mail-lb0-f180.google.com with SMTP id z12so4126345lbi.11 for ; Sun, 08 Feb 2015 04:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:message-id:mime-version:content-type; bh=1Y4sk1X5xOC7FLI7n+Li4Y3xAZC5VoIikZWAyO+7P68=; b=PnbVnw2n0LKGEnAcjMcIkVo8bMps1KOLY6ySjbwUBz/hK8TL9quJTH+yt5sf0djsj3 0jpxPRcc25FsTCQudYqqY5hCE5xzml5MjQKvS6fstL6P/hQm2T9BXz5ayr2IJzMFb1A9 w7T4PW6R/vuU1MNRMfPrlV86KTQ+9p/aftNu7Xh9Vyy6EnnyDInb0iyZ91PFLB4d0RMD +toeHSdrKxpTOCycx0mz4nWMhezJTpUOMPNI7O/zhewLQkJNpiGqd/Hos+3hjyGfkqxS D6PJzYjCYhlZXtOql2TDaODPXzRbhNbHoBIrx6FKpGxODvV6l4GmTZwtayJ3Lyggw3ye 4iIg== X-Received: by 10.112.44.171 with SMTP id f11mr11608877lbm.65.1423397986763; Sun, 08 Feb 2015 04:19:46 -0800 (PST) Received: from [192.168.1.114] (cm-84.215.48.98.getinternet.no. [84.215.48.98]) by mx.google.com with ESMTPSA id rm3sm1445115lbb.47.2015.02.08.04.19.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Feb 2015 04:19:46 -0800 (PST) Date: Sun, 08 Feb 2015 13:19:44 +0100 From: Simen =?iso-8859-1?q?Heggest=F8yl?= Subject: 25.0.50; [PATCH] css-mode: function call indentation To: bug-gnu-emacs@gnu.org Message-Id: <1423397984.7427.0@smtp.gmail.com> X-Mailer: geary/0.8.2 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=-vapKFm8WH3QM2+yHAcyg" 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 (----) --=-vapKFm8WH3QM2+yHAcyg Content-Type: text/plain; charset=utf-8; format=flowed Sometimes it is convenient to break CSS function calls up in multiple lines. The current CSS indentation engine does not handle this well when the parameters don't begin at the same line as the opening paren. For instance: div { background: linear-gradient( to right, red, orange, yellow, green, blue, indigo, violet ); } div { background: linear-gradient( 135deg, red, blue ); } I would instead expect the following indentation: div { background: linear-gradient( to right, red, orange, yellow, green, blue, indigo, violet ); } div { background: linear-gradient( 135deg, red, blue ); } The following patch accomplishes this: diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index f6a3ca6..ab911ce 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -331,8 +331,9 @@ (`(:elem . basic) css-indent-offset) (`(:elem . arg) 0) (`(:list-intro . ,(or `";" `"")) t) ;"" stands for BOB (bug#15467). - (`(:before . "{") (if (smie-rule-hanging-p) - (smie-rule-parent 0))))) + (`(:before . ,(or "{" "(")) + (if (smie-rule-hanging-p) + (smie-rule-parent 0))))) ;;;###autoload (define-derived-mode css-mode fundamental-mode "CSS" In GNU Emacs 25.0.50.11 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5) of 2015-02-08 on x240 Repository revision: dcec731abfc110f719f0890fd0769e099393af7d Windowing system distributor `The X.Org Foundation', version 11.0.11602901 System Description: Debian GNU/Linux 8.0 (jessie) Configured using: `configure --without-makeinfo' Configured features: XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS NOTIFY LIBXML2 FREETYPE XFT ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message dired format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils time-date tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 74953 5948) (symbols 48 17996 0) (miscs 40 43 124) (strings 32 10952 5168) (string-bytes 1 296625) (vectors 16 9370) (vector-slots 8 386714 15587) (floats 8 70 63) (intervals 56 175 9) (buffers 976 11) (heap 1024 23572 1045)) --=-vapKFm8WH3QM2+yHAcyg Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Sometimes it is convenient to break CSS function calls up in multiple<= /div>
lines. The current CSS indentation engine does not handle this we= ll
when the parameters don't begin at the same line as the openin= g
paren. For instance:

div {
&= nbsp;   background: linear-gradient(
      &n= bsp;                 to right, red,= orange, yellow,
             =           green, blue, indigo, violet
&= nbsp;                   );
}

div {
    background:= linear-gradient(
             = ;           135deg,
     =                   red,
<= div>                    &= nbsp;   blue
             = ;       );
}

I would inst= ead expect the following indentation:

div {
<= div>    background: linear-gradient(
    &nbs= p;   to right, red, orange, yellow,
      &nb= sp; green, blue, indigo, violet
    );
}

div {
    background: linear-gradi= ent(
        135deg,
    =     red,
        blue
&nb= sp;   );
}

The following patch acco= mplishes this:

diff --git a/lisp/textmodes/css-mod= e.el b/lisp/textmodes/css-mode.el
index f6a3ca6..ab911ce 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/cs= s-mode.el
@@ -331,8 +331,9 @@
     (`(:e= lem . basic) css-indent-offset)
     (`(:elem . ar= g) 0)
     (`(:list-intro . ,(or `";" `"")) t) ;""= stands for BOB (bug#15467).
-    (`(:before . "{") (if= (smie-rule-hanging-p)
-            = ;             (smie-rule-parent 0)))))
<= div>+    (`(:before . ,(or "{" "("))
+     (i= f (smie-rule-hanging-p)
+         (smie-rule-= parent 0)))))
 
 ;;;###autoload
&nb= sp;(define-derived-mode css-mode fundamental-mode "CSS"


In GNU Emacs 25.0.50.11 (x86_64-unknown-linux-gnu, GTK= + Version 3.14.5)
 of 2015-02-08 on x240
Repositor= y revision: dcec731abfc110f719f0890fd0769e099393af7d
Windowing sy= stem distributor `The X.Org Foundation', version 11.0.11602901
Sy= stem Description: = Debian GNU/Linux 8.0 (jessie)

Configured us= ing:
 `configure --without-makeinfo'

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

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

Major mode: Lisp= Interaction

Minor modes in effect:
&nbs= p; tooltip-mode: t
  global-eldoc-mode: t
  e= lectric-indent-mode: t
  mouse-wheel-mode: t
 = ; tool-bar-mode: t
  menu-bar-mode: t
  file-= name-shadow-mode: t
  global-font-lock-mode: t
&nb= sp; font-lock-mode: t
  blink-cursor-mode: t
 = ; auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent messages:
For information about GNU = Emacs and the GNU system, type C-h C-a.

Load-path = shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
<= div>rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr mail-utils time-date tooltip=
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwhe= el x-win
x-dnd tool-bar dnd fontset image regexp-opt fringe tabul= ated-list
newcomment elisp-mode lisp-mode prog-mode register page= menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font= -lock syntax
facemenu font-core frame cham georgian utf-8-lang mi= sc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebr= ew greek romanian slovak
czech european ethiopic indian cyrillic = chinese case-table epa-hook
jka-cmpr-hook help simple abbrev mini= buffer cl-preloaded nadvice
loaddefs button faces cus-face macroe= xp files text-properties overlay
sha1 md5 base64 format env code-= pages mule custom widget
hashtable-print-readable backquote make-= network-process dbusbind
gfilenotify dynamic-setting system-font-= setting font-render-setting
move-toolbar gtk x-toolkit x multi-tt= y emacs)

Memory information:
((conses 16= 74953 5948)
 (symbols 48 17996 0)
 (miscs 40= 43 124)
 (strings 32 10952 5168)
 (string-by= tes 1 296625)
 (vectors 16 9370)
 (vector-slo= ts 8 386714 15587)
 (floats 8 70 63)
 (interv= als 56 175 9)
 (buffers 976 11)
 (heap 1024 2= 3572 1045))
= --=-vapKFm8WH3QM2+yHAcyg-- ------------=_1423502882-5398-1--