help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Reuse frame with emacsclient and/or use shell aliases when finding f


From: Robert Thorpe
Subject: Re: Reuse frame with emacsclient and/or use shell aliases when finding files
Date: Sat, 31 May 2014 12:22:36 +0100

Jacob Gerlach <jacobgerlach@gmail.com> writes:

> If I use just emacsclient, I get a terminal window. With -c I get a
> GUI window. I don't have any problem with the client not starting.
> I didn't have (server-start) in my init, but adding it didn't
> change anything.

That's wierd.  Have a look at the section on "Emacs Server" in the Emacs
manual.  Emacsclient can only work if you have an Emacs server running.
To get one you have to start Emacs then run (server-start).  After that
emacsclient will send a message to the running Emacs server telling it
to open the file.

Try the following:
* Close all Emacs instances.
* From the command line type "Emacs &" and minimize the Emacs.
* Execute (server-start) e.g. by typing it into scratch and pressing C-x
C-e with the cursor at the end of the line.
* From a shell type "emacsclient file.txt".
After the last step the existing Emacs should pop-up with the file open
in it.

> That's a pretty good idea! I've just recently started experimenting
> with bookmarks. I wonder if I could come up with some utility
> function to read in bash aliases and create the associated dired
> bookmarks when I start emacs. That way I don't have to maintain two
> lists of aliases and keep them synced.

I expect that's possible with a little bit of elisp.  If you look at
.emacs.bmk it's quite a simple format.
  
> I'm not certain I understood this correctly. After `M-x shell', I
> can use C-x C-f RET to get dired for the current directory. If I
> try C-x C-f, C-x d as you suggested, I get "Command attempted to use
> minibuffer while in minibuffer". In any case, if I change
> directories manually, `cd ~/foobar', find-file defaults to ~/foobar. 

When I wrote "C-x C-f, C-x d" I meant you could use C-x C-f or C-x d.#

> If I use an alias to cd to ~/foobar, find-file remains in the
> previous working directory.

So it does.  I'd say that's a bug in shell mode.

BR,
Robert Thorpe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]