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

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

[nongnu] elpa/iwindow 16c6c97143 09/13: Don't error when PREDICATE is ni


From: ELPA Syncer
Subject: [nongnu] elpa/iwindow 16c6c97143 09/13: Don't error when PREDICATE is nil
Date: Sun, 27 Nov 2022 16:01:12 -0500 (EST)

branch: elpa/iwindow
commit 16c6c971431b4a7303d374c5afa51b10427af6ab
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Don't error when PREDICATE is nil
---
 iwindow.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/iwindow.el b/iwindow.el
index b06464f51a..c808bd26f9 100644
--- a/iwindow.el
+++ b/iwindow.el
@@ -99,14 +99,15 @@ CALLBACK and revert the changes it has done."
 (defun iwindow--make-decision-tree (windows start end predicate)
   "Make a decision tree from window in WINDOWS from START to END.
 
-Don't include windows for which PREDICATE returns nil.
+Don't include windows for which PREDICATE returns nil, if PREDICATE is
+non-nil.
 
 Return an object OPTION, where OPTION is either a window, nil, or a
 list of form (OPTION...), whose length of no more than the length of
 `iwindow-selection-keys'."
   (if (= (- end start) 1)
       (let ((window (aref windows start)))
-        (when (funcall predicate window)
+        (when (or (not predicate) (funcall predicate window))
           window))
     (let ((result nil)
           (option-count (length iwindow-selection-keys)))



reply via email to

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