unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: Problem with setting default-directory for shell buffer
Date: Wed, 23 Sep 2015 21:48:00 -0400	[thread overview]
Message-ID: <barmar-81287E.21480023092015@88-209-239-213.giganet.hu> (raw)
In-Reply-To: 2dc06caf-b00a-4863-aada-f63af3381916@googlegroups.com

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


  reply	other threads:[~2015-09-24  1:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23 23:58 Problem with setting default-directory for shell buffer rodman
2015-09-24  1:48 ` Barry Margolin [this message]
2015-09-24 15:36   ` rodman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=barmar-81287E.21480023092015@88-209-239-213.giganet.hu \
    --to=barmar@alum.mit.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).