[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 c89b5a0: Issue a warning from the byte compiler o
From: |
Alan Mackenzie |
Subject: |
[Emacs-diffs] emacs-25 c89b5a0: Issue a warning from the byte compiler on a malformed `setq' form. |
Date: |
Mon, 23 Nov 2015 14:26:54 +0000 |
branch: emacs-25
commit c89b5a0f8a3905c023eb196e453383c95a4f6a89
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>
Issue a warning from the byte compiler on a malformed `setq' form.
Partly fixes bug#20241.
* lisp/emacs-lisp/bytecomp.el (byte-compile-setq): Issue a warning when a
`setq' form with an odd number of arguments is compiled.
---
lisp/emacs-lisp/bytecomp.el | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 0247191..fc3bfc5 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3713,7 +3713,11 @@ discarding."
(let ((args (cdr form)))
(if args
(while args
- (byte-compile-form (car (cdr args)))
+ (if (eq (length args) 1)
+ (byte-compile-warn
+ "missing value for `%S' at end of setq"
+ (car args)))
+ (byte-compile-form (car (cdr args)))
(or byte-compile--for-effect (cdr (cdr args))
(byte-compile-out 'byte-dup 0))
(byte-compile-variable-set (car args))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 c89b5a0: Issue a warning from the byte compiler on a malformed `setq' form.,
Alan Mackenzie <=