diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2024-03-26 03:42:10 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2024-03-26 03:42:19 +0100 |
| commit | 7dc4fb2e4138fdd74b6d566e4e196c0f120751f9 (patch) | |
| tree | 8579b51d057348a1edc891bdd0ed3d08dddcd33e | |
| parent | 46c5ec84e096b852229b32f054462f0a63abfeb5 (diff) | |
Minor cleanup
| -rw-r--r-- | corfu.el | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -425,17 +425,16 @@ length override, set to t for manual completion." (defvar x-gtk-resize-child-frames) ;; Not present on non-gtk builds (defvar corfu--gtk-resize-child-frames (let ((case-fold-search t)) - (and ;; XXX HACK to fix resizing on gtk3/gnome taken from posframe.el ;; More information: ;; * https://github.com/minad/corfu/issues/17 ;; * https://gitlab.gnome.org/GNOME/mutter/-/issues/840 ;; * https://lists.gnu.org/archive/html/emacs-devel/2020-02/msg00001.html - (string-match-p "gtk3" system-configuration-features) - (string-match-p "gnome\\|cinnamon" - (or (getenv "XDG_CURRENT_DESKTOP") - (getenv "DESKTOP_SESSION") "")) - 'resize-mode))) + (and (string-match-p "gtk3" system-configuration-features) + (string-match-p "gnome\\|cinnamon" + (or (getenv "XDG_CURRENT_DESKTOP") + (getenv "DESKTOP_SESSION") "")) + 'resize-mode))) ;; Function adapted from posframe.el by tumashu (defun corfu--make-frame (frame x y width height buffer) @@ -710,12 +709,11 @@ FRAME is the existing frame." (defun corfu--match-symbol-p (pattern sym) "Return non-nil if SYM is matching an element of the PATTERN list." - (and (symbolp sym) - (cl-loop with case-fold-search = nil - for x in pattern - thereis (if (symbolp x) - (eq sym x) - (string-match-p x (symbol-name sym)))))) + (cl-loop with case-fold-search = nil + for x in (and (symbolp sym) pattern) + thereis (if (symbolp x) + (eq sym x) + (string-match-p x (symbol-name sym))))) (defun corfu--metadata-get (prop) "Return PROP from completion metadata." |
