From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nathaniel Flath Newsgroups: gmane.emacs.help Subject: Re: Create shell from ido Date: Fri, 29 Jan 2010 01:14:05 -0500 Message-ID: <5e3a506e1001282214l5d460f17sc229dc3760e81fce@mail.gmail.com> References: <5e3a506e1001271754j7b55bb69x6aa0af16acaf26f1@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=000e0cd295aefe3f10047e478ad4 X-Trace: ger.gmane.org 1264745706 31658 80.91.229.12 (29 Jan 2010 06:15:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jan 2010 06:15:06 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Kevin Rodgers Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 29 07:15:03 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nak8E-000790-T5 for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Jan 2010 07:15:03 +0100 Original-Received: from localhost ([127.0.0.1]:42544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nak8B-0000CX-OT for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Jan 2010 01:14:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nak7S-0000AR-Kt for help-gnu-emacs@gnu.org; Fri, 29 Jan 2010 01:14:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Nak7M-0008Vi-RN for help-gnu-emacs@gnu.org; Fri, 29 Jan 2010 01:14:13 -0500 Original-Received: from [199.232.76.173] (port=47679 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nak7M-0008VK-HP for help-gnu-emacs@gnu.org; Fri, 29 Jan 2010 01:14:08 -0500 Original-Received: from mail-pw0-f47.google.com ([209.85.160.47]:42648) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nak7M-0007jn-4z for help-gnu-emacs@gnu.org; Fri, 29 Jan 2010 01:14:08 -0500 Original-Received: by pwj10 with SMTP id 10so1182453pwj.26 for ; Thu, 28 Jan 2010 22:14:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=3R0960mQD13DB+9B7rbkO18g7yPuJNyP5odSmV004es=; b=B/IwbgLR5cJGmhA2MEgYN26a6CqQt4c03AK06Jpb7UK2JL+eftUybSJ2/iXjgtalV2 boAcWJCi3mi+LI8SFEodMUUZ6uR3QEVvVEQ1lJeaKK3c22MnsCwH1RWJM/ThGVqVpjGF QKqXAEFDPC4rHNlXq6B6HPcXk1pRFgx197KP0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=NO2E0TDrHgTBH82cqK8C7V2jIIkh+wrsIkEbU8eMkhdrMfu4B9evsyOgH8jqSrb7Ar NygFOAu+D561iqrou+fm+ScW4qJeOiqrxZGMZ3e9Hmn2g1/DFCzdqP9nVPNdcOLq7+JD JH358xxgWn/oBi03XiJLsRilqMZ8T6O+VOFOE= Original-Received: by 10.140.88.31 with SMTP id l31mr301348rvb.32.1264745646533; Thu, 28 Jan 2010 22:14:06 -0800 (PST) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71557 Archived-At: --000e0cd295aefe3f10047e478ad4 Content-Type: text/plain; charset=ISO-8859-1 That doesn't work, unfortunately - I tried it., as well as emulating the other dired stuff. I'm not sure why that doesn't work, but I managed to write a function that does: (defun ido-shell () (interactive) (let ((dirname (expand-file-name (ido-read-directory-name "Shell in directory: ")))) (shell dirname) (comint-send-string (current-buffer) (concat "cd " dirname "\n")))) Thanks, Nathaniel Flath On Fri, Jan 29, 2010 at 12:00 AM, Kevin Rodgers wrote: > Nathaniel Flath wrote: > >> Hello, >> I have ido activated. If I do C-x C-f and navigate to a directory, C-d >> will open a dired buffer in that directory. Is there a way to open a shell >> buffer instead? >> > > I don't use ido, so I don't even know how to test this. But here's what I > came > up with from looking at ido.el. I didn't understand how to properly > implement > ido-magic-control-s, so you have to type `C-x C-f C-x C-s' (by analogy with > `C-x C-f C-x C-d', which runs ido-enter-dired): > > (defun ido-enter-shell () > "Drop into `shell' from file switching." > (interactive) > (setq ido-exit 'shell) > (exit-minibuffer)) > > (define-key ido-file-dir-completion-map "\C-x\C-s" 'ido-enter-shell) > > -- > Kevin Rodgers > Denver, Colorado, USA > > > > --000e0cd295aefe3f10047e478ad4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable That doesn't work, unfortunately - I tried it., as well as emulating th= e other dired stuff.=A0 I'm not sure why that doesn't work, but I m= anaged to write a function that does:

(defun ido-shell ()
=A0 (in= teractive)
=A0 (let ((dirname (expand-file-name (ido-read-directory-name "Shell i= n directory: "))))
=A0=A0=A0 (shell dirname)
=A0=A0=A0 (comint-s= end-string (current-buffer) (concat "cd " dirname "\n")= )))

Thanks,
Nathaniel Flath

On Fri, Jan 29= , 2010 at 12:00 AM, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
Nathaniel Flath wrote:
Hello,
I have ido activated. =A0If I do C-x C-f and navigate to a directory, C-d w= ill open a dired buffer in that directory. =A0Is there a way to open a shel= l buffer instead?

I don't use ido, so I don't even know how to test this. =A0But here= 's what I came
up with from looking at ido.el. =A0I didn't understand how to properly = implement
ido-magic-control-s, so you have to type `C-x C-f C-x C-s' (by analogy = with
`C-x C-f C-x C-d', which runs ido-enter-dired):

(defun ido-enter-shell ()
=A0"Drop into `shell' from file switching."
=A0(interactive)
=A0(setq ido-exit 'shell)
=A0(exit-minibuffer))

(define-key ido-file-dir-completion-map "\C-x\C-s" 'ido-enter= -shell)

--
Kevin Rodgers
Denver, Colorado, USA




--000e0cd295aefe3f10047e478ad4--