[elpa] externals/vertico c4e8185: Compute vertico--history-hash lazily on demand

2021-07-16 Thread ELPA Syncer
branch: externals/vertico
commit c4e818505c8501f11e687495b9c108b21609913d
Author: Daniel Mendler 
Commit: Daniel Mendler 

Compute vertico--history-hash lazily on demand
---
 vertico.el | 57 ++---
 1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/vertico.el b/vertico.el
index bcb1c6d..c8017bc 100644
--- a/vertico.el
+++ b/vertico.el
@@ -160,31 +160,31 @@ See `resize-mini-windows' for documentation."
 (defvar-local vertico--default-missing nil
   "Default candidate is missing from candidates list.")
 
-(defun vertico--update-history-hash (base)
-  "Update history hash, given current BASE prefix string."
-  (unless (and vertico--history-hash (equal vertico--history-base base))
-(let* ((index 0)
-   (base-size (length base))
-   ;; History disabled if `minibuffer-history-variable' eq `t'.
-   (hist (and (not (eq minibuffer-history-variable t))
-  (symbol-value minibuffer-history-variable)))
-   (hash (make-hash-table :test #'equal :size (length hist
-  (if (= base-size 0)
-  ;; Put history elements into the hash
+(defun vertico--history-hash ()
+  "Recompute history hash table and return it."
+  (or vertico--history-hash
+  (let* ((index 0)
+ (base vertico--history-base)
+ (base-size (length base))
+ ;; History disabled if `minibuffer-history-variable' eq `t'.
+ (hist (and (not (eq minibuffer-history-variable t))
+(symbol-value minibuffer-history-variable)))
+ (hash (make-hash-table :test #'equal :size (length hist
+(if (= base-size 0)
+;; Put history elements into the hash
+(dolist (elem hist)
+  (unless (gethash elem hash)
+(puthash elem index hash))
+  (setq index (1+ index)))
+  ;; Drop base string from history elements, before putting them into 
the hash
   (dolist (elem hist)
-(unless (gethash elem hash)
-  (puthash elem index hash))
-(setq index (1+ index)))
-;; Drop base string from history elements, before putting them into 
the hash
-(dolist (elem hist)
-  (when (and (>= (length elem) base-size)
- (eq t (compare-strings base 0 base-size elem 0 
base-size)))
-(setq elem (substring elem base-size))
-(unless (gethash elem hash)
-  (puthash elem index hash)))
-  (setq index (1+ index
-  (setq vertico--history-hash hash
-vertico--history-base base
+(when (and (>= (length elem) base-size)
+   (eq t (compare-strings base 0 base-size elem 0 
base-size)))
+  (setq elem (substring elem base-size))
+  (unless (gethash elem hash)
+(puthash elem index hash)))
+(setq index (1+ index
+(setq vertico--history-hash hash
 
 (defun vertico--length-string< (x y)
   "Sorting predicate which compares X and Y first by length then by `string<'."
@@ -207,11 +207,11 @@ The function is configured by BY, BSIZE, BINDEX, BPRED 
and PRED."
   `(defun ,(intern (mapconcat #'symbol-name `(vertico sort ,@by) "-")) 
(candidates)
  ,(concat "Sort candidates by " (mapconcat #'symbol-name by ", ") ".")
  (let* ((buckets (make-vector ,bsize nil))
-,@(and (eq (car by) 'history) '((hcands
+,@(and (eq (car by) 'history) '((hhash (vertico--history-hash)) 
(hcands
(dolist (% candidates)
  ,(if (eq (car by) 'history)
   ;; Find recent candidates or fill buckets
-  `(if-let (idx (gethash % vertico--history-hash))
+  `(if-let (idx (gethash % hhash))
(push (cons idx %) hcands)
  (let ((idx (min ,(1- bsize) ,bindex)))
(aset buckets idx (cons % (aref buckets idx)
@@ -313,9 +313,13 @@ The function is configured by BY, BSIZE, BINDEX, BPRED and 
PRED."
 
minibuffer-completion-predicate
 pt metadata))
(base (or (when-let (z (last all)) (prog1 (cdr z) (setcdr z 
nil))) 0))
+   (base-str (substring content 0 base))
(def (or (car-safe minibuffer-default) minibuffer-default))
(sort (vertico--sort-function metadata))
(groups))
+;; Reset the history hash table
+(unless (equal base-str vertico--history-base)
+  (setq vertico--history-base base-str vertico--history-hash nil))
 ;; Filter the ignored file extensions. We cannot use modified predicate 
for this filtering,
 ;; since this breaks the special casing in the 
`completion-file-name-table' for `file-exists-p'
 ;; and `file-directory-p'.
@@ -323,7 +327,6 @@ The function is configured by BY, 

[elpa] externals/consult 8250b7a: consult-focus-lines: Uncover if input is empty

2021-07-16 Thread ELPA Syncer
branch: externals/consult
commit 8250b7ac9a0c2d4acb869df393bddb1070fd24cc
Author: Daniel Mendler 
Commit: Daniel Mendler 

consult-focus-lines: Uncover if input is empty

Add helpful prompt, make command more intuitive.
---
 consult.el | 25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/consult.el b/consult.el
index 9fd491d..656c73e 100644
--- a/consult.el
+++ b/consult.el
@@ -2746,14 +2746,18 @@ INITIAL is the initial input."
   (setq li (cdr li) ov (cdr ov
   (setq last-input input)
   (when restore
-(if (not input)
-(goto-char point-orig)
+(cond
+ ((not input)
+  (goto-char point-orig))
+ ((equal input "")
+  (consult-focus-lines 'show))
+ (t
   ;; Sucessfully terminated -> Remember invisible overlays
   (dolist (ov overlays)
 (if (overlay-get ov 'invisible)
 (push ov consult--focus-lines-overlays)
   (delete-overlay ov)))
-  (setq overlays nil))
+  (setq overlays nil)))
 ;; Destroy remaining overlays
 (mapc #'delete-overlay overlays)
 
@@ -2764,8 +2768,9 @@ INITIAL is the initial input."
 The selected lines are shown and the other lines hidden. When called
 interactively, the lines selected are those that match the minibuffer input. In
 order to match the inverse of the input, prefix the input with `! '. With
-optional prefix argument SHOW reveal the hidden lines. When called from elisp,
-the filtering is performed by a FILTER function. This command obeys narrowing.
+optional prefix argument SHOW reveal the hidden lines. Alternatively the
+command can be restarted to reveal the lines. When called from elisp, the
+filtering is performed by a FILTER function. This command obeys narrowing.
 
 FILTER is the filter function.
 INITIAL is the initial input."
@@ -2775,14 +2780,18 @@ INITIAL is the initial input."
;; Use consult-location completion category when filtering lines
(consult--completion-filter-dispatch
 pattern cands 'consult-location nil
-  (consult--forbid-minibuffer)
   (if show
   (progn
 (mapc #'delete-overlay consult--focus-lines-overlays)
-(setq consult--focus-lines-overlays nil))
+(setq consult--focus-lines-overlays nil)
+(message "All lines revealed"))
+(consult--forbid-minibuffer)
 (consult--with-increased-gc
  (consult--prompt
-  :prompt "Focus on lines: "
+  :prompt
+  (if consult--focus-lines-overlays
+  "Focus on lines (RET to reveal): "
+"Focus on lines: ")
   :initial initial
   :history 'consult--keep-lines-history
   :state (consult--focus-lines-state filter)



[elpa] main b438674: Remove deprecated modus-{operandi, vivendi}-themes

2021-07-16 Thread Protesilaos Stavrou
branch: main
commit b438674100fab7fa7f7424cd6f185e002597c0cb
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Remove deprecated modus-{operandi,vivendi}-themes

Subject to bug#49572, which updates the modus-themes in emacs.git to
version 1.5.0, it now is the right time to delete the long-deprecated
standalone packages of modus-operandi and modus-vivendi.
---
 elpa-packages | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/elpa-packages b/elpa-packages
index e7c527f..af7f075 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -233,19 +233,12 @@
  ("mmm-mode"
   :url "https://github.com/purcell/mmm-mode.git";
   :auto-sync t)
- ;; `modus-operandi-theme' and `modus-vivendi-theme' are deprecated and
- ;; will have to be deleted by the summer of 2021, as discussed in Emacs
- ;; bug#46964: .
- ("modus-operandi-theme":url "https://gitlab.com/protesilaos/modus-themes";
-  :branch "elpa/modus-operandi-theme")
  ("modus-themes"   :core ("etc/themes/modus-themes.el"
"etc/themes/modus-operandi-theme.el"
"etc/themes/modus-vivendi-theme.el"
"doc/misc/modus-themes.org"
"doc/misc/doclicense.texi")
   :doc "modus-themes.org")
- ("modus-vivendi-theme":url 
"https://gitlab.com/protesilaos/modus-themes";
-  :branch "elpa/modus-vivendi-theme")
  ("multishell" :url "https://github.com/kenmanheimer/EmacsMultishell";)
  ("muse"   :url "https://github.com/alexott/muse";) ;FIXME: Not 
nearly in-sync
  ("myers"  :url nil)



[elpa] externals/consult 5fb6248 2/2: consult-line-number-wrapped: Inherit from font-lock-warning-face

2021-07-16 Thread ELPA Syncer
branch: externals/consult
commit 5fb6248c8e12630ce1247985c67ea28ae4077e4f
Author: Daniel Mendler 
Commit: Daniel Mendler 

consult-line-number-wrapped: Inherit from font-lock-warning-face
---
 consult.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/consult.el b/consult.el
index 83f6e77..6c2d6f0 100644
--- a/consult.el
+++ b/consult.el
@@ -402,7 +402,7 @@ Used by `consult-completion-in-region', `consult-yank' and 
`consult-history'.")
   "Face used to highlight line number prefixes.")
 
 (defface consult-line-number-wrapped
-  '((t :inherit consult-line-number-prefix :slant italic))
+  '((t :inherit consult-line-number-prefix :inherit font-lock-warning-face))
   "Face used to highlight line number prefixes, if the line number wrapped 
around.")
 
 (defface consult-separator



[elpa] externals/consult 4ba5ad1 1/2: consult-line: Show wrapped around line numbers in italic

2021-07-16 Thread ELPA Syncer
branch: externals/consult
commit 4ba5ad1946541a709bad1f0e6f1a2fef5df9d7ae
Author: Daniel Mendler 
Commit: Daniel Mendler 

consult-line: Show wrapped around line numbers in italic

Introduce the new face consult-line-number-wrapped.

See #287.
---
 consult.el | 36 +++-
 1 file changed, 23 insertions(+), 13 deletions(-)

diff --git a/consult.el b/consult.el
index 656c73e..83f6e77 100644
--- a/consult.el
+++ b/consult.el
@@ -399,7 +399,11 @@ Used by `consult-completion-in-region', `consult-yank' and 
`consult-history'.")
 
 (defface consult-line-number-prefix
   '((t :inherit line-number))
-  "Face used to highlight line numbers in selections.")
+  "Face used to highlight line number prefixes.")
+
+(defface consult-line-number-wrapped
+  '((t :inherit consult-line-number-prefix :slant italic))
+  "Face used to highlight line number prefixes, if the line number wrapped 
around.")
 
 (defface consult-separator
   'class color) (min-colors 88) (background light))
@@ -835,14 +839,17 @@ Otherwise the `default-directory' is returned."
 (forward-char column))
   (point-marker))
 
-(defun consult--line-prefix ()
-  "Annotate `consult-location' candidates with line numbers."
+(defun consult--line-prefix (&optional curr-line)
+  "Annotate `consult-location' candidates with line numbers given the current 
line CURR-LINE."
+  (setq curr-line (or curr-line -1))
   (let* ((width (length (number-to-string (line-number-at-pos
(point-max)
consult-line-numbers-widen
- (fmt (propertize (format "%%%dd " width) 'face 
'consult-line-number-prefix)))
+ (fmt-before (propertize (format "%%%dd " width) 'face 
'consult-line-number-wrapped))
+ (fmt-after (propertize (format "%%%dd " width) 'face 
'consult-line-number-prefix)))
 (lambda (cand)
-  (list cand (format fmt (cdr (get-text-property 0 'consult-location 
cand))) ""
+  (let ((line (cdr (get-text-property 0 'consult-location cand
+(list cand (format (if (< line curr-line) fmt-before fmt-after) line) 
"")
 
 (defun consult--location-candidate (cand marker line &rest props)
   "Add MARKER and LINE as 'consult-location text property to CAND.
@@ -2488,14 +2495,15 @@ The symbol at point is added to the future history."
 
 ; Command: consult-line
 
-(defun consult--line-candidates (top)
-  "Return list of line candidates; start from top if TOP non-nil."
+(defun consult--line-candidates (top curr-line)
+  "Return list of line candidates.
+Start from top if TOP non-nil.
+CURR-LINE is the current line number."
   (consult--forbid-minibuffer)
   (consult--fontify-all)
   (let* ((default-cand)
  (candidates)
- (line (line-number-at-pos (point-min) consult-line-numbers-widen))
- (curr-line (line-number-at-pos (point) consult-line-numbers-widen)))
+ (line (line-number-at-pos (point-min) consult-line-numbers-widen)))
 (consult--each-line beg end
   (let ((str (consult--buffer-substring beg end)))
 (unless (string-blank-p str)
@@ -2568,13 +2576,15 @@ This command obeys narrowing. Optional INITIAL input 
can be provided.
 The search starting point is changed if the START prefix argument is set.
 The symbol at point and the last `isearch-string' is added to the future 
history."
   (interactive (list nil (not (not current-prefix-arg
-  (let ((candidates (consult--with-increased-gc
- (consult--line-candidates
-  (not (eq start consult-line-start-from-top))
+  (let* ((curr-line (line-number-at-pos (point) consult-line-numbers-widen))
+ (candidates (consult--with-increased-gc
+  (consult--line-candidates
+   (not (eq start consult-line-start-from-top))
+   curr-line
 (consult--read
  candidates
  :prompt "Go to line: "
- :annotate (consult--line-prefix)
+ :annotate (consult--line-prefix curr-line)
  :category 'consult-location
  :sort nil
  :require-match t



[elpa] externals/consult updated (8250b7a -> 5fb6248)

2021-07-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/consult.

  from  8250b7a   consult-focus-lines: Uncover if input is empty
   new  4ba5ad1   consult-line: Show wrapped around line numbers in italic
   new  5fb6248   consult-line-number-wrapped: Inherit from 
font-lock-warning-face


Summary of changes:
 consult.el | 36 +++-
 1 file changed, 23 insertions(+), 13 deletions(-)



[elpa] externals/marginalia b589388: Simplify marginalia-annotate-variable

2021-07-16 Thread ELPA Syncer
branch: externals/marginalia
commit b5893884abeb6a355233edf54e0f63d04bc32ce2
Author: Daniel Mendler 
Commit: Daniel Mendler 

Simplify marginalia-annotate-variable
---
 marginalia.el | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/marginalia.el b/marginalia.el
index 08ee70c..70ae7c8 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -486,16 +486,16 @@ keybinding since CAND includes it."
   (when-let (sym (intern-soft cand))
 (marginalia--fields
  ((marginalia--symbol-class sym) :face 'marginalia-type)
- ((if (seq-find (lambda (r) (string-match-p r cand))
-marginalia-censor-variables)
-  "*"
-(let ((val (if (boundp sym) (symbol-value sym) 'unbound))
-  (print-escape-newlines t)
-  (print-escape-control-characters t)
-  (print-escape-multibyte t)
-  (print-level 10)
-  (print-length marginalia-truncate-width))
-  (prin1-to-string val)))
+ ((cond
+   ((not (boundp sym)) "")
+   ((seq-find (lambda (r) (string-match-p r cand)) 
marginalia-censor-variables) "*")
+   (t (let ((val (symbol-value sym))
+(print-escape-newlines t)
+(print-escape-control-characters t)
+(print-escape-multibyte t)
+(print-level 10)
+(print-length marginalia-truncate-width))
+(prin1-to-string val
   :truncate (/ marginalia-truncate-width 2) :face 'marginalia-variable)
  ((documentation-property sym 'variable-documentation)
   :truncate marginalia-truncate-width :face 'marginalia-documentation



[elpa] externals/vertico e1faeb0: README: Fix links

2021-07-16 Thread ELPA Syncer
branch: externals/vertico
commit e1faeb01ed379dd773116adbc22e8ca52f6f8162
Author: Daniel Mendler 
Commit: Daniel Mendler 

README: Fix links
---
 README.org | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 5cf405f..c70f915 100644
--- a/README.org
+++ b/README.org
@@ -18,7 +18,7 @@
   built-in facilities system, Vertico achieves /full compatibility/ with 
built-in
   Emacs completion commands and completion tables. Vertico only provides the
   completion UI but aims to be flexible and extensible. Additional enhancements
-  can be installed separately via extensions or complementary packages. The 
code
+  can be installed separately via [[#extensions][extensions]] or 
[[#complementary-packages][complementary packages]]. The code
   base is small and maintainable (~vertico.el~ is only about 600 lines of code
   without whitespace and comments).
 
@@ -172,6 +172,9 @@
   #+end_src
 
 * Extensions
+  :properties:
+  :custom_id: extensions
+  :end:
 
   We maintain a few small extension packages to Vertico in this repository in
   the subdirectory 
[[https://github.com/minad/vertico/tree/main/extensions][extensions/]]. The 
extensions can be installed additionally to
@@ -191,6 +194,9 @@
   =vertico-flat= plus =vertico-directory= resembles Ido in look and feel.
 
 * Complementary packages
+  :properties:
+  :custom_id: complementary-packages
+  :end:
 
   Vertico works well together with a few complementary packages, which enrich 
the
   completion UI. These packages are fully supported:



[elpa] externals/marginalia d4c2028: marginalia--symbol-class: Add symbol for autoloaded

2021-07-16 Thread ELPA Syncer
branch: externals/marginalia
commit d4c2028c7917b2ff926b3a67c3acc0351be658cc
Author: Daniel Mendler 
Commit: Daniel Mendler 

marginalia--symbol-class: Add symbol for autoloaded
---
 marginalia.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/marginalia.el b/marginalia.el
index 70ae7c8..fea67a4 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -375,6 +375,7 @@ C interactive-only command
 m macro
 p pure
 s side-effect-free
+@ autoloaded
 ! advised
 - obsolete
 
@@ -400,6 +401,7 @@ t cl-type"
 ((commandp s) (if (get s 'interactive-only) "C" "c"))
 ((eq (car-safe (symbol-function s)) 'macro) "m")
 (t "f"))
+   (and (autoloadp (symbol-function s)) "@")
(and (marginalia--advised s) "!")
(and (get s 'byte-obsolete-info) "-")))
 (when (boundp s)



[elpa] externals/corfu updated (2620355 -> 155af8d)

2021-07-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/corfu.

  from  2620355   Better y-position computation
   new  1acc028   corfu--make-frame: Apply frame/face settings only if 
changed (Fix #37)
   new  e335a13   Revert "corfu--make-frame: Apply frame/face settings only 
if changed (Fix #37)"
   new  5824ef8   Another child frame bug, add comment
   new  155af8d   Simplify


Summary of changes:
 corfu.el | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)



[elpa] externals/corfu 1acc028 1/4: corfu--make-frame: Apply frame/face settings only if changed (Fix #37)

2021-07-16 Thread ELPA Syncer
branch: externals/corfu
commit 1acc02809b204d38be2d72ac4ffa96a06ef0c45b
Author: Daniel Mendler 
Commit: Daniel Mendler 

corfu--make-frame: Apply frame/face settings only if changed (Fix #37)
---
 corfu.el | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/corfu.el b/corfu.el
index ebb1d21..5abe8f6 100644
--- a/corfu.el
+++ b/corfu.el
@@ -319,12 +319,17 @@ filter string with spaces is allowed."
 (internal-border-width
  . ,(alist-get 'child-frame-border-width 
corfu--frame-parameters))
 ,@corfu--frame-parameters
-(set-face-background
- (if (facep 'child-frame-border) 'child-frame-border 'internal-border)
- (face-attribute 'corfu-border :background) corfu--frame)
-(set-frame-parameter
- corfu--frame 'background-color
- (face-attribute 'corfu-background :background))
+;;; Setting the same frame-parameter/face-background is not a nop (bug?).
+;;; Check explicitly before applying the setting.
+(let* ((curr (frame-parameter corfu--frame 'background-color))
+  (new (face-attribute 'corfu-background :background)))
+  (unless (equal curr new)
+   (set-frame-parameter corfu--frame 'background-color new)))
+(let* ((face (if (facep 'child-frame-border) 'child-frame-border 
'internal-border))
+  (curr (face-attribute face :background corfu--frame))
+  (new (face-attribute 'corfu-border :background)))
+  (unless (equal curr new)
+   (set-face-background face new corfu--frame)))
 (set-window-buffer (frame-root-window corfu--frame) buffer)
 ;; XXX HACK Make the frame invisible before moving the popup from above to 
below the line in
 ;; order to avoid flicker.



[elpa] externals/corfu e335a13 2/4: Revert "corfu--make-frame: Apply frame/face settings only if changed (Fix #37)"

2021-07-16 Thread ELPA Syncer
branch: externals/corfu
commit e335a13cfe5a61925f1cc025d61f5f1199390216
Author: Daniel Mendler 
Commit: Daniel Mendler 

Revert "corfu--make-frame: Apply frame/face settings only if changed (Fix 
#37)"

This reverts commit 1acc02809b204d38be2d72ac4ffa96a06ef0c45b.
---
 corfu.el | 17 ++---
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/corfu.el b/corfu.el
index 5abe8f6..ebb1d21 100644
--- a/corfu.el
+++ b/corfu.el
@@ -319,17 +319,12 @@ filter string with spaces is allowed."
 (internal-border-width
  . ,(alist-get 'child-frame-border-width 
corfu--frame-parameters))
 ,@corfu--frame-parameters
-;;; Setting the same frame-parameter/face-background is not a nop (bug?).
-;;; Check explicitly before applying the setting.
-(let* ((curr (frame-parameter corfu--frame 'background-color))
-  (new (face-attribute 'corfu-background :background)))
-  (unless (equal curr new)
-   (set-frame-parameter corfu--frame 'background-color new)))
-(let* ((face (if (facep 'child-frame-border) 'child-frame-border 
'internal-border))
-  (curr (face-attribute face :background corfu--frame))
-  (new (face-attribute 'corfu-border :background)))
-  (unless (equal curr new)
-   (set-face-background face new corfu--frame)))
+(set-face-background
+ (if (facep 'child-frame-border) 'child-frame-border 'internal-border)
+ (face-attribute 'corfu-border :background) corfu--frame)
+(set-frame-parameter
+ corfu--frame 'background-color
+ (face-attribute 'corfu-background :background))
 (set-window-buffer (frame-root-window corfu--frame) buffer)
 ;; XXX HACK Make the frame invisible before moving the popup from above to 
below the line in
 ;; order to avoid flicker.



[elpa] externals/corfu 5824ef8 3/4: Another child frame bug, add comment

2021-07-16 Thread ELPA Syncer
branch: externals/corfu
commit 5824ef853e8cde6beab8edf6e550680f894512cb
Author: Daniel Mendler 
Commit: Daniel Mendler 

Another child frame bug, add comment
---
 corfu.el | 19 +--
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/corfu.el b/corfu.el
index ebb1d21..2fe8f35 100644
--- a/corfu.el
+++ b/corfu.el
@@ -319,12 +319,19 @@ filter string with spaces is allowed."
 (internal-border-width
  . ,(alist-get 'child-frame-border-width 
corfu--frame-parameters))
 ,@corfu--frame-parameters
-(set-face-background
- (if (facep 'child-frame-border) 'child-frame-border 'internal-border)
- (face-attribute 'corfu-border :background) corfu--frame)
-(set-frame-parameter
- corfu--frame 'background-color
- (face-attribute 'corfu-background :background))
+;; XXX HACK Setting the same frame-parameter/face-background is not a nop 
(BUG!).
+;; Check explicitly before applying the setting.
+;; Without the check, the frame flickers on Mac.
+;; With the check, the inner frame sometimes does not get updated 
sometimes (BUG!).
+(let* ((curr (frame-parameter corfu--frame 'background-color))
+  (new (face-attribute 'corfu-background :background)))
+  (unless (equal curr new)
+   (set-frame-parameter corfu--frame 'background-color new)))
+(let* ((face (if (facep 'child-frame-border) 'child-frame-border 
'internal-border))
+  (curr (face-attribute face :background corfu--frame))
+  (new (face-attribute 'corfu-border :background)))
+  (unless (equal curr new)
+   (set-face-background face new corfu--frame)))
 (set-window-buffer (frame-root-window corfu--frame) buffer)
 ;; XXX HACK Make the frame invisible before moving the popup from above to 
below the line in
 ;; order to avoid flicker.



[elpa] externals/corfu 155af8d 4/4: Simplify

2021-07-16 Thread ELPA Syncer
branch: externals/corfu
commit 155af8de3e75f442beaf2bc1b44b9abcbc367ff0
Author: Daniel Mendler 
Commit: Daniel Mendler 

Simplify
---
 corfu.el | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/corfu.el b/corfu.el
index 2fe8f35..4417154 100644
--- a/corfu.el
+++ b/corfu.el
@@ -323,14 +323,12 @@ filter string with spaces is allowed."
 ;; Check explicitly before applying the setting.
 ;; Without the check, the frame flickers on Mac.
 ;; With the check, the inner frame sometimes does not get updated 
sometimes (BUG!).
-(let* ((curr (frame-parameter corfu--frame 'background-color))
-  (new (face-attribute 'corfu-background :background)))
-  (unless (equal curr new)
+(let ((new (face-attribute 'corfu-background :background)))
+  (unless (equal (frame-parameter corfu--frame 'background-color) new)
(set-frame-parameter corfu--frame 'background-color new)))
 (let* ((face (if (facep 'child-frame-border) 'child-frame-border 
'internal-border))
-  (curr (face-attribute face :background corfu--frame))
   (new (face-attribute 'corfu-border :background)))
-  (unless (equal curr new)
+  (unless (equal (face-attribute face :background corfu--frame) new)
(set-face-background face new corfu--frame)))
 (set-window-buffer (frame-root-window corfu--frame) buffer)
 ;; XXX HACK Make the frame invisible before moving the popup from above to 
below the line in