autoloading eval-when forms
authorRobin Templeton <robin@terpri.org>
Tue, 12 Aug 2014 11:42:29 +0000 (07:42 -0400)
committerRobin Templeton <robin@terpri.org>
Mon, 20 Apr 2015 04:29:03 +0000 (00:29 -0400)
lisp/emacs-lisp/autoload.el

index 361e8fa..9bd7cc1 100644 (file)
@@ -127,7 +127,9 @@ expression, in which case we want to handle forms differently."
         ;; (message "autoload of %S" (nth 1 form))
         `(autoload ,(nth 1 form) ,file ,doc ,interactive ,type)))
 
-     ((and expansion (memq car '(progn prog1)))
+     ((and expansion
+           (or (memq car '(progn prog1))
+               (and (eq car 'eval-when) (setq form (cdr form)))))
       (let ((end (memq :autoload-end form)))
        (when end             ;Cut-off anything after the :autoload-end marker.
           (setq form (copy-sequence form))