From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Francis Moreau" Newsgroups: gmane.emacs.help Subject: Re: how to not change the working directory when opening a file Date: Tue, 15 Jan 2008 18:16:04 +0100 Message-ID: <38b2ab8a0801150916s110e37d7p8146af358df36990@mail.gmail.com> References: <38b2ab8a0801140715h6a920332t3598c7c10b1f4d2e@mail.gmail.com> <87hchguhe0.fsf@offby1.atm01.sea.blarg.net> <478BFC8C.3020800@gmail.com> <38b2ab8a0801150127x27021810s542c6a921c495a7f@mail.gmail.com> <87ejcjt945.fsf@offby1.atm01.sea.blarg.net> <38b2ab8a0801150753o3ef1bb59sf50cb2ab9ddc520d@mail.gmail.com> <87lk6rt5ri.fsf@moley.moleskin.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1200417405 9168 80.91.229.12 (15 Jan 2008 17:16:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jan 2008 17:16:45 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Sebastian Tennant" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 15 18:17:07 2008 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.50) id 1JEpPP-0007vf-7P for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Jan 2008 18:17:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEpP0-0007Gg-GO for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Jan 2008 12:16:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JEpOR-0006zY-RP for help-gnu-emacs@gnu.org; Tue, 15 Jan 2008 12:16:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JEpOQ-0006wf-7X for help-gnu-emacs@gnu.org; Tue, 15 Jan 2008 12:16:07 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEpOP-0006wT-UM for help-gnu-emacs@gnu.org; Tue, 15 Jan 2008 12:16:05 -0500 Original-Received: from rv-out-0910.google.com ([209.85.198.189]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JEpOP-0006O9-7Z for help-gnu-emacs@gnu.org; Tue, 15 Jan 2008 12:16:05 -0500 Original-Received: by rv-out-0910.google.com with SMTP id c27so3248091rvf.6 for ; Tue, 15 Jan 2008 09:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=GO8p71S6j2vkLJLqacFPwNmccR+XQKlCpPuVQtI85c0=; b=ZXjV0VyR34ZMj8Za3UALcAiFYqz8nJaeIGkmGnskGmwU8624RnD3fN6ceOUp0aurmGd8ZEypE0r6PCTvO4O2FXeJjOrVuIckoelLgAgpGLHuIoQ1VlulL0Kr3fk7cGS3rXwKg0Jzyw+3hnHvqssMaBCr0U5mY0QRrbGJx3Me0jo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hOHNA9CXCk8+1TK++H6b+9AiESZ24wLVihqd5xHledYYJlF7lVHq2CFiWRHjOLr3IPJ2qblG2w1ChG/2u1vqPgMbpu3WI/qOdywwQAEjLlCmdSqVpUKZyBxxfE5tLZuXV0+3TDaS0fO0mlGHi0sPaZY+iiAl7ZlzYeHkg1BrtFY= Original-Received: by 10.140.172.6 with SMTP id u6mr4749542rve.192.1200417364035; Tue, 15 Jan 2008 09:16:04 -0800 (PST) Original-Received: by 10.140.193.5 with HTTP; Tue, 15 Jan 2008 09:16:04 -0800 (PST) In-Reply-To: <87lk6rt5ri.fsf@moley.moleskin.org> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: 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:50737 Archived-At: On Jan 15, 2008 5:25 PM, Sebastian Tennant wrote: > Quoth "Francis Moreau" : > > (add-hook 'post-mode-hook '(lambda () (setq default-directory emacs-startup-directory))) > > If it works go with it. It's also a more focussed solution than: > > (cd (getenv "PWD")) > > in that it only applies to post-mode, although my 'getenv' solution is > perhaps more flexible in that Emacs' default directory at startup will > always be the directory you launched Emacs from, rather than the value > of emacs-startup-directory. > > Just for your information, you shouldn't really quote lambda functions, > i.e., you should remove the single quote before (lambda ...). > > Quoting lambda functions happens to work in Emacs Lisp but won't work in > other Lisp dialects, so it's not a good habit to get into. > For for this information. I actually don't know elisp at all... -- Francis