From 57d54bb49ddddf91a94a5aba4cb20899665653ac Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 4 Nov 2021 19:23:07 +0100 Subject: [PATCH] Improve defface error message * lisp/cus-face.el (custom-declare-face): Improve the error message when there's a missing doc string (bug#51576). --- lisp/cus-face.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 6c0052bf860..5037ee77c7c 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -31,6 +31,9 @@ (defun custom-declare-face (face spec doc &rest args) "Like `defface', but with FACE evaluated as a normal argument." + (when (and doc + (not (stringp doc))) + (error "Invalid (or missing) doc string %S" doc)) (unless (get face 'face-defface-spec) (face-spec-set face (purecopy spec) 'face-defface-spec) (push (cons 'defface face) current-load-list) -- 2.39.2