Hmm.   I'm not certain what the difference is.  As I mentioned, matlab-shell 
has no directory parsing itself, it just turns on this service.   When I looked 
at how it works, it's just a long conditional trying out different regexp 
trying to divine what is being CD'd to.

I'm assuming you needed the 'quotes' around the path in case of spaces in the 
path.

Looking through shell-dirtrack-mode, it looks like there isn't much in the way 
of options regarding syntax around the string.  It was probably an error when I 
tried it in a dos shell due to how the syntax table was set up.

Perhaps the desired path can be examined for spaces, and then have no special 
syntax around it if there are no spaces.  That will allow it to work in most 
cases.

Or maybe instead of depending on the cd command, just change the 
default-directory next to the code that inserts the CD command.  That would be 
pretty robust.

Eric

-----Original Message-----
From: Uwe Brauer [mailto:o...@mat.ucm.es] 
Sent: Friday, February 24, 2017 1:26 PM
To: Eric Ludlam <eric.lud...@mathworks.com>
Cc: Uwe Brauer <o...@mat.ucm.es>; matlab-emacs-discuss 
<matlab-emacs-discuss@lists.sourceforge.net>
Subject: Re: [Matlab-emacs-discuss] annoying path behavior of the *MATLAB* 
shell buffer who is the culprit

>>> "Eric" == Eric Ludlam <eric.lud...@mathworks.com> writes:

    > Hiya,
    > Matlab-shell uses dirtrack, or shell-directory-tracker. It just
    > watches the input stream and changes default-directory when it sees:

    > cd /some/path/to/directory

    > I'll guess MATLAB syntax around (['/path']) is confusing it.

    > You could probably replace all the parens etc with just:

    > cd '/path'

    > which should work fine. I tried this with a DOS shell in Emacs and
    > Emacs followed the path even though the actual shell threw and error.

Hi Eric

Thanks for your answer, however at least for this does not work

I know obtain, with the same logic as before

>> cd '/home/oub/ALLES/Dir-Matlab/dir1/'
>> test 
y =    64
>> addpath('/home/oub/.emacs.d/elpa/matlab-mode-20160902.459/toolbox','-begin');
>>  rehash; emacsinit('emacsclient -n');
>>  
>> pwd

ans =

/home/oub/ALLES/Dir-Matlab/dir1

>> cd '/home/oub/ALLES/Dir-Matlab/dir2/'
>> test2 

y =     49

However find-file still thinks it is in dir1 not 2.

Uwe 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to