Mail Archives: geda-user/2011/12/03/15:11:18
--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"><<a href=3D"mailto:karl AT aspodata DOT se" target=3D"_bl=
ank">karl AT aspodata DOT se</a>></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>> your script looks good but you have to manage the growing of the =
gafrc file.<br>
<br>
</div>Yes, I know.<br>
<div><br>
> Following your way, i'm making the scheme in attachment.<br>
<br>
</div>Great.<br>
<div><br>
> Now the needed lines to start the guile script from gafrc are only as<=
br>
> follow:<br>
> ;<br>
> (define geda-rchome-path (build-path (getenv "HOME") ".=
gEDA"))<br>
> (load (build-path geda-rchome-path "local-symbols-library.scm&quo=
t;))<br>
<br>
</div>It seems I can reduce thoose two lines to:<br>
<br>
(load "local-symbols-library.scm")<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 "hello.scm")<br>
=A0$ cat .gEDA/hello.scm<br>
=A0(display "Hello World!\n")<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 "HOME") ".gEDA/gafrc=
.d"))<br>
<br>
in my gafrc, gschem will load all my files in ~/.gEDA/gafrc.d.<br>
<br>
//////<br>
<br>
> ;<br>
> ;<br>
> (component-library-add-tree "personal" "/usr/local/shar=
e/symbols")<br>
<br>
Adding:<br>
<br>
=A0(component-library-add-tree "cvs" "$HOME/Net/cvs/<a href=
=3D"http://cvs.gedasymbols.org/www/user" target=3D"_blank">cvs.gedasymbols.=
org/www/user</a>")<br>
<br>
to my .gafrc didn'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 "cvs" (build-path (getenv "H=
OME") "/Net/cvs/<a href=3D"http://cvs.gedasymbols.org/www/user" t=
arget=3D"_blank">cvs.gedasymbols.org/www/user</a>"))<br>
<br><br>Also the "cvs" parameter needs to be a subfolder of "=
;$HOME/Net/cvs/<a href=3D"http://cvs.gedasymbols.org/www/user" target=3D"_b=
lank">cvs.gedasymbols.org/www/user</a>". <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>
> ;<br>
> ;<br>
><br>
> At this point the folder name will be used as description in the tree:=
<br>
><br>
> +Generic\ capacitors/<br>
> =A0 =A0 =A0 =A0 =A0cap-1.sym<br>
> =A0+AVX\ Capacitors/<br>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0idc.sym<br>
><br>
> I notice an interesting feature if the subfolders are named like:<br>
> Generic\ capacitors/<br>
> =A0 =A0 Generic\ capacitors - AVX/<br>
> =A0 =A0 =A0 =A0 Generic\ capacitors - AVX - IDC/<br>
><br>
> The items will be displayed sequentially in the tree.<br>
<br>
</div>Why not make the string look like "prefix/dir/subdir/.../",=
i.e., in<br>
the example above it could be shown as:<br>
<br>
"personal/Generic capacitors"<br>
"personal/Generic capacitors/AVX Capacitors"<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 "cvs&quo=
t; (build-path (getenv "HOME") "/Net/cvs/<a href=3D"http://c=
vs.gedasymbols.org/www/user" target=3D"_blank">cvs.gedasymbols.org/www/user=
</a>"))<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
OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IC0qLVNjaGVtZS0qLQo7ICAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2Fu
IHJlZGlzdHJpYnV0ZSBpdC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ShsYW1iZGEgKGRpcikKCQkJKGNvbXBvbmVudC1saWJy
YXJ5IGRpciAoc3RyaW5nLWFwcGVuZCBzdWJmb2xkZXIgKHN0cmluZy1jb3B5IGRpciAoc3RyaW5n
LWxlbmd0aCBtYWluZm9sZGVyKSkpKQoJCSkKCSBmb2xkZXJsaXN0KQoJKQopCgo=
--bcaec51b9fd3f93bc504b335aefd--
- Raw text -