From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Newsgroups: gmane.emacs.help Subject: Re: Go to my CWD! Date: Wed, 27 Jan 2010 22:30:10 +0100 Message-ID: <4B60B062.3090502@easy-emacs.de> References: <4B60964A.6070109@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1264627780 8977 80.91.229.12 (27 Jan 2010 21:29:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Jan 2010 21:29:40 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 27 22:29:38 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 1NaFSD-0003uy-Pu for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jan 2010 22:29:38 +0100 Original-Received: from localhost ([127.0.0.1]:60205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaFSC-0000cQ-VS for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jan 2010 16:29:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaFRa-0000Zh-5w for help-gnu-emacs@gnu.org; Wed, 27 Jan 2010 16:28:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaFRV-0000N6-Be for help-gnu-emacs@gnu.org; Wed, 27 Jan 2010 16:28:57 -0500 Original-Received: from [199.232.76.173] (port=51867 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaFRV-0000Mw-7z for help-gnu-emacs@gnu.org; Wed, 27 Jan 2010 16:28:53 -0500 Original-Received: from moutng.kundenserver.de ([212.227.17.10]:49240) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaFRU-0006nO-NA for help-gnu-emacs@gnu.org; Wed, 27 Jan 2010 16:28:53 -0500 Original-Received: from [192.168.178.27] (p54BEA8E8.dip0.t-ipconnect.de [84.190.168.232]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MXnnj-1NGCQP3oBT-00Wuba; Wed, 27 Jan 2010 22:28:51 +0100 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: X-Provags-ID: V01U2FsdGVkX1/ahUr/aHR5FlytsOEtlWlNVnMXedzuwjycGF7 nE6r+HOc4Zh60bdavq0rZ206bDu+IM5FpIQ0Thi+/JSwU476kK JFhL+tGXDGJ+5EdOMw0orWI/RLHfSGavCtn8GNJjC0= X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:71521 Archived-At: Andrea Crotti wrote: > Andreas Röhler writes: > > >> Andrea Crotti wrote: >> Maybe that way?: >> >> (defun my-shell-always-in-default-dir () >> (interactive) >> (shell default-directory)) >> >> Cheers >> >> > > Nice thanks that would work, but then I have to setup a wrapper for > every possible interpreter (octave, python etc etc...) > Something more automatic is not possible? > > > > > its quite easy to change the function shell for your needs. the beginning reads (interactive (list (and current-prefix-arg (prog1 (read-buffer "Shell buffer: " (generate-new-buffer-name "*shell*")) (if (file-remote-p default-directory) ;; It must be possible to declare a local default-directory. (setq default-directory (expand-file-name (read-file-name "Default directory: " default-directory default-directory t nil 'file-directory-p)))))))) you see the user is queried and our default-directory also will be delivered per default To automatize this, just introduce a variable Yes-I-will, ask for it at the right place(s), get your extension excuted instead (read-file-name BTW think its worth a feature request at emacs-devel Andreas