dgnushack.el (byte-optimize-apply)
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 13 Oct 2010 05:37:18 +0000 (05:37 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 13 Oct 2010 05:37:18 +0000 (05:37 +0000)
gnus-dired.el (gnus-dired-attach): Silence XEmacs 21.5 when compiling.

lisp/ChangeLog
lisp/dgnushack.el
lisp/gnus-dired.el

index db91bd9..5b7112c 100644 (file)
@@ -1,5 +1,8 @@
 2010-10-13  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * dgnushack.el (byte-optimize-apply)
+       * gnus-dired.el (gnus-dired-attach): Silence XEmacs 21.5 when compiling.
+
        * gnus-gravatar.el (gnus-gravatar-transform-address): Adjust avatars'
        position when (X-)Faces exist.
        (gnus-treat-from-gravatar, gnus-treat-mail-gravatar): Force displaying
index 7bcb49c..42f0b87 100644 (file)
@@ -237,6 +237,16 @@ in `defcustom' forms."
   (maybe-fbind '(defined-colors face-attribute))
   (maybe-bind '(idna-program installation-directory)))
 
+(when (featurep 'xemacs)
+  (defadvice byte-optimize-apply (before use-mapcan (form) activate)
+    "Replace (apply 'nconc (mapcar ...)) with (mapcan ...)."
+    (let ((last (nth (1- (length form)) form)))
+      (when (and (eq last (third form))
+                (consp last)
+                (eq 'mapcar (car last))
+                (equal (nth 1 form) ''nconc))
+       (setq form (cons 'mapcan (cdr last)))))))
+
 (defun dgnushack-compile-verbosely ()
   "Call dgnushack-compile with warnings ENABLED.  If you are compiling
 patches to gnus, you should consider modifying make.bat to call
index da20c66..a12046f 100644 (file)
@@ -133,7 +133,9 @@ filenames."
          (mapcar
           ;; don't attach directories
           (lambda (f) (if (file-directory-p f) nil f))
-          (nreverse (dired-map-over-marks (dired-get-filename) nil))))))
+          (nreverse
+           (let ((arg nil)) ;; Silence XEmacs 21.5 when compiling.
+             (dired-map-over-marks (dired-get-filename) arg)))))))
   (let ((destination nil)
        (files-str nil)
        (bufs nil))