www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2011/12/03/15:11:18

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=P2flqSSB+Ru/K9HyAobhTq/JieLSLc5tCvqi1Qp+I6Y=;
b=bokRUF/H2QhR8HmBR0k4bNuj5QU1On79mXCaEsUGaJ0amGDegCDYP3OWeunYQhFN0G
GZE1gAuus/PWCqdXca3G3SEFnU20pgVQQCx+T5y5b3bSnGYsrvpfGIKl4zIeVYJvBNY8
u9RU+npz0D9VGaIebzrqevzO+XGhKlaZ0N6tE=
MIME-Version: 1.0
In-Reply-To: <20111203133340.E09A181D541B@turkos.aspodata.se>
References: <CAAVSQ3vnFZkWdWn=LCbf+WSM0vOx9pwW+OaeTs47EdO8nfmC_w AT mail DOT gmail DOT com>
<20111130211002 DOT 32B5081F6275 AT turkos DOT aspodata DOT se>
<CAAVSQ3tkg3es-uBn+yFroysi5xAOtNqW5hTs2yAWQfo47rUaVQ AT mail DOT gmail DOT com>
<20111203133340 DOT E09A181D541B AT turkos DOT aspodata DOT se>
Date: Sat, 3 Dec 2011 21:10:56 +0100
Message-ID: <CAAVSQ3tQLSsBoCjzDE+qAGrVAzCJKzocACyMOkxVBPUqyLBD7Q@mail.gmail.com>
Subject: Re: [geda-user] Dynamic loading personal components (with subfolder)
into the search component tree of gschem
From: Luigi Salvatore Palese <ultrabit AT gmail DOT com>
To: geda-user AT delorie DOT com
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

--bcaec51b9fd3f93bc504b335aefd
Content-Type: multipart/alternative; boundary=bcaec51b9fd3f93bc104b335aefb

--bcaec51b9fd3f93bc104b335aefb
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Sat, Dec 3, 2011 at 2:33 PM, Karl Hammar <karl AT aspodata DOT se> wrote:

> Luigi:
> > your script looks good but you have to manage the growing of the gafrc
> file.
>
> Yes, I know.
>
> > Following your way, i'm making the scheme in attachment.
>
> Great.
>
> > Now the needed lines to start the guile script from gafrc are only as
> > follow:
> > ;
> > (define geda-rchome-path (build-path (getenv "HOME") ".gEDA"))
> > (load (build-path geda-rchome-path "local-symbols-library.scm"))
>
> It seems I can reduce thoose two lines to:
>
> (load "local-symbols-library.scm")
>
> //////
>
> Appearantly, I can load stuff from my .gEDA dir without any special
> magic, nice:
>
>  $ tail -1 .gEDA/gafrc
>  (load "hello.scm")
>  $ cat .gEDA/hello.scm
>  (display "Hello World!\n")
>  $ gschem
>  Hello World!
>  ^C
>  $
>
> Even better, if I do:
>
>  (load-scheme-dir (build-path (getenv "HOME") ".gEDA/gafrc.d"))
>
> in my gafrc, gschem will load all my files in ~/.gEDA/gafrc.d.
>
> //////
>
> > ;
> > ;
> > (component-library-add-tree "personal" "/usr/local/share/symbols")
>
> Adding:
>
>  (component-library-add-tree "cvs" "$HOME/Net/cvs/
> cvs.gedasymbols.org/www/user")
>
> to my .gafrc didn't do any difference to the library browser, hmm.
>


To manage $HOME substitution you need getenv:
  (component-library-add-tree "cvs" (build-path (getenv "HOME") "/Net/cvs/
cvs.gedasymbols.org/www/user"))


Also the "cvs" parameter needs to be a subfolder of "$HOME/Net/cvs/
cvs.gedasymbols.org/www/user".
This is a my misunderstanding of your idea.


> > ;
> > ;
> >
> > At this point the folder name will be used as description in the tree:
> >
> > +Generic\ capacitors/
> >          cap-1.sym
> >  +AVX\ Capacitors/
> >                  idc.sym
> >
> > I notice an interesting feature if the subfolders are named like:
> > Generic\ capacitors/
> >     Generic\ capacitors - AVX/
> >         Generic\ capacitors - AVX - IDC/
> >
> > The items will be displayed sequentially in the tree.
>
> Why not make the string look like "prefix/dir/subdir/.../", i.e., in
> the example above it could be shown as:
>
> "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
...


>  Regards,
> /Karl Hammar
>
> -----------------------------------------------------------------------
> Asp=F6 Data
> Lilla Asp=F6 148
> S-742 94 =D6sthammar
> Sweden
> +46 173 140 57
>
>
>
I need some more time to solve the $HOME substitution... any help is
welcome.


Regards,
Luigi

--bcaec51b9fd3f93bc104b335aefb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Sat, Dec 3, 2011 at 2:33 PM, Karl Ham=
mar <span dir=3D"ltr">&lt;<a href=3D"mailto:karl AT aspodata DOT se" target=3D"_bl=
ank">karl AT aspodata DOT se</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x">

Luigi:<br>
<div>&gt; your script looks good but you have to manage the growing of the =
gafrc file.<br>
<br>
</div>Yes, I know.<br>
<div><br>
&gt; Following your way, i&#39;m making the scheme in attachment.<br>
<br>
</div>Great.<br>
<div><br>
&gt; Now the needed lines to start the guile script from gafrc are only as<=
br>
&gt; follow:<br>
&gt; ;<br>
&gt; (define geda-rchome-path (build-path (getenv &quot;HOME&quot;) &quot;.=
gEDA&quot;))<br>
&gt; (load (build-path geda-rchome-path &quot;local-symbols-library.scm&quo=
t;))<br>
<br>
</div>It seems I can reduce thoose two lines to:<br>
<br>
(load &quot;local-symbols-library.scm&quot;)<br>
<br>
//////<br>
<br>
Appearantly, I can load stuff from my .gEDA dir without any special<br>
magic, nice:<br>
<br>
 =A0$ tail -1 .gEDA/gafrc<br>
 =A0(load &quot;hello.scm&quot;)<br>
 =A0$ cat .gEDA/hello.scm<br>
 =A0(display &quot;Hello World!\n&quot;)<br>
 =A0$ gschem<br>
 =A0Hello World!<br>
 =A0^C<br>
 =A0$<br>
<br>
Even better, if I do:<br>
<br>
=A0(load-scheme-dir (build-path (getenv &quot;HOME&quot;) &quot;.gEDA/gafrc=
.d&quot;))<br>
<br>
in my gafrc, gschem will load all my files in ~/.gEDA/gafrc.d.<br>
<br>
//////<br>
<br>
&gt; ;<br>
&gt; ;<br>
&gt; (component-library-add-tree &quot;personal&quot; &quot;/usr/local/shar=
e/symbols&quot;)<br>
<br>
Adding:<br>
<br>
=A0(component-library-add-tree &quot;cvs&quot; &quot;$HOME/Net/cvs/<a href=
=3D"http://cvs.gedasymbols.org/www/user" target=3D"_blank">cvs.gedasymbols.=
org/www/user</a>&quot;)<br>
<br>
to my .gafrc didn&#39;t do any difference to the library browser, hmm.<br><=
/blockquote><div><br><br>To manage $HOME substitution you need getenv:<br>=
=A0 (component-library-add-tree &quot;cvs&quot; (build-path (getenv &quot;H=
OME&quot;) &quot;/Net/cvs/<a href=3D"http://cvs.gedasymbols.org/www/user" t=
arget=3D"_blank">cvs.gedasymbols.org/www/user</a>&quot;))<br>

<br><br>Also the &quot;cvs&quot; parameter needs to be a subfolder of &quot=
;$HOME/Net/cvs/<a href=3D"http://cvs.gedasymbols.org/www/user" target=3D"_b=
lank">cvs.gedasymbols.org/www/user</a>&quot;. <br>This is a my misunderstan=
ding of your idea. <br>

<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0pt 0pt 0pt 0.8=
ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><br>
&gt; ;<br>
&gt; ;<br>
&gt;<br>
&gt; At this point the folder name will be used as description in the tree:=
<br>
&gt;<br>
&gt; +Generic\ capacitors/<br>
&gt; =A0 =A0 =A0 =A0 =A0cap-1.sym<br>
&gt; =A0+AVX\ Capacitors/<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0idc.sym<br>
&gt;<br>
&gt; I notice an interesting feature if the subfolders are named like:<br>
&gt; Generic\ capacitors/<br>
&gt; =A0 =A0 Generic\ capacitors - AVX/<br>
&gt; =A0 =A0 =A0 =A0 Generic\ capacitors - AVX - IDC/<br>
&gt;<br>
&gt; The items will be displayed sequentially in the tree.<br>
<br>
</div>Why not make the string look like &quot;prefix/dir/subdir/.../&quot;,=
 i.e., in<br>
the example above it could be shown as:<br>
<br>
&quot;personal/Generic capacitors&quot;<br>
&quot;personal/Generic capacitors/AVX Capacitors&quot;<br>
<div><div><br></div></div></blockquote><div><br>The version in attachment b=
uilds description in that way. <br>Now the first parameter is a prefix whic=
h adds to the folders. <br>The second parameter is the main folder and will=
 be excluded from the description string.<br>

<br>so as example a line such:<br>(component-library-add-tree &quot;cvs&quo=
t; (build-path (getenv &quot;HOME&quot;) &quot;/Net/cvs/<a href=3D"http://c=
vs.gedasymbols.org/www/user" target=3D"_blank">cvs.gedasymbols.org/www/user=
</a>&quot;))<br>

<br>will produce as result:<br>cvs/Capacitors<br>cvs/Capacitors/AVX<br>...<=
br>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0pt 0pt 0pt 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div>
Regards,<br>
/Karl Hammar<br>
<br>
-----------------------------------------------------------------------<br>
Asp=F6 Data<br>
Lilla Asp=F6 148<br>
S-742 94 =D6sthammar<br>
Sweden<br>
<a href=3D"tel:%2B46%20173%20140%2057" value=3D"+4617314057" target=3D"_bla=
nk">+46 173 140 57</a><br>
<br>
<br>
</div></div></blockquote></div><br>I need some more time to solve the $HOME=
 substitution... any help is welcome.<br><br><br>Regards,<br>Luigi<br>

--bcaec51b9fd3f93bc104b335aefb--
--bcaec51b9fd3f93bc504b335aefd
Content-Type: text/x-scheme; charset=US-ASCII; name="local-symbols-library.scm"
Content-Disposition: attachment; filename="local-symbols-library.scm"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gvr245pc1

OyAgICAgICAgICA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ChzdHJpbmctdHJpbS1ib3RoIG1haW5mb2xkZXIgY2hh
ci1zZXQ6d2hpdGVzcGFjZSkgI1wvKSkKICAgICAgICAJKGZ0dyBtYWluZm9sZGVyIGJ1aWxkLXN5
bWJvbHMtbGlzdCkKCShmb3ItZWFjaAoJCShsYW1iZGEgKGRpcikKCQkJKGNvbXBvbmVudC1saWJy
YXJ5IGRpciAoc3RyaW5nLWFwcGVuZCBzdWJmb2xkZXIgKHN0cmluZy1jb3B5IGRpciAoc3RyaW5n
LWxlbmd0aCBtYWluZm9sZGVyKSkpKQoJCSkKCSBmb2xkZXJsaXN0KQoJKQopCgo=
--bcaec51b9fd3f93bc504b335aefd--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019