X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=JQm/IfX9jUL1D9fMqUCgtxmeUCh4JnJHcyLdzq7dcOo=; b=xl+YhwNSg8QScUcFOKw+hcRO2xmxAzjqxuYn6WDUDDeH79L+RK5BfB6uq0WbUBa26V PP6VE5A35oZAgU+GB+4F9eRJyS6/Sx2WAhKMTNvL36y109JbB2FaAx8rhr9sRj3h30Ts c5JQOi7UTAcug9karFRyN5g14r2JRakXHu46g= MIME-Version: 1.0 In-Reply-To: <20111203215549.238A581D5424@turkos.aspodata.se> References: <20111130211002 DOT 32B5081F6275 AT turkos DOT aspodata DOT se> <20111203133340 DOT E09A181D541B AT turkos DOT aspodata DOT se> <20111203215549 DOT 238A581D5424 AT turkos DOT aspodata DOT se> Date: Sun, 4 Dec 2011 23:19:21 +0100 Message-ID: Subject: Re: [geda-user] Dynamic loading personal components (with subfolder) into the search component tree of gschem From: Luigi Salvatore Palese To: geda-user AT delorie DOT com Content-Type: multipart/alternative; boundary=0016363b7f600a648a04b34b9871 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 --0016363b7f600a648a04b34b9871 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, Dec 3, 2011 at 10:55 PM, Karl Hammar wrote: > Luigi: > > On Sat, Dec 3, 2011 at 2:33 PM, Karl Hammar wrote: > ... > > To manage $HOME substitution you need getenv: > > (component-library-add-tree "cvs" (build-path (getenv "HOME") > "/Net/cvs/ > > cvs.gedasymbols.org/www/user")) > > Hmm, my c version [1] got that for free. How should I do to take a > string and substitute all $VAR's, it's annoying to do that manually > in the gafrc file ? > libgeda already has s_expand_env_variables() method to do this, but is not exported to scm (as i can see). Before start writing new code someone could ask to developers if is it possible to export it for use in guile. > ... > > > "personal/Generic capacitors" > > > "personal/Generic capacitors/AVX Capacitors" > > > > > > > > The version in attachment builds description in that way. > > Now the first parameter is a prefix which adds to the folders. > > The second parameter is the main folder and will be excluded from the > > description string. > > > > so as example a line such: > > (component-library-add-tree "cvs" (build-path (getenv "HOME") "/Net/cvs= / > > cvs.gedasymbols.org/www/user")) > > > > will produce as result: > > cvs/Capacitors > > cvs/Capacitors/AVX > > ... > > Your script works fine, except that there can be a lot of directories > without .sym files, see attachment to see what can happen. > I know this issue. I'm working on a fast method to solve this... > BTW, wouldn't it be easier to write 'directory instead of > (string->symbol "directory") ? > Sometimes i need strong mental concentration (especially when my children are playing near me ) ;-) Your script is much faster than mine [2], how could I speed it up? > > Maybe the hash computation for each file could be the problem. > Regards, > /Karl Hammar > > [1] http://archives.seul.org/geda/user/May-2011/msg00556.html > [2] > http://www.delorie.com/archives/browse.cgi?p=3Dgeda-user/2011/12/03/15:41= :27 > > ----------------------------------------------------------------------- > Asp=F6 Data > Lilla Asp=F6 148 > S-742 94 =D6sthammar > Sweden > +46 173 140 57 > > Regards, Luigi --0016363b7f600a648a04b34b9871 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sat, Dec 3, 2011 at 10:55 PM, Karl Ha= mmar <karl AT aspodat= a.se> wrote:
Luigi:
> On Sat, Dec 3, 2011 at 2:33 PM, Karl Hammar <karl AT aspodata DOT se> wrote:
...
> To manage $HOME substitution you need getenv:
> =A0 (component-library-add-tree "cvs" (build-path (getenv &q= uot;HOME") "/Net/cvs/
> cvs.= gedasymbols.org/www/user"))

Hmm, my c version [1] got that for free. How should I do to take a string and substitute all $VAR's, it's annoying to do that manually=
in the gafrc file ?

libgeda already has s_expand_e= nv_variables() method to do this, but is not exported to scm (as i can see)= .
Before start writing new code someone could ask to developers if is i= t possible to export it for use in guile.


...
> > "personal/Generic capacitors"
> > "personal/Generic capacitors/AVX Capacitors"
> >
> >
> The version in attachment builds description in that way.
> Now the first parameter is a prefix which adds to the folders.
> The second parameter is the main folder and will be excluded from the<= br> > description string.
>
> so as example a line such:
> (component-library-add-tree "cvs" (build-path (getenv "= HOME") "/Net/cvs/
> cvs.= gedasymbols.org/www/user"))
>
> will produce as result:
> cvs/Capacitors
> cvs/Capacitors/AVX
> ...

Your script works fine, except that there can be a lot of directories=
without .sym files, see attachment to see what can happen.
=

I know this issue. I'm working on a fast method to solve this.= ..
=A0
=A0
Your script is much faster than mine [2], how could I speed it up?


Maybe the hash computation for each file could be= the problem.
=A0
Regards,
/Karl Hammar

[1] http://archives.seul.org/geda/user/May-2011/msg00556.html<= /a>
[2]
http://www.delorie.com/archives/browse.= cgi?p=3Dgeda-user/2011/12/03/15:41:27

-----------------------------------------------------------------------
Asp=F6 Data
Lilla Asp=F6 148
S-742 94 =D6sthammar
Sweden
+46 173 140 57=


Regards,
Luigi
--0016363b7f600a648a04b34b9871--