Cheng Gao <[EMAIL PROTECTED]> writes:

> Line 44-46:
> ,----
> | (eval-when-compile
> |   (require 'mm-decode)
> |   (require 'mm-view))
> `----
> But line 237-241:
> ,----
> | (defun url-mm-url (url)
> |   "Retrieve URL and pass to the appropriate viewing application."
> |   (require 'mm-decode)
> |   (require 'mm-view)
> |   (url-retrieve url 'url-mm-callback nil))
> `----
> mm-decode and mm-view are required again.
>
> Should the requires in function url-mm-url be removed?

require at run-time is a bad idea, and constructs like above with
eval-when-compile tend to create byte compiler warnings.  I think the
correct way to deal with this would be something like

(autoload 'url-retrieve 'mm-decode)
(defun url-mm-url (url)
  (url-retrieve url ...

That way, the byte compiler is satisfied, and no runtime performance
hit is scored by unneeded requires.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to