emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/company 053c50d 30/46: Merge pull request #1023 from hl


From: Dmitry Gutov
Subject: [elpa] externals/company 053c50d 30/46: Merge pull request #1023 from hlissner/fix-face-helper
Date: Wed, 30 Dec 2020 18:33:08 -0500 (EST)

branch: externals/company
commit 053c50d376e65e189a6b170d2fedc7d552a73907
Merge: 8c22b58 18b7b79
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: GitHub <noreply@github.com>

    Merge pull request #1023 from hlissner/fix-face-helper
    
    Fix company--face-attribute helper
---
 company.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/company.el b/company.el
index b4e40c2..fb39fa8 100644
--- a/company.el
+++ b/company.el
@@ -2750,13 +2750,17 @@ If SHOW-VERSION is non-nil, show the version in the 
echo area."
   ;; Like `face-attribute', but accounts for faces that have been remapped to
   ;; another face, a list of faces, or a face spec.
   (cond ((symbolp face)
-         (let ((remap (cadr (assq face face-remapping-alist))))
+         (let ((remap (cdr (assq face face-remapping-alist))))
            (if remap
-               (company--face-attribute remap attr)
+               (company--face-attribute
+                ;; Faces can be remapped to their unremapped selves, but that
+                ;; would cause us infinite recursion.
+                (if (listp remap) (remq face remap) remap)
+                attr)
              (face-attribute face attr nil t))))
         ((keywordp (car-safe face))
          (or (plist-get face attr)
-             (company--face-attribute (plist-get face :inherit))))
+             (company--face-attribute (plist-get face :inherit) attr)))
         ((listp face)
          (cl-find-if #'stringp
                      (mapcar (lambda (f) (company--face-attribute f attr))



reply via email to

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