From unknown Fri Aug 15 21:25:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43242: [PATCH] Fix CSS completion bug Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 12:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 43242@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15993966729743 (code B ref -1); Sun, 06 Sep 2020 12:52:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Sep 2020 12:51:12 +0000 Received: from localhost ([127.0.0.1]:45023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEu8W-0002X4-BI for submit@debbugs.gnu.org; Sun, 06 Sep 2020 08:51:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:34208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEu8V-0002Wy-Kv for submit@debbugs.gnu.org; Sun, 06 Sep 2020 08:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEu8V-0005Sf-Cz for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2020 08:51:11 -0400 Received: from mout02.posteo.de ([185.67.36.66]:55271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEu8S-0007g1-1t for bug-gnu-emacs@gnu.org; Sun, 06 Sep 2020 08:51:11 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B5797240101 for ; Sun, 6 Sep 2020 14:51:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1599396664; bh=qhenUkBpzB+VCOh7DrznmjVYJ83Ot8Ju7ifsNEL+Okg=; h=From:To:Subject:Date:From; b=Ue/0QtrPrycuQwIigw9SN6y5KRTMPVfX5O/4ZJiS+qQwCbvMityi2XFoBzABON4pS EyeBLgjyUsJLsfaC8olmh+wp9bkBK5CzmnIFKVwktE0QtXJScfIAAl+iV7NJUzzfKT D+dOq907oCx4Hl9YralOAdM+WAnf2huIEOCa7QdWrdMFLyxfcuPSooPEk8GTCSXZ7U QR02sbmDhhb7QjJLR6mtr9IH9BRrEaTJ6p6dOJ9b1oQdAsG54W/2wPN5Rx3KtudSde QtgBBxsm2osM744D46+LaxcN35lPXSc9YjkodKK9ZDmrb8YCRxJobqFoi2LbkVpMCR y+EacToL2K0Jg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Bkrr822Tjz9rxD for ; Sun, 6 Sep 2020 14:51:04 +0200 (CEST) From: "Philip K." Date: Sun, 06 Sep 2020 14:51:03 +0200 Message-ID: <87mu239ih4.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/06 07:09:38 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -2.3 (--) --=-=-= Content-Type: text/plain Hi, I like to write CSS rules on one line, but Emacs completion-at-point system always seems to fail if there is more than one rule per line. It seems the reason was that css--complete-property-value as part of css-completion-at-point falsely reported a match, because it ignored the semi-colon. This means that in situations like these color: red; padd ^ point here the CAPF backend assumed a "color" value should be completed, even though the user probably wants the "padd" string to be completed. The patch below fixes this by making sure css--complete-property-value doesn't ignore the semi-colon. -- Philip K. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Allow-CSS-completion-with-multiple-rules-on-one-line.patch >From d452cd225845000f278e39c02796cf323f931925 Mon Sep 17 00:00:00 2001 From: Philip K Date: Sun, 6 Sep 2020 14:42:03 +0200 Subject: [PATCH] Allow CSS completion with multiple rules on one line * css-mode.el (css--complete-property-value): Check for semi-colon when completing property values --- lisp/textmodes/css-mode.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index cc5879880c..d0882c68d0 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1357,13 +1357,11 @@ css--property-values (defun css--complete-property-value () "Complete property value at point." (let ((property - (save-excursion - (re-search-backward ":[^/]" (line-beginning-position) t) - (when (eq (char-after) ?:) - (let ((property-end (point))) - (skip-chars-backward "-[:alnum:]") - (let ((prop (buffer-substring (point) property-end))) - (car (member prop css-property-ids)))))))) + (save-match-data + (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*" + (line-beginning-position) t) + (car (member (match-string-no-properties 1) + css-property-ids)))))) (when property (let ((end (point))) (save-excursion -- 2.26.2 --=-=-=-- From unknown Fri Aug 15 21:25:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43242: [PATCH] Fix CSS completion bug Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 19:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Philip K." Cc: 43242@debbugs.gnu.org Received: via spool by 43242-submit@debbugs.gnu.org id=B43242.159942065726000 (code B ref 43242); Sun, 06 Sep 2020 19:31:01 +0000 Received: (at 43242) by debbugs.gnu.org; 6 Sep 2020 19:30:57 +0000 Received: from localhost ([127.0.0.1]:47190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF0NN-0006lH-8X for submit@debbugs.gnu.org; Sun, 06 Sep 2020 15:30:57 -0400 Received: from quimby.gnus.org ([95.216.78.240]:47946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF0NM-0006l4-1u for 43242@debbugs.gnu.org; Sun, 06 Sep 2020 15:30:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3dybYTqspt6moPoB0DrR35RJ9vF19a6pdoW952fdLpc=; b=lTyRSoUASPNbLQU7+69aPGgCx+ gEpzY6oBgD6Nh9ag3476uDpGWb7hIkZ4kg59n7+jKpvfzPs2uOKQtWyOgdmvAX1CANMyA10TxRqjJ ahK9JnfPoi1N9uejOMNqOrrS9J8kvlXyq3+V42deqzK9XIgpXlpwGd7Lu3LVhONqtDdY=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kF0NC-0005AE-SD; Sun, 06 Sep 2020 21:30:49 +0200 From: Lars Ingebrigtsen References: <87mu239ih4.fsf@posteo.net> X-Now-Playing: Mike Oldfield's _Tubular Bells (1)_: "Tubular Bells Part One" Date: Sun, 06 Sep 2020 21:30:45 +0200 In-Reply-To: <87mu239ih4.fsf@posteo.net> (Philip K.'s message of "Sun, 06 Sep 2020 14:51:03 +0200") Message-ID: <87y2lmd7oa.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Philip K." writes: > The patch below fixes this by making sure css--complete-property-value > doesn't ignore the semi-colon. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (-) "Philip K." writes: > The patch below fixes this by making sure css--complete-property-value > doesn't ignore the semi-colon. [...] > + (save-match-data > + (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*" Looks good... but is there any particular reason to save the match data here? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Aug 15 21:25:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43242: [PATCH] Fix CSS completion bug References: <87mu239ih4.fsf@posteo.net> Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 21:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 43242@debbugs.gnu.org Received: via spool by 43242-submit@debbugs.gnu.org id=B43242.159942845113375 (code B ref 43242); Sun, 06 Sep 2020 21:41:01 +0000 Received: (at 43242) by debbugs.gnu.org; 6 Sep 2020 21:40:51 +0000 Received: from localhost ([127.0.0.1]:47265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2P5-0003Tf-Go for submit@debbugs.gnu.org; Sun, 06 Sep 2020 17:40:51 -0400 Received: from mout01.posteo.de ([185.67.36.65]:37449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2P3-0003TS-SQ for 43242@debbugs.gnu.org; Sun, 06 Sep 2020 17:40:51 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 88F76160061 for <43242@debbugs.gnu.org>; Sun, 6 Sep 2020 23:40:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1599428443; bh=hkxz6uCoeNysHMuEAvatk+icqcbBekpYtF880LG0DOc=; h=From:To:Cc:Subject:Date:From; b=SyQ0YU6ZPlrf0Eml7DWo56yYUpPvdwDtY8yhWioWLh8VVjiFbulG8huTpKTBH4HJr ZHQQumAjRxKZ433JOHhGiOX3OJLk/EEHO4KiZxb/6GRJeS9+fJktPOYTRdmGthMQ20 rZZ1WGQmlQEGPI0SYY0CubKA4WL95VFiXtZvDjG4lCmDwAxxcmG9NTt1J66K6jl8kW 8eQIFCEVcdKkDECCNo8YIHCtYRSEXweL0nqNmTo/eXYXukmCFE9XZhIU6Zr2DBLkdR bMWNGugeLo+e6AjJl2U8vHseS8WQsFbaU7Wrn4jTfKqOIDsrV4qzJx85gQGexx59Ty wwZNVGNOWC/iw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Bl4bG6VKDz6tmF; Sun, 6 Sep 2020 23:40:42 +0200 (CEST) From: "Philip K." In-Reply-To: <87y2lmd7oa.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun, 06 Sep 2020 21:30:45 +0200) Date: Sun, 06 Sep 2020 23:40:42 +0200 Message-ID: <87imcqeg85.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (-) Lars Ingebrigtsen writes: > "Philip K." writes: > >> The patch below fixes this by making sure css--complete-property-value >> doesn't ignore the semi-colon. > > [...] > >> + (save-match-data >> + (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*" > > Looks good... but is there any particular reason to save the match data > here? Well, it's being used in the next line in the member call to extract the record from css-property-ids. -- Philip K. From unknown Fri Aug 15 21:25:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43242: [PATCH] Fix CSS completion bug Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 21:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Philip K." Cc: 43242@debbugs.gnu.org Received: via spool by 43242-submit@debbugs.gnu.org id=B43242.159942882913991 (code B ref 43242); Sun, 06 Sep 2020 21:48:02 +0000 Received: (at 43242) by debbugs.gnu.org; 6 Sep 2020 21:47:09 +0000 Received: from localhost ([127.0.0.1]:47282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2VA-0003da-NJ for submit@debbugs.gnu.org; Sun, 06 Sep 2020 17:47:08 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2V8-0003d5-Ff for 43242@debbugs.gnu.org; Sun, 06 Sep 2020 17:47:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HV+59n5niL2ffSVUh4gdzSMbK8TSHe3UUPHhvKeL9DM=; b=mE+RyqoQXBlqMDtsp8yfe8cggT OMQ5BHoXG90SwfXc7tsksJxoiC1ii5rgTEXwBlyNfNL0XfmlE9yx1FI7XNZ466m04b9jJFMkIvW1m gwD2ZHUomiEf+aKTazCf1uxqAVADXWVb039jwtfo2THL7SN8AogHuWGcJLn2pvDazw94=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kF2Uy-0006GE-96; Sun, 06 Sep 2020 23:46:59 +0200 From: Lars Ingebrigtsen References: <87mu239ih4.fsf@posteo.net> <87imcqeg85.fsf@posteo.net> X-Now-Playing: Neil Young & Crazy Horse's _Zuma_: "Danger Bird" Date: Sun, 06 Sep 2020 23:46:54 +0200 In-Reply-To: <87imcqeg85.fsf@posteo.net> (Philip K.'s message of "Sun, 06 Sep 2020 23:40:42 +0200") Message-ID: <87bliid1dd.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Philip K." writes: > Well, it's being used in the next line in the member call to extract the > record from css-property-ids. I think there may be a slight misunderstanding about what the point of save-match-data is. Here's the code: Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (-) "Philip K." writes: > Well, it's being used in the next line in the member call to extract the > record from css-property-ids. I think there may be a slight misunderstanding about what the point of save-match-data is. Here's the code: + (save-match-data + (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*" + (line-beginning-position) t) + (car (member (match-string-no-properties 1) + css-property-ids)))))) The regexp operators set a global match state, but is you use save-match-data, the previous global state is restored after the form ends. So save-match-data is used to preserve the global state -- it's not necessary if you don't care about overwriting it, and overwriting it is the norm. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Aug 15 21:25:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43242: [PATCH] Fix CSS completion bug References: <87mu239ih4.fsf@posteo.net> Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 21:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 43242@debbugs.gnu.org Received: via spool by 43242-submit@debbugs.gnu.org id=B43242.159942935314757 (code B ref 43242); Sun, 06 Sep 2020 21:56:02 +0000 Received: (at 43242) by debbugs.gnu.org; 6 Sep 2020 21:55:53 +0000 Received: from localhost ([127.0.0.1]:47297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2dd-0003px-9G for submit@debbugs.gnu.org; Sun, 06 Sep 2020 17:55:53 -0400 Received: from mout02.posteo.de ([185.67.36.66]:48267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2db-0003pj-9H for 43242@debbugs.gnu.org; Sun, 06 Sep 2020 17:55:51 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 037B92400FB for <43242@debbugs.gnu.org>; Sun, 6 Sep 2020 23:55:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1599429345; bh=0PDwdFAjxva+CNMBdT+6unXN86ZgQrjPGXegJrrBuNU=; h=From:To:Cc:Subject:Date:From; b=m5XJPpNDPyPsJQgEPjFdr8fe+xGO/m2qXKu75E1Ey88ajHtGpTKmYepjvQPm9g1xN OVUv6jKAmb52Cr6Vz6dTYLMabvO5+qmzZlj1zzUGoQAEJ91qA7455GbKQSzloijcT7 3yQn2zRuuor4OA6Whnk1sE5bPCm1DLQxaSQH0nxfRV2rZS0N2Sq7Lv0ioIpR/bYAlq YbIHrAOv35uCo7BdvATN+kJB/6g8nalnbeuOQKnacWS0yeHicBwL29Si2x6zESJ3Fc Lvhx9P1Frb3cc/s6Tx7B1QJwqCfmdxg95AV8G6WiHLboGW8zbwgbOkwErzpLhXnVZA GK/JH9piI8y6A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Bl4wc2rF8z6tmF; Sun, 6 Sep 2020 23:55:44 +0200 (CEST) From: "Philip K." In-Reply-To: <87bliid1dd.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun, 06 Sep 2020 23:46:54 +0200) Date: Sun, 06 Sep 2020 23:55:43 +0200 Message-ID: <87a6y2efj4.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (-) Lars Ingebrigtsen writes: > "Philip K." writes: > >> Well, it's being used in the next line in the member call to extract the >> record from css-property-ids. > > I think there may be a slight misunderstanding about what the point of > save-match-data is. Here's the code: > > + (save-match-data > + (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*" > + (line-beginning-position) t) > + (car (member (match-string-no-properties 1) > + css-property-ids)))))) > > The regexp operators set a global match state, but is you use > save-match-data, the previous global state is restored after the form > ends. So save-match-data is used to preserve the global state -- it's > not necessary if you don't care about overwriting it, and overwriting it > is the norm. Oh, I wasn't familiar with that convention. I always save the match data to avoid bugs bugs down the line. If it's wished for, I can resubmit the patch without the save-match-data. -- Philip K. From unknown Fri Aug 15 21:25:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43242: [PATCH] Fix CSS completion bug Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 21:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Philip K." Cc: 43242@debbugs.gnu.org Received: via spool by 43242-submit@debbugs.gnu.org id=B43242.159942946214961 (code B ref 43242); Sun, 06 Sep 2020 21:58:02 +0000 Received: (at 43242) by debbugs.gnu.org; 6 Sep 2020 21:57:42 +0000 Received: from localhost ([127.0.0.1]:47309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2fO-0003tE-5t for submit@debbugs.gnu.org; Sun, 06 Sep 2020 17:57:42 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2fN-0003t2-2n for 43242@debbugs.gnu.org; Sun, 06 Sep 2020 17:57:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=P+1qo7q1nrn9COpq546Ry7uATAoEp9LSwkG/gcnNcpA=; b=Vtdf4DtQytodKsMIThYMoDUjGd RjqcPkrU37R+8sA8DZx6UgDcODHXRk9sC5Ve6oAfzfLs/M+CL5B9hQ6dH4XZIp6/k7ObO2kUlBdI8 ELsiWYRL4ZWozGzmzJlU7/5KBM5Qz4HMH7f719veoM4Kfdr8OKIrz/5KD+D6qhuOcZIk=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kF2fE-0006M4-Q1; Sun, 06 Sep 2020 23:57:35 +0200 From: Lars Ingebrigtsen References: <87a6y2efj4.fsf@posteo.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEXw8PBdXV2joqP/ //8t2MV5AAAAAWJLR0QDEQxM8gAAAAd0SU1FB+QJBhU0H0W1UQAAAAFTSURBVCjPjZGxasMwEIYv ojF2phI6ZDShMa6ewkuGbg00xngKpRLGT6GaJiSeMpQQMgnTmuSesifZqV269IaTvtPp190J4Jfd 5O8rt3S3O0UwFPXqXgopDXjzu2iYybk0aY6onz1nvhaRBZl46/XnI6XxAgvEM0fEI3C8XJYIVbiF WwN5BqyanMGHAE+ablYcCXjqG03EShMoW0elNIRg440PSaIxZiIt0H0yA0yjslfHBl7yRmZ87PXG L7qDKaoOxr2D5jkG5dmmGTdA1CNKn5gDlqLyQ/vo7E1qBE0wbcTIF9oKuH5PrVRUs3uV1u3GN520 LdIy0x2w/EP9wMB1ulJdzq5DoIRRG+z56/If481H0YfhHh7S+KteYp6e8j3AIanUNiwcr6a34nix yAIhNgeaRRSn1dPsVZTUNkvSJIsCKXZmWLFYJKtgtxFB19efcr4ByGtiboM3kVUAAAAldEVYdGRh dGU6Y3JlYXRlADIwMjAtMDktMDZUMjE6NTI6MzErMDA6MDDg7P/LAAAAJXRFWHRkYXRlOm1vZGlm eQAyMDIwLTA5LTA2VDIxOjUyOjMxKzAwOjAwkbFHdwAAAABJRU5ErkJggg== X-Now-Playing: Neil Young & Crazy Horse's _Zuma_: "Barstool Blues" Date: Sun, 06 Sep 2020 23:57:31 +0200 In-Reply-To: <87a6y2efj4.fsf@posteo.net> (Philip K.'s message of "Sun, 06 Sep 2020 23:55:43 +0200") Message-ID: <87y2lmbmb8.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Philip K." writes: > Oh, I wasn't familiar with that convention. I always save the match data > to avoid bugs bugs down the line. If it's wished for, I can resubmit the > patch without the save-match-data. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (-) "Philip K." writes: > Oh, I wasn't familiar with that convention. I always save the match data > to avoid bugs bugs down the line. If it's wished for, I can resubmit the > patch without the save-match-data. Yes, please. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Aug 15 21:25:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43242: [PATCH] Fix CSS completion bug References: <87mu239ih4.fsf@posteo.net> Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 22:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 43242@debbugs.gnu.org Received: via spool by 43242-submit@debbugs.gnu.org id=B43242.159943051716599 (code B ref 43242); Sun, 06 Sep 2020 22:16:02 +0000 Received: (at 43242) by debbugs.gnu.org; 6 Sep 2020 22:15:17 +0000 Received: from localhost ([127.0.0.1]:47332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2wO-0004Jf-MF for submit@debbugs.gnu.org; Sun, 06 Sep 2020 18:15:16 -0400 Received: from mout02.posteo.de ([185.67.36.66]:53803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2wM-0004JQ-Of for 43242@debbugs.gnu.org; Sun, 06 Sep 2020 18:15:15 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 9BC732400FC for <43242@debbugs.gnu.org>; Mon, 7 Sep 2020 00:15:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1599430507; bh=4vIBrWy1SXinsVOPbNO3StpE7CWfl6+byoUgYA5Dodg=; h=From:To:Cc:Subject:Date:From; b=THWEQRU1bbwigHd1F6lVSJvixmkXItRuzZV/ybF3U8lhQs6JDvrzDzweviEAylChS GagHWMqHc+9spYxCQV8YPWNGvn7wNNXSLoshWE3HP6oC9GuvChVPUsrb9b8BqC9SuZ mx9lSmo55lQ4QYI9/iqBeWabHNFXL4cuCxJuAQhnjPvFBSFjWcYPxXnZQzuQLepSZU mcPRnCiT+gCUQ9hAzF32gVytUf+a4iEh3ygwERAECf0SxOe52jCUzLgUVJLnoCVwXr vSHMs/NqD1zgrGVhPgAXTlA+l7GqqfbGNavh9L7BdkmOGm6B6q5GGmTEHcO35toKtt QJKs8I+DxQy2g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Bl5Ly6pKvz9rxM; Mon, 7 Sep 2020 00:15:06 +0200 (CEST) From: "Philip K." In-Reply-To: <87y2lmbmb8.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun, 06 Sep 2020 23:57:31 +0200) Date: Mon, 07 Sep 2020 00:15:06 +0200 Message-ID: <877dt6eemt.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (-) --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > "Philip K." writes: > >> Oh, I wasn't familiar with that convention. I always save the match data >> to avoid bugs bugs down the line. If it's wished for, I can resubmit the >> patch without the save-match-data. > > Yes, please. See below. I also took the liberty to restructure the code a bit, hopefully making it easier to read. Hope that's OK. -- Philip K. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Allow-CSS-completion-with-multiple-rules-on-one-line.patch >From 87244a9bfb9a285cf7df547465014527b2260027 Mon Sep 17 00:00:00 2001 From: Philip K Date: Sun, 6 Sep 2020 14:42:03 +0200 Subject: [PATCH] Allow CSS completion with multiple rules on one line * css-mode.el (css--complete-property-value): Check for semi-colon when completing property values --- lisp/textmodes/css-mode.el | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index cc5879880c..9cddc17eaa 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1356,21 +1356,17 @@ css--property-values (defun css--complete-property-value () "Complete property value at point." - (let ((property - (save-excursion - (re-search-backward ":[^/]" (line-beginning-position) t) - (when (eq (char-after) ?:) - (let ((property-end (point))) - (skip-chars-backward "-[:alnum:]") - (let ((prop (buffer-substring (point) property-end))) - (car (member prop css-property-ids)))))))) + (let ((property (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*" + (line-beginning-position) t) + (member (match-string-no-properties 1) + css-property-ids)))) (when property (let ((end (point))) (save-excursion (skip-chars-backward "[:graph:]") (list (point) end (append '("inherit" "initial" "unset") - (css--property-values property)))))))) + (css--property-values (car property))))))))) (defvar css--html-tags (mapcar #'car html-tag-alist) "List of HTML tags. -- 2.26.2 --=-=-=-- From unknown Fri Aug 15 21:25:05 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43242: [PATCH] Fix CSS completion bug Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Sep 2020 22:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Philip K." Cc: 43242@debbugs.gnu.org Received: via spool by 43242-submit@debbugs.gnu.org id=B43242.159943070216888 (code B ref 43242); Sun, 06 Sep 2020 22:19:01 +0000 Received: (at 43242) by debbugs.gnu.org; 6 Sep 2020 22:18:22 +0000 Received: from localhost ([127.0.0.1]:47336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2zO-0004OH-6X for submit@debbugs.gnu.org; Sun, 06 Sep 2020 18:18:22 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2zF-0004Np-I9 for 43242@debbugs.gnu.org; Sun, 06 Sep 2020 18:18:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Sjz5bb0SbD5/hF9CO4BTHQpZickLuFULmDZnu6mZvvE=; b=CjDcZcMRbS96tNrxX9nRiusljv NT/mCz6SRVqZ3wqrZtt14VOIKUFD8HTYwLpL5k9PhNSgeT3zrOiLh8923+Tv12NF39f6QGKwD+qr3 RlteuQssLJP2mOGLXTsDQgz6eEUZi9juzjzUyGIuGr5+E6EpZMVYEa7hYb2nVUfMiff4=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kF2z2-0006Y9-JO; Mon, 07 Sep 2020 00:18:07 +0200 From: Lars Ingebrigtsen References: <877dt6eemt.fsf@posteo.net> X-Now-Playing: New Fast Automatic Daffodils's _Pigeonhole_: "Get Better" Date: Mon, 07 Sep 2020 00:17:59 +0200 In-Reply-To: <877dt6eemt.fsf@posteo.net> (Philip K.'s message of "Mon, 07 Sep 2020 00:15:06 +0200") Message-ID: <87pn6ybld4.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Philip K." writes: > I also took the liberty to restructure the code a bit, hopefully > making it easier to read. Hope that's OK. Looks good to me (and I tested it slightly in a CSS file); applied to Emacs 28. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (-) "Philip K." writes: > I also took the liberty to restructure the code a bit, hopefully > making it easier to read. Hope that's OK. Looks good to me (and I tested it slightly in a CSS file); applied to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 06 18:18:26 2020 Received: (at control) by debbugs.gnu.org; 6 Sep 2020 22:18:26 +0000 Received: from localhost ([127.0.0.1]:47339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2zS-0004Oc-Ng for submit@debbugs.gnu.org; Sun, 06 Sep 2020 18:18:26 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kF2zQ-0004O9-NB for control@debbugs.gnu.org; Sun, 06 Sep 2020 18:18:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TCK1taJK4aO1qAz5ND8McYXJZnzmZF1e+diGnftZGfg=; b=YAtY6dr+BPjQ5yFiGmvUs3JofN iFtTh7jYgJR3pUONVLGXqwILiHzV5KJd2eKpusVHLUJiJuZYpwsQebzkg1K08qjaQ++p3LnVsegSb 5iQBA3nAXM218AcGc3t10Guu4WorLFT33KvdbTrZRTZd7nTE1bCTKDyLGVOJCi6x7Sew=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kF2zI-0006YP-VY for control@debbugs.gnu.org; Mon, 07 Sep 2020 00:18:19 +0200 Date: Mon, 07 Sep 2020 00:18:15 +0200 Message-Id: <87o8miblco.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #43242 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 43242 fixed close 43242 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (-) tags 43242 fixed close 43242 28.1 quit