Open josephmturner opened 1 year ago
Good catch - (cl-find-if (lambda (cell) (derived-mode-p (car cell))) topsy-mode-functions)
should be replaced with (cl-find-if #'derived-mode-p topsy-mode-functions :key #'car)
.
this patch would seem to not select the default function in unrecognized major modes
FWIW, the following does work since mode
will be bound to nil
when there's no match
(let ((mode (car (cl-find-if #'derived-mode-p topsy-mode-functions :key #'car))))
(setf topsy-fn (alist-get mode topsy-mode-functions)
header-line-format 'topsy-header-line-format))
But... it's obviously not as easy to read. Hope this last commit looks good. Thank you!
Hi Joseph,
This seems like a good idea, but this patch would seem to not select the default function in unrecognized major modes. I think the code should be more like this:
What do you think? Thanks.