X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Envelope-From: paubert AT iram DOT es Date: Wed, 25 Jul 2012 15:01:00 +0200 From: Gabriel Paubert To: geda-user AT delorie DOT com Cc: karl AT aspodata DOT se Subject: Re: [geda-user] Symbol attributes Message-ID: <20120725130100.GA10443@visitor2.iram.es> References: <50084839 DOT 9080804 AT sbcglobal DOT net> <201207191830 DOT q6JIUH0o028413 AT envy DOT delorie DOT com> <500DB5AB DOT 4000903 AT sbcglobal DOT net> <500F4824 DOT 1080905 AT sbcglobal DOT net> <20120725063536 DOT GA24867 AT visitor2 DOT iram DOT es> <20120725102654 DOT 55EAD8279F78 AT turkos DOT aspodata DOT se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120725102654.55EAD8279F78@turkos.aspodata.se> User-Agent: Mutt/1.5.20 (2009-06-14) X-SPF-Received: 2 X-Spamina-Bogosity: Ham Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, Jul 25, 2012 at 12:26:52PM +0200, Karl Hammar wrote: > -------- > Gabriel: > ... > > The most annoying issue is that, being an attribute, it is displayed > > in a different color than the text associated with symbols which played > > a similar role in the standard library. I don't think it is right now > > possible to modify the colour depending on regexp matching on the attribute > > name; otherwise it would be nice if attribute name matching ".*label.*" > > would use text color (automatically atattribute promotion time). > ... Except that, attribute promotion does not respect colour in the symbol file, so modifying the symbol files is useless. Maybe this should be considered a bug. > > An attribute is simply a pair of lines: > > T 100 1300 5 10 0 0 0 0 1 > author=Karl Hammar > > where the "5" above is the colour, see [1] for details. > > If your program remembers the "previous" line, it can change the > colour. > > Like in: > > $ ./ch_colour.pl refdes 3 < ../share/gschem/ellyt.sym > a.sym > $ diff -u ../share/gschem/ellyt.sym a.sym > --- ../share/gschem/ellyt.sym 2011-07-26 15:06:05.000000000 +0200 > +++ a.sym 2012-07-25 12:23:12.633211147 +0200 > @@ -26,7 +26,7 @@ > author=Karl Hammar > T 100 1100 5 10 0 0 0 0 1 > device=POLARIZED_CAPACITOR > -T 100 500 8 10 1 1 0 0 1 > +T 100 500 3 10 1 1 0 0 1 > refdes=C? > T 100 1300 5 10 0 0 0 0 1 > description=polarized capacitor > $ cat ./ch_colour.pl > #!/usr/bin/perl -w > > use strict; > > my $attr = shift; > my $colour = shift; > > my $save = ""; > > while (<>) { > if (m/^(T\s+\S+\s+\S+\s+)(\d+)(\s.*)$/) { > $save = [ $_, $1, $2, $3 ]; > } elsif ($save) { > if (m/^$attr=/) { > print $$save[1], $colour, $$save[3], "\n"; > print; > undef $save; > } else { > print $$save[0]; > print; > undef $save; > } > } else { > print; > } > } > $ > Thanks for the line noise^W^W Perl script, but as I said it's useless. Regards, Gabriel