From 1b304141f3ff61d06da8d57a029e8986a81e3856 Mon Sep 17 00:00:00 2001 From: Vasilij Schneidermann Date: Thu, 23 Nov 2017 09:06:34 +0100 Subject: [PATCH] Detect dotted lists and don't walk them --- eyebrowse.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eyebrowse.el b/eyebrowse.el index e1bb701..9bd5676 100644 --- a/eyebrowse.el +++ b/eyebrowse.el @@ -252,13 +252,18 @@ This function keeps the sortedness intact." "Returns a window config list appliable for SLOT." (list slot (window-state-get nil t) tag)) +(defun eyebrowse--dotted-list-p (list) + "Non-nil if LIST is terminated by a non-nil value." + (cdr (last list))) + (defun eyebrowse--walk-window-config (window-config function) "Walk through WINDOW-CONFIG and apply FUNCTION to each leaf." (dolist (item window-config) (when (consp item) (when (symbolp (car item)) (funcall function item)) - (when (consp (cdr item)) + (when (and (consp (cdr item)) + (not (eyebrowse--dotted-list-p (cdr item)))) (eyebrowse--walk-window-config (cdr item) function))))) (defun eyebrowse--fixup-window-config (window-config)