Skip to content

Commit

Permalink
auto-compile--tree-member: Handle non-list root element
Browse files Browse the repository at this point in the history
A top-level mode line construct may itself be something
other than a list (most likely a string).

Closes #31.
Closes #32.
  • Loading branch information
tarsius committed Jun 15, 2023
1 parent 36646df commit 18b0070
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions auto-compile.el
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ non-nil."

(defun auto-compile--tree-member (elt tree)
;; Also known as keycast--tree-member.
(or (member elt tree)
(catch 'found
(dolist (sub tree)
(when-let ((found (and (listp sub)
(auto-compile--tree-member elt sub))))
(throw 'found found))))))
(and (listp tree)
(or (member elt tree)
(catch 'found
(dolist (sub tree)
(when-let ((found (auto-compile--tree-member elt sub)))
(throw 'found found)))))))

(defun auto-compile-modify-mode-line (after)
(let ((format (default-value 'mode-line-format)))
Expand Down

0 comments on commit 18b0070

Please sign in to comment.