emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog progmodes/gdb-mi.el


From: Dmitry Dzhus
Subject: [Emacs-diffs] emacs/lisp ChangeLog progmodes/gdb-mi.el
Date: Mon, 24 Aug 2009 19:12:50 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Dmitry Dzhus <sphinx>   09/08/24 19:12:50

Modified files:
        lisp           : ChangeLog 
        lisp/progmodes : gdb-mi.el 

Log message:
        (gdb-mapcar*): Replacement for `mapcar*'
        from cl package.
        (gdb-table-add-row, gdb-table-string): Use `gdb-mapcar*'.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16003&r2=1.16004
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/gdb-mi.el?cvsroot=emacs&r1=1.35&r2=1.36

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16003
retrieving revision 1.16004
diff -u -b -r1.16003 -r1.16004
--- ChangeLog   24 Aug 2009 18:43:50 -0000      1.16003
+++ ChangeLog   24 Aug 2009 19:12:46 -0000      1.16004
@@ -1,3 +1,9 @@
+2009-08-24  Dmitry Dzhus  <address@hidden>
+
+       * progmodes/gdb-mi.el (gdb-mapcar*): Replacement for `mapcar*'
+       from cl package.
+       (gdb-table-add-row, gdb-table-string): Use `gdb-mapcar*'.
+
 2009-08-24  Jay Belanger  <address@hidden>
 
        * calc/calc-alg.el (math-trig-rewrite)

Index: progmodes/gdb-mi.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/gdb-mi.el,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- progmodes/gdb-mi.el 13 Aug 2009 13:22:11 -0000      1.35
+++ progmodes/gdb-mi.el 24 Aug 2009 19:12:50 -0000      1.36
@@ -2119,6 +2119,20 @@
   (row-properties nil)
   (right-align nil))
 
+(defun gdb-mapcar* (function &rest seqs)
+  "Apply FUNCTION to each element of SEQS, and make a list of the results.
+If there are several SEQS, FUNCTION is called with that many
+arugments, and mapping stops as sson as the shortest list runs
+out."
+  (let ((shortest (apply #'min (mapcar #'length seqs))))
+    (mapcar (lambda (i)
+              (apply function
+                     (mapcar
+                      (lambda (seq)
+                        (nth i seq))
+                      seqs)))
+            (number-sequence 0 (1- shortest)))))
+
 (defun gdb-table-add-row (table row &optional properties)
   "Add ROW of string to TABLE and recalculate column sizes.
 
@@ -2136,7 +2150,7 @@
     (setf (gdb-table-row-properties table)
           (append row-properties (list properties)))
     (setf (gdb-table-column-sizes table)
-          (mapcar* (lambda (x s)
+          (gdb-mapcar* (lambda (x s)
                      (let ((new-x
                             (max (abs x) (string-width (or s "")))))
                        (if right-align new-x (- new-x))))
@@ -2152,11 +2166,11 @@
         (res ""))
     (mapconcat
      'identity
-     (mapcar*
+     (gdb-mapcar*
       (lambda (row properties)
         (apply 'propertize
                (mapconcat 'identity
-                          (mapcar* (lambda (s x) (gdb-pad-string s x))
+                          (gdb-mapcar* (lambda (s x) (gdb-pad-string s x))
                                    row column-sizes)
                           sep)
                properties))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]