diff options
| author | Richard M. Stallman | 2005-07-08 22:49:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-07-08 22:49:47 +0000 |
| commit | 82a726b4eea413c3cb05f4657eaea92818461282 (patch) | |
| tree | e20d73d9b1970477106013863c538a9736b6c5c5 | |
| parent | 185d43ee89e50224fb73b317ee739ac58e6fd6f8 (diff) | |
| download | emacs-82a726b4eea413c3cb05f4657eaea92818461282.tar.gz emacs-82a726b4eea413c3cb05f4657eaea92818461282.zip | |
(byte-compile-maybe-guarded): Check for (featurep 'xemacs) and turn
off warnings in what it guards. Use unwind-protect to ensure
byte-compile-unresolved-functions is updated.
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index bbb98364a0d..36ce227df91 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -3351,11 +3351,14 @@ That command is designed for interactive use only" fn)) | |||
| 3351 | 3351 | ||
| 3352 | (defmacro byte-compile-maybe-guarded (condition &rest body) | 3352 | (defmacro byte-compile-maybe-guarded (condition &rest body) |
| 3353 | "Execute forms in BODY, potentially guarded by CONDITION. | 3353 | "Execute forms in BODY, potentially guarded by CONDITION. |
| 3354 | CONDITION is the test in an `if' form or in a `cond' clause. | 3354 | CONDITION is a variable whose value is a test in an `if' or `cond'. |
| 3355 | BODY is to compile the first arm of the if or the body of the | 3355 | BODY is the code to compile first arm of the if or the body of the |
| 3356 | cond clause. If CONDITION is of the form `(foundp 'foo)' | 3356 | cond clause. If CONDITION's value is of the form `(foundp 'foo)' |
| 3357 | or `(boundp 'foo)', the relevant warnings from BODY about foo | 3357 | or `(boundp 'foo)', the relevant warnings from BODY about foo |
| 3358 | being undefined will be suppressed." | 3358 | being undefined will be suppressed. |
| 3359 | |||
| 3360 | If CONDITION's value is `(featurep 'xemacs)', that suppresses all | ||
| 3361 | warnings during execution of BODY." | ||
| 3359 | (declare (indent 1) (debug t)) | 3362 | (declare (indent 1) (debug t)) |
| 3360 | `(let* ((fbound | 3363 | `(let* ((fbound |
| 3361 | (if (eq 'fboundp (car-safe ,condition)) | 3364 | (if (eq 'fboundp (car-safe ,condition)) |
| @@ -3373,13 +3376,17 @@ being undefined will be suppressed." | |||
| 3373 | (byte-compile-bound-variables | 3376 | (byte-compile-bound-variables |
| 3374 | (if bound | 3377 | (if bound |
| 3375 | (cons bound byte-compile-bound-variables) | 3378 | (cons bound byte-compile-bound-variables) |
| 3376 | byte-compile-bound-variables))) | 3379 | byte-compile-bound-variables)) |
| 3377 | (progn ,@body) | 3380 | (byte-compile-warnings |
| 3378 | ;; Maybe remove the function symbol from the unresolved list. | 3381 | (if (equal ,condition '(featurep 'xemacs)) |
| 3379 | (if fbound | 3382 | nil byte-compile-warnings))) |
| 3380 | (setq byte-compile-unresolved-functions | 3383 | (unwind-protect |
| 3381 | (delq (assq fbound byte-compile-unresolved-functions) | 3384 | (progn ,@body) |
| 3382 | byte-compile-unresolved-functions))))) | 3385 | ;; Maybe remove the function symbol from the unresolved list. |
| 3386 | (if fbound | ||
| 3387 | (setq byte-compile-unresolved-functions | ||
| 3388 | (delq (assq fbound byte-compile-unresolved-functions) | ||
| 3389 | byte-compile-unresolved-functions)))))) | ||
| 3383 | 3390 | ||
| 3384 | (defun byte-compile-if (form) | 3391 | (defun byte-compile-if (form) |
| 3385 | (byte-compile-form (car (cdr form))) | 3392 | (byte-compile-form (car (cdr form))) |
| @@ -3420,12 +3427,12 @@ being undefined will be suppressed." | |||
| 3420 | (if (null (cdr clause)) | 3427 | (if (null (cdr clause)) |
| 3421 | ;; First clause is a singleton. | 3428 | ;; First clause is a singleton. |
| 3422 | (byte-compile-goto-if t for-effect donetag) | 3429 | (byte-compile-goto-if t for-effect donetag) |
| 3423 | (setq nexttag (byte-compile-make-tag)) | 3430 | (setq nexttag (byte-compile-make-tag)) |
| 3424 | (byte-compile-goto 'byte-goto-if-nil nexttag) | 3431 | (byte-compile-goto 'byte-goto-if-nil nexttag) |
| 3425 | (byte-compile-maybe-guarded (car clause) | 3432 | (byte-compile-maybe-guarded (car clause) |
| 3426 | (byte-compile-body (cdr clause) for-effect)) | 3433 | (byte-compile-body (cdr clause) for-effect)) |
| 3427 | (byte-compile-goto 'byte-goto donetag) | 3434 | (byte-compile-goto 'byte-goto donetag) |
| 3428 | (byte-compile-out-tag nexttag))))) | 3435 | (byte-compile-out-tag nexttag))))) |
| 3429 | ;; Last clause | 3436 | ;; Last clause |
| 3430 | (let ((guard (car clause))) | 3437 | (let ((guard (car clause))) |
| 3431 | (and (cdr clause) (not (eq guard t)) | 3438 | (and (cdr clause) (not (eq guard t)) |