diff options
-rw-r--r-- | lisp/emacs-lisp/byte-run.el | 1 | ||||
-rw-r--r-- | src/data.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 69b4f41fef6..9d2a048f365 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -240,6 +240,7 @@ The return value is undefined. ;; from ;; (defun foo (arg) (toto)). (declare (doc-string 3) (indent 2)) + (or name (error "Cannot define '%s' as a function" name)) (if (null (and (listp arglist) (null (delq t (mapcar #'symbolp arglist))))) diff --git a/src/data.c b/src/data.c index 09d94f57a8e..52cfe4ae4a3 100644 --- a/src/data.c +++ b/src/data.c @@ -733,6 +733,9 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, { register Lisp_Object function; CHECK_SYMBOL (symbol); + /* Perhaps not quite the right error signal, but seems good enough. */ + if (NILP (symbol)) + xsignal1 (Qsetting_constant, symbol); function = XSYMBOL (symbol)->function; |