diff options
| author | Richard M. Stallman | 1994-01-11 07:21:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-01-11 07:21:47 +0000 |
| commit | 2abcddce3b79d0efd6e9537e9a2fb420af0ab863 (patch) | |
| tree | 64fc003cf058f949bbd91c66b7295ecafed3bc17 | |
| parent | 2ea6d561514f14c7c4d3479c9cf2b2d793c34ff1 (diff) | |
| download | emacs-2abcddce3b79d0efd6e9537e9a2fb420af0ab863.tar.gz emacs-2abcddce3b79d0efd6e9537e9a2fb420af0ab863.zip | |
(byte-compile-condition-case): Disable warning about
symbol not naming a condition. Allow a list of condition names.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index cfb4251c725..dc4476866f1 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -2681,16 +2681,24 @@ If FORM is a lambda or a macro, byte-compile it as a function." | |||
| 2681 | (while clauses | 2681 | (while clauses |
| 2682 | (let* ((clause (car clauses)) | 2682 | (let* ((clause (car clauses)) |
| 2683 | (condition (car clause))) | 2683 | (condition (car clause))) |
| 2684 | (cond ((not (symbolp condition)) | 2684 | (cond ((not (or (symbolp condition) |
| 2685 | (and (listp condition) | ||
| 2686 | (let ((syms condition) (ok t)) | ||
| 2687 | (while syms | ||
| 2688 | (if (not (symbolp (car syms))) | ||
| 2689 | (setq ok nil)) | ||
| 2690 | (setq syms (cdr syms))) | ||
| 2691 | ok)))) | ||
| 2685 | (byte-compile-warn | 2692 | (byte-compile-warn |
| 2686 | "%s is not a symbol naming a condition (in condition-case)" | 2693 | "%s is not a condition name or list of such (in condition-case)" |
| 2687 | (prin1-to-string condition))) | 2694 | (prin1-to-string condition))) |
| 2688 | ((not (or (eq condition 't) | 2695 | ;; ((not (or (eq condition 't) |
| 2689 | (and (stringp (get condition 'error-message)) | 2696 | ;; (and (stringp (get condition 'error-message)) |
| 2690 | (consp (get condition 'error-conditions))))) | 2697 | ;; (consp (get condition 'error-conditions))))) |
| 2691 | (byte-compile-warn | 2698 | ;; (byte-compile-warn |
| 2692 | "%s is not a known condition name (in condition-case)" | 2699 | ;; "%s is not a known condition name (in condition-case)" |
| 2693 | condition))) | 2700 | ;; condition)) |
| 2701 | ) | ||
| 2694 | (setq compiled-clauses | 2702 | (setq compiled-clauses |
| 2695 | (cons (cons condition | 2703 | (cons (cons condition |
| 2696 | (byte-compile-top-level-body | 2704 | (byte-compile-top-level-body |