diff options
| author | Alan Mackenzie | 2015-11-23 13:56:37 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2015-11-23 13:56:37 +0000 |
| commit | 2b8154f2bc1ad678fdb8e4677cf25359251d5c01 (patch) | |
| tree | 6c52f15cad081b92e7a76ce5897b215c93ad093d /src/eval.c | |
| parent | 3264a26dd26313ae172e7aff3a9b96f307ffd95c (diff) | |
| download | emacs-2b8154f2bc1ad678fdb8e4677cf25359251d5c01.tar.gz emacs-2b8154f2bc1ad678fdb8e4677cf25359251d5c01.zip | |
Signal an error when `setq' has an odd number of arguments. Fixes bug#20241.
* src/eval.c (Fsetq): Signal an error on an odd number of arguments.
(syms_of_eval): Add a DEFSYM for Qsetq.
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index 023c2ef6aab..d04796abc3a 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -487,6 +487,10 @@ usage: (setq [SYM VAL]...) */) | |||
| 487 | if (CONSP (args)) | 487 | if (CONSP (args)) |
| 488 | { | 488 | { |
| 489 | Lisp_Object args_left = args; | 489 | Lisp_Object args_left = args; |
| 490 | Lisp_Object numargs = Flength (args); | ||
| 491 | |||
| 492 | if (XINT (numargs) & 1) | ||
| 493 | xsignal2 (Qwrong_number_of_arguments, Qsetq, numargs); | ||
| 490 | 494 | ||
| 491 | do | 495 | do |
| 492 | { | 496 | { |
| @@ -3654,6 +3658,7 @@ To prevent this happening, set `quit-flag' to nil | |||
| 3654 | before making `inhibit-quit' nil. */); | 3658 | before making `inhibit-quit' nil. */); |
| 3655 | Vinhibit_quit = Qnil; | 3659 | Vinhibit_quit = Qnil; |
| 3656 | 3660 | ||
| 3661 | DEFSYM (Qsetq, "setq"); | ||
| 3657 | DEFSYM (Qinhibit_quit, "inhibit-quit"); | 3662 | DEFSYM (Qinhibit_quit, "inhibit-quit"); |
| 3658 | DEFSYM (Qautoload, "autoload"); | 3663 | DEFSYM (Qautoload, "autoload"); |
| 3659 | DEFSYM (Qinhibit_debugger, "inhibit-debugger"); | 3664 | DEFSYM (Qinhibit_debugger, "inhibit-debugger"); |