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

Re: gEDA-user: sym files sorting



On Fri, Oct 02, 2009 at 09:34:12PM -0700, Steven Michalske wrote:
> 
> On Sep 22, 2009, at 7:34 AM, Kai-Martin Knaak wrote:
> 
> > The gschem gui seems to append new items to the bottom of the file.  
> > As a
> > consequence, symbols done with the GUI are a pain to edit in a text
> > editor. Pins mix with comments and attributes in no particular  
> > order. It
> > would be nice, if the internals were sorted by type, by value, and/ 
> > or by
> > position.
> >
> > Did anyone write a script to sort the internals of a sym file?
> >
> 
> Keep in mind what happens to the files in a revision control system,   
> sorting might not be the best option.
> 
> Or would it help the revision control systems, after an initial sort  
> nightmare ;-P

I think so.

> 
> If we do sort them, I'd vote for alphabetical on keyname.

It has to be more sophisticated than this to minimize (heuristically
of course) sizes of diffs between versions. Sort by element type first
(rectangles, lines, text, pins...) and then by some part of the content:
text for text elements, certainly not location, this will automatically
sort attributes by name, but not by the value, however you may want
to classify text between attributes and random text.

Sort the pins by pinnumber (or pinseq, since pinnumber may change between
packages for the same chip) attribute. 

For other elements I have no idea. However, typically a symbol only has one box, 
(or very few) the the sorting on the B tag should be sufficient, and these are 
heuristics after all.

	Gabriel


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