Make +popup/diagnose output result

Rather than succeed silently.
This commit is contained in:
Henrik Lissner 2020-05-03 16:25:17 -04:00
parent 2c70b75c6c
commit 0904ee406f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -436,13 +436,14 @@ window and return that window."
(defun +popup/diagnose () (defun +popup/diagnose ()
"Reveal what popup rule will be used for the current buffer." "Reveal what popup rule will be used for the current buffer."
(interactive) (interactive)
(or (cl-loop with bname = (buffer-name) (if-let (rule (cl-loop with bname = (buffer-name)
for (pred . action) in display-buffer-alist for (pred . action) in display-buffer-alist
if (and (functionp pred) (funcall pred bname action)) if (and (functionp pred) (funcall pred bname action))
return (cons pred action) return (cons pred action)
else if (and (stringp pred) (string-match-p pred bname)) else if (and (stringp pred) (string-match-p pred bname))
return (cons pred action)) return (cons pred action)))
(message "No popup rule for this buffer"))) (message "Rule matches: %s" rule)
(message "No popup rule for this buffer")))
;; ;;