bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#44214: 28.0.50; css-mode: no completion in declaration with newline


From: Dmitry Gutov
Subject: bug#44214: 28.0.50; css-mode: no completion in declaration with newline after
Date: Tue, 27 Oct 2020 23:06:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 27.10.2020 16:21, Simen Heggestøyl wrote:
Dmitry Gutov <dgutov@yandex.ru> writes:

On 26.10.2020 11:24, Simen Heggestøyl wrote:
This seems sufficient to me. Would you like to test it out?

Seems to work, yeah!

Nice, I've pushed the fix.

Thanks! Seems to work.

BTW, is the case when (ppss-innermost-start (syntax-ppss)) is nil, at
all reachable?

Yes, when called from top level.

Should the search ever succeed in this case, though? I would suggest to use (point) instead of (point-min) to auto-fail:

diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 748a561bab..747657b1ed 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -1358,7 +1358,7 @@ css--complete-property-value
   "Complete property value at point."
   (let ((property (and (looking-back "\\([[:alnum:]-]+\\):[^/][^;]*"
(or (ppss-innermost-start (syntax-ppss))
-                                         (point-min))
+                                         (point))
                                      t)
                        (member (match-string-no-properties 1)
                                css-property-ids))))


Otherwise, we both do the costly-ish search from the bob, and even risk it succeed in rare cases where the CSS in the previous rule is incomplete (or the semicolon is omitted), e.g.:

a {
  animation-delay: inherit
}

cal|





reply via email to

[Prev in Thread] Current Thread [Next in Thread]