unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Problem with setting default-directory for shell buffer
@ 2015-09-23 23:58 rodman
  2015-09-24  1:48 ` Barry Margolin
  0 siblings, 1 reply; 3+ messages in thread
From: rodman @ 2015-09-23 23:58 UTC (permalink / raw)
  To: help-gnu-emacs

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.

Thanks in advance
paul


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with setting default-directory for shell buffer
  2015-09-23 23:58 Problem with setting default-directory for shell buffer rodman
@ 2015-09-24  1:48 ` Barry Margolin
  2015-09-24 15:36   ` rodman
  0 siblings, 1 reply; 3+ messages in thread
From: Barry Margolin @ 2015-09-24  1:48 UTC (permalink / raw)
  To: help-gnu-emacs

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 ***


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with setting default-directory for shell buffer
  2015-09-24  1:48 ` Barry Margolin
@ 2015-09-24 15:36   ` rodman
  0 siblings, 0 replies; 3+ messages in thread
From: rodman @ 2015-09-24 15:36 UTC (permalink / raw)
  To: help-gnu-emacs

On Wednesday, September 23, 2015 at 6:48:03 PM UTC-7, Barry Margolin wrote:
> 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 ***


It did work! Thanks a bunch!


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-24 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-23 23:58 Problem with setting default-directory for shell buffer rodman
2015-09-24  1:48 ` Barry Margolin
2015-09-24 15:36   ` rodman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).