Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -fastcd- [was: Re: st: MIME-Version: 1.0]


From   David Elliott <[email protected]>
To   [email protected]
Subject   Re: -fastcd- [was: Re: st: MIME-Version: 1.0]
Date   Fri, 25 Mar 2011 14:51:06 -0300

Ulrich

I installed your dirtools suite and I really think they are great.
However, I have run into an error situation shown here in this results
window listing:

.ldir

Places to go:
[up] [home] [1%] [aphs] [icu] [imm] [np] [pan] [rates] [stata] [temp]
[test] [trends] [vac] [wait]

Subfolders:
ashim       delete      maps        testgraphs  trend

Known filetypes here:
[.do] [.dta] [.gph] [.smcl] [.ado]


<I click on [temp] (or any other bookmark derived directory) and here
is the result:>
. ldir LCD `"/c:\temp"'
unable to change to /c:\temp
r(170);

I've checked  the code in the GetBookmarks subroutine of -ldir- and these lines:

tokenize `"`line'"', parse("*")
local bookmark                                  ///
`"`bookmark' {txt:[}{stata `"ldir LCD `"`pwd'/`3'"'"':`1'}{txt:]}"'

appear to be the culprit, specifically the macro expression: `"`pwd'/`3'"'"'

For folders acquired from the c.ado bookmarks file (directoryfile.txt)
the path cannot be expressed relative to the pwd, it must go in as an
absolute path.

If you revise that code to:
`"`bookmark' {txt:[}{stata `"ldir LCD `"`3'"'"':`1'}{txt:]}"'
the routine works properly.

May I also suggest you add a blank line between the command line and
output and make the actual directory change more obvious with the
following:
// Output
di _n `"{txt:Working directory now: {res:`c(pwd)'}}"'

I have also found an intermittent error in the display of the last
bookmark in that sometimes I see:
... [temp] [test] [trends] [vac] [wait]
and other times I see (the ### is just a long path):
 [temp] [test] [trends] [vac] [{stata `"ldir LCD
> `"###\data"'"':wait}]

As you can see, sometimes the actual SMCL code gets written out asis
rather than being properly interpreted.  This appears to be isolated
to the last few bookmarks and also is dependent on the width of the
window.  The same listing done at different window widths can produce
different results.  I get problems when linesize is between 100 - 120.
 I can't find what is triggering this but it seems to be associated
with line wrapping.  Is it possible that Stata doesn't want to wrap a
SMCL command hyperlink?  If that is the case, it is a Stata issue and
not your code.  I have a lot of bookmarks so my list is 99 spaces
wide.  If you want to test this, narrow your results window to the
point where it starts to induce wrapping of the bookmarks.  You may be
able to reproduce what I am seeing.

I'd be happy to help you with testing since I think I now understand
the routine pretty well.

David Elliott

Everything is theoretically impossible, until it is done.
Progress is made by lazy men looking for easier ways to do things.
 -- Robert A. Heinlein (American science-fiction Writer, 1907-1988)




On 24 March 2011 13:18, Ulrich Kohler <[email protected]> wrote:
> If you like -fastcd-, you might also like the package -dirtools-. The
> command -ldir- of -dirtools- provides clicking access to the -fastcd-
> bookmarks and to some other things that might be useful:
>
>
> . ldir
> /home/kohler
>
> Places to go:
> [up] [home] [brzinsky] [cooker] [health] [kke] [liferisks_anhang]
> [nlcorr] [zaesur]
>
> Subfolders:
> Bilder       ado          bin          diverses     gutachten    lit
> pub          vgwort
> Desktop      auto         cooker       download     lehre        mywww
> texmf        vorlagen
> Ubuntu One   bewerbungen  data         elisp        liferisks    post
> usi          wzbnet
>
> Known filetypes here:
> [.smcl] [.tex]
>
>
> Uli
>
> Am Donnerstag, den 24.03.2011, 13:08 -0300 schrieb David Elliott:

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index