Gnus development mailing list
 help / color / mirror / Atom feed
* `reduce', a cl function, used in shr.el
@ 2010-10-08  1:02 Katsumi Yamaoka
  2010-10-08  1:15 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Katsumi Yamaoka @ 2010-10-08  1:02 UTC (permalink / raw)
  To: ding

Is this ok?

--- shr.el~	2010-10-07 22:00:24 +0000
+++ shr.el	2010-10-08 01:01:35 +0000
@@ -548,8 +548,8 @@
 	  (aset natural-widths i (max (aref natural-widths i)
 				      (cadr column)))
 	  (setq i (1+ i)))))
-    (let ((extra (- (reduce '+ suggested-widths)
-		    (reduce '+ widths)))
+    (let ((extra (- (apply '+ (append suggested-widths nil))
+		    (apply '+ (append widths nil))))
 	  (expanded-columns 0))
       (when (> extra 0)
 	(dotimes (i length)

The following is `reduce' from which the cl keywords feature is
removed; same as `(apply FUNCTION (append SEQ nil))':

(defun shr-reduce (function seq)
  "Reduce two-argument FUNCTION across SEQ."
  (or (listp seq) (setq seq (append seq nil)))
  (let ((accum (pop seq)))
    (while seq
      (setq accum (funcall function accum (pop seq))))
    accum))



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

* Re: `reduce', a cl function, used in shr.el
  2010-10-08  1:02 `reduce', a cl function, used in shr.el Katsumi Yamaoka
@ 2010-10-08  1:15 ` Lars Magne Ingebrigtsen
  2010-10-08  1:26   ` Katsumi Yamaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-08  1:15 UTC (permalink / raw)
  To: ding

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> Is this ok?

[...]

> +    (let ((extra (- (apply '+ (append suggested-widths nil))

Yes, that should be fine.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: `reduce', a cl function, used in shr.el
  2010-10-08  1:15 ` Lars Magne Ingebrigtsen
@ 2010-10-08  1:26   ` Katsumi Yamaoka
  0 siblings, 0 replies; 3+ messages in thread
From: Katsumi Yamaoka @ 2010-10-08  1:26 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen wrote:
> Katsumi Yamaoka <yamaoka@jpl.org> writes:
>> +    (let ((extra (- (apply '+ (append suggested-widths nil))

> Yes, that should be fine.

Pushed.  Thanks.



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

end of thread, other threads:[~2010-10-08  1:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-08  1:02 `reduce', a cl function, used in shr.el Katsumi Yamaoka
2010-10-08  1:15 ` Lars Magne Ingebrigtsen
2010-10-08  1:26   ` Katsumi Yamaoka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).