[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.7.1-20110619-162-g7686d16)



The branch, master has been updated
       via  7686d165f994a3064032de749b7b44cec6794c55 (commit)
       via  9ab022fb196c38e00711148e590193ac423233aa (commit)
      from  d01b5fefe19ac2cd1ce5e84b0a3b866ca42033e3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/scheme/auto-uref.scm |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)


=================
 Commit Messages
=================

commit 7686d165f994a3064032de749b7b44cec6794c55
Author: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>

    auto-uref: align with new scheme-api

:100644 100644 69896b3... d3353d2... M	gschem/scheme/auto-uref.scm

commit 9ab022fb196c38e00711148e590193ac423233aa
Author: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>

    auto-uref: allow for empty refdes prefix
    
    Fix the case when regex in get-prefix does not match.
    
    Closes-bug: lp-804898

:100644 100644 fa77f3b... 69896b3... M	gschem/scheme/auto-uref.scm

=========
 Changes
=========

commit 7686d165f994a3064032de749b7b44cec6794c55
Author: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>

    auto-uref: align with new scheme-api

diff --git a/gschem/scheme/auto-uref.scm b/gschem/scheme/auto-uref.scm
index 69896b3..d3353d2 100644
--- a/gschem/scheme/auto-uref.scm
+++ b/gschem/scheme/auto-uref.scm
@@ -17,7 +17,11 @@
 ;; along with this program; if not, write to the Free Software
 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
-(use-modules (ice-9 regex) (srfi srfi-1))
+(use-modules (ice-9 regex)
+             (srfi srfi-1)
+             (geda page)
+             (geda attrib)
+             (gschem window))
 
 (define auto-uref-page-offset 0)
 
@@ -51,15 +55,13 @@
     (filter (lambda (a)
               (and
                 (not (attrib-inherited? a))
-                (string=? "refdes" (car (get-attribute-name-value a)))))
+                (string=? "refdes" (attrib-name a))))
             attribs))
 
   ; Extract numbers from refdeses that have given prefix
   (define (extract-numbers object prefix)
-    (let* ((refdeses (refdes-attrs (get-object-attributes object)))
-           (vals (map (lambda (a)
-                        (cdr (get-attribute-name-value a)))
-                      refdeses))
+    (let* ((refdeses (refdes-attrs (object-attribs object)))
+           (vals (map attrib-value refdeses))
            (prefix-numbers (filter-map split-value vals))
            (numbers (filter-map (lambda (n.v)
                                   (if (string=? prefix (car n.v))
@@ -70,7 +72,7 @@
 
   ; Collect all numbers associated with prefix on current page
   (define (collect-all-numbers prefix)
-    (let ((objects (get-objects-in-page (get-current-page))))
+    (let ((objects (page-contents (active-page))))
       (concatenate (map (lambda (o)
                           (extract-numbers o prefix))
                         objects))))
@@ -90,7 +92,7 @@
                      #f
                      (car refdeses)))
          (prefix (if refdes
-                     (get-prefix (cdr (get-attribute-name-value refdes)))
+                     (get-prefix (attrib-value refdes))
                      #f)))
     (if prefix
         (let* ((used-nums (sort-list (collect-all-numbers prefix) <))
@@ -108,7 +110,7 @@
           ;                  prefix
           ;                  used-nums
           ;                  next-num)
-          (set-attribute-value!
+          (set-attrib-value!
             refdes
             (string-append prefix (number->string next-num)))))))
 

commit 9ab022fb196c38e00711148e590193ac423233aa
Author: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Krzysztof KoÅ?ciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>

    auto-uref: allow for empty refdes prefix
    
    Fix the case when regex in get-prefix does not match.
    
    Closes-bug: lp-804898

diff --git a/gschem/scheme/auto-uref.scm b/gschem/scheme/auto-uref.scm
index fa77f3b..69896b3 100644
--- a/gschem/scheme/auto-uref.scm
+++ b/gschem/scheme/auto-uref.scm
@@ -35,18 +35,16 @@
 
   ; Return (prefix . number) on match or #f on failure
   (define (split-value value)
-    (let ((match (string-match "^([A-Za-z]+)([0-9]+)$" value)))
+    (let ((match (string-match "^([A-Za-z]*)([0-9]+)$" value)))
       (if match
-        (cons (match:substring match 1)
-              (string->number (match:substring match 2)))
-        #f)))
+          (cons (match:substring match 1)
+                (string->number (match:substring match 2)))
+          #f)))
 
   ; Extract prefix from a refdes attribute value
   (define (get-prefix value)
-    (let ((prefix (string-match "^[A-Za-z]+" value)))
-      (if (= 0 (match:end prefix))
-	  #f
-	  (match:substring prefix))))
+    (let ((prefix (string-match "^[A-Za-z]*" value)))
+      (if prefix (match:substring prefix) #f)))
 
   ; Filter non-inherited refdes values
   (define (refdes-attrs attribs)



_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs