all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Unexpected behavior byte-compiling (with-no-warnings (require...))
@ 2009-09-07 23:27 Juanma Barranquero
  2009-09-08  1:28 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Juanma Barranquero @ 2009-09-07 23:27 UTC (permalink / raw)
  To: Emacs developers

  ;; test.el
  (progn (require 'cl))

  (defun test1 (args)
    (destructuring-bind (one . two) args
      two))
  ;; end

Byte-compiling test.el gives this output:

  In toplevel form:
  test.el:2:1:Warning: cl package required at runtime
  Wrote c:/tmp/test.elc

Changing the require line to:

  (with-no-warnings (require 'cl))

the byte-compilation output is this:

  In toplevel form:
  test.el:4:15:Error: Wrong type argument: sequencep, two

Yes, I know that (progn (require ...)) does not make much sense; I
just did it to check that it works just as fine as a simple

  (require 'cl)

It does. However, with-no-warning does not.

Is there something obvious that I'm missing?

    Juanma




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unexpected behavior byte-compiling (with-no-warnings (require...))
  2009-09-07 23:27 Unexpected behavior byte-compiling (with-no-warnings (require...)) Juanma Barranquero
@ 2009-09-08  1:28 ` Glenn Morris
  2009-09-08  1:41   ` Juanma Barranquero
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2009-09-08  1:28 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Emacs developers

Juanma Barranquero wrote:

>   (with-no-warnings (require 'cl))
>
> the byte-compilation output is this:
>
>   In toplevel form:
>   test.el:4:15:Error: Wrong type argument: sequencep, two

Try this patch:

*** bytecomp.el.~2.257.~	2009-09-05 12:00:44.000000000 -0700
--- bytecomp.el	2009-09-07 18:03:35.000000000 -0700
***************
*** 2387,2392 ****
--- 2387,2400 ----
    ;; Return nil so the forms are not output twice.
    nil)
  
+ (put 'with-no-warnings 'byte-hunk-handler
+      'byte-compile-file-form-with-no-warnings)
+ (defun byte-compile-file-form-with-no-warnings (form)
+   ;; cf byte-compile-file-form-progn.
+   (let (byte-compile-warnings)
+     (mapc 'byte-compile-file-form (cdr form))
+     nil))
+ 
  ;; This handler is not necessary, but it makes the output from dont-compile
  ;; and similar macros cleaner.
  (put 'eval 'byte-hunk-handler 'byte-compile-file-form-eval)




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unexpected behavior byte-compiling (with-no-warnings  (require...))
  2009-09-08  1:28 ` Glenn Morris
@ 2009-09-08  1:41   ` Juanma Barranquero
  0 siblings, 0 replies; 3+ messages in thread
From: Juanma Barranquero @ 2009-09-08  1:41 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Emacs developers

On Tue, Sep 8, 2009 at 03:28, Glenn Morris<rgm@gnu.org> wrote:

> Try this patch:

Yeah, it works. Thanks.

    Juanma




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-08  1:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-07 23:27 Unexpected behavior byte-compiling (with-no-warnings (require...)) Juanma Barranquero
2009-09-08  1:28 ` Glenn Morris
2009-09-08  1:41   ` Juanma Barranquero

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.