diff options
| author | Noam Postavsky | 2017-12-04 20:01:40 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2017-12-11 17:38:28 -0500 |
| commit | 51911dae14ecaf6c6eb22641c3189c6fa97ab24a (patch) | |
| tree | 20a25e80004d4fe4746f08398940d71a4a91cdf8 | |
| parent | a36a090a951371e3441f33ad4d42e6ea17b30432 (diff) | |
| download | emacs-51911dae14ecaf6c6eb22641c3189c6fa97ab24a.tar.gz emacs-51911dae14ecaf6c6eb22641c3189c6fa97ab24a.zip | |
Suppress warnings during elisp completion macroexpansion
Errors are already suppressed, therefore it is logical to suppress
warnings as well. Some macros (e.g., use-package) may produce
warnings when given the `elisp--witness--lisp' symbol.
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Let-bind
warning-minimum-log-level to :emergency.
| -rw-r--r-- | lisp/progmodes/elisp-mode.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 5ba09789097..4207edb8af5 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el | |||
| @@ -307,6 +307,8 @@ Blank lines separate paragraphs. Semicolons start comments. | |||
| 307 | (setq sexp (ignore-errors (butlast sexp))))) | 307 | (setq sexp (ignore-errors (butlast sexp))))) |
| 308 | res)) | 308 | res)) |
| 309 | 309 | ||
| 310 | (defvar warning-minimum-log-level) | ||
| 311 | |||
| 310 | (defun elisp--local-variables () | 312 | (defun elisp--local-variables () |
| 311 | "Return a list of locally let-bound variables at point." | 313 | "Return a list of locally let-bound variables at point." |
| 312 | (save-excursion | 314 | (save-excursion |
| @@ -328,7 +330,7 @@ Blank lines separate paragraphs. Semicolons start comments. | |||
| 328 | (error form)))) | 330 | (error form)))) |
| 329 | (sexp | 331 | (sexp |
| 330 | (unwind-protect | 332 | (unwind-protect |
| 331 | (progn | 333 | (let ((warning-minimum-log-level :emergency)) |
| 332 | (advice-add 'macroexpand :around macroexpand-advice) | 334 | (advice-add 'macroexpand :around macroexpand-advice) |
| 333 | (macroexpand-all sexp)) | 335 | (macroexpand-all sexp)) |
| 334 | (advice-remove 'macroexpand macroexpand-advice))) | 336 | (advice-remove 'macroexpand macroexpand-advice))) |