From: Dmitry Gutov Date: Sat, 15 May 2021 00:17:17 +0000 (+0300) Subject: Include colons in the completion strings X-Git-Tag: emacs-28.0.90~2471 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c92ad6a75a20fe7e820268f2983523e7f69658ae;p=emacs.git Include colons in the completion strings * lisp/textmodes/css-mode.el (css--complete-pseudo-element-or-class): Include colons in the completion strings. That's simply the nicer behavior (e.g. someone typing : will see pseudo-elements in completions as well), and by the standards, the colons are part of their names anyway (of pseudo-elements and classes). --- diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 879c24a2fe1..61a2f6b3bc0 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1307,11 +1307,14 @@ for determining whether point is within a selector." (let ((pos (point))) (skip-chars-backward "-[:alnum:]") (when (eq (char-before) ?\:) - (list (point) pos - (if (eq (char-before (- (point) 1)) ?\:) - css-pseudo-element-ids - css-pseudo-class-ids) - :company-kind (lambda (_) 'function)))))) + (let ((double-colon (eq (char-before (- (point) 1)) ?\:))) + (list (- (point) (if double-colon 2 1)) + pos + (nconc + (unless double-colon + (mapcar (lambda (id) (concat ":" id)) css-pseudo-class-ids)) + (mapcar (lambda (id) (concat "::" id)) css-pseudo-element-ids)) + :company-kind (lambda (_) 'function))))))) (defun css--complete-at-rule () "Complete at-rule (statement beginning with `@') at point."