[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with setting default-directory for shell buffer
From: |
Barry Margolin |
Subject: |
Re: Problem with setting default-directory for shell buffer |
Date: |
Wed, 23 Sep 2015 21:48:00 -0400 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
In article <2dc06caf-b00a-4863-aada-f63af3381916@googlegroups.com>,
rodman@google.com wrote:
> Every N years I seem to need to flip between xemacs and emacs.
>
> Now I'm back on emacs..love the nfs free setup and just
> doing
>
> require 'google
>
> etc. Whoever-all made that happen, thanks a bunch!
>
> My problem:
>
> I use a python program to implement a set of 'directory marks'
> The program is really simple and it works in concert with this bash function:
>
>
> function ccd {
> eval `~/git/py/cd_marks.py $1 $2 `;
> emacsclient --eval "(cd \"`pwd`\")" >&/dev/null;
> }
>
>
> so I say stuff like
>
> ccd foo
>
> in a shell, and if I then do a find-file in that buffer the directory
> shows up properly. (i.e. the shell pwd is "tracked" whenever I use the ccd
> command)
>
> I have tried of ton of ideas but nothing works.
Each Emacs buffer has its own default directory. When emacsclient
executes the --eval code, it's in a temporary buffer, not your shell
buffer.
Maybe this will work:
--eval "(progn (set-buffer \"*shell*\")(cd \"`pwd`\"))"
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***