From: Lars Ingebrigtsen Date: Thu, 4 Nov 2021 18:23:07 +0000 (+0100) Subject: Improve defface error message X-Git-Tag: emacs-29.0.90~3671^2~248 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=57d54bb49ddddf91a94a5aba4cb20899665653ac;p=emacs.git Improve defface error message * lisp/cus-face.el (custom-declare-face): Improve the error message when there's a missing doc string (bug#51576). --- 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)