From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: Reuse frame with emacsclient and/or use shell aliases when finding files Date: Fri, 30 May 2014 23:47:46 +0100 Message-ID: <8738fq28a5.fsf@robertthorpeconsulting.com> References: <06de416b-9d9d-4e86-bc41-f6b9a06404f4@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1401490105 16741 80.91.229.3 (30 May 2014 22:48:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 May 2014 22:48:25 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Jacob Gerlach Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 31 00:48:18 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WqVaz-0007Ik-9N for geh-help-gnu-emacs@m.gmane.org; Sat, 31 May 2014 00:48:17 +0200 Original-Received: from localhost ([::1]:56940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqVay-0004Bo-SR for geh-help-gnu-emacs@m.gmane.org; Fri, 30 May 2014 18:48:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqVai-0004Bj-2X for help-gnu-emacs@gnu.org; Fri, 30 May 2014 18:48:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WqVaZ-0001VK-On for help-gnu-emacs@gnu.org; Fri, 30 May 2014 18:47:59 -0400 Original-Received: from outbound-smtp05.blacknight.com ([81.17.249.38]:37192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqVaZ-0001Ud-HQ for help-gnu-emacs@gnu.org; Fri, 30 May 2014 18:47:51 -0400 Original-Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp05.blacknight.com (Postfix) with ESMTP id 8307498BFD for ; Fri, 30 May 2014 22:45:29 +0000 (UTC) Original-Received: (qmail 29991 invoked from network); 30 May 2014 22:47:47 -0000 Original-Received: from unknown (HELO RTLaptop) (rt@robertthorpeconsulting.com@[109.78.95.99]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 30 May 2014 22:47:47 -0000 In-Reply-To: <06de416b-9d9d-4e86-bc41-f6b9a06404f4@googlegroups.com> (message from Jacob Gerlach on Fri, 30 May 2014 14:56:33 -0700 (PDT)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 81.17.249.38 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97972 Archived-At: Jacob Gerlach writes: > What I think that I want to do is figure out how to reuse an existing > GUI frame if it exists. In other words, if I run `emacsclient -c > foofile' from my shell and I already have a frame open, I would like > foofile to open in that frame (and have the option to split the frame > if possible). If no frame is open (i.e. just the server), I would > like the normal behavior of opening a new frame. You want the default behaviour of emacsclient then. In that case don't add "-c" to the emacsclient command. I'm sure you tried that though. I'm not sure why it doesn't work on your setup. Do you have (server-start) in your init file? Are you using emacs --daemon? > I realize that another (perhaps better option) is to use emacs as my > shell. I'm experimenting with this but I am not sold yet. > > Another problem, and the reason I'm opening multiple files from the > shell in the first place (instead of from within emacs), is that I > mostly navigate around between different projects using shell aliases. > Is there any way to use those aliases so that when I find-file I don't > have to manually navigate to the desired directory? You could setup bookmarks with C-x r m that have the same names as the aliases. You can bookmark a dired buffer in a certain directory and recalling the bookmark will return you there. > Any other recommendations that come to mind to migrate work from the > shell to emacs are welcome. Well, if you do use an Emacs shell then when you press C-x C-f it will default to your current directory. Suppose you do M-x shell and you have a bash alias 'alias pro1="cd ~\Projects\FooCorp\MainProject"'. If you type "pro1 RET" it'll take you to the directory. Then C-x C-f, C-x d, etc will default to \Projects\FooCorp\MainProject. "Shell" and "Term" modes don't replace the shell they run it as a sub-process, only "Eshell" replaces it with a different shell. BR, Robert Thorpe