From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Info-insert-dir Date: Tue, 20 Mar 2007 10:56:55 +0100 Message-ID: <45FFAFE7.2010702@gmx.at> References: <45FAF396.1030504@gmx.at> <45FD35C4.7060207@gmx.at> <45FE5CDD.3010909@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1174384643 7576 80.91.229.12 (20 Mar 2007 09:57:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Mar 2007 09:57:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 20 10:57:15 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HTb5a-0004xW-8a for ged-emacs-devel@m.gmane.org; Tue, 20 Mar 2007 10:57:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HTb77-0008BU-UX for ged-emacs-devel@m.gmane.org; Tue, 20 Mar 2007 04:58:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HTb6X-0007zw-8E for emacs-devel@gnu.org; Tue, 20 Mar 2007 05:58:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HTb6W-0007zP-3J for emacs-devel@gnu.org; Tue, 20 Mar 2007 05:58:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HTb6V-0007zL-QD for emacs-devel@gnu.org; Tue, 20 Mar 2007 04:58:07 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HTb4w-00069D-Qx for emacs-devel@gnu.org; Tue, 20 Mar 2007 05:56:31 -0400 Original-Received: (qmail invoked by alias); 20 Mar 2007 09:56:28 -0000 Original-Received: from N857P026.adsl.highway.telekom.at (EHLO [62.47.51.26]) [62.47.51.26] by mail.gmx.net (mp026) with SMTP; 20 Mar 2007 10:56:28 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+BTGITG0OBwCzW/CCX66sxel6M2wqz7gM8HbkaMc LyrK7LnOwaS/P2 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68152 Archived-At: > Probably. It's a customizable variable and `wid-edit' doesn't even > check if the user puts valid directory names in there. > > It shouldn't check that. We do not try to stop users from putting > nonexistent directory names into Lisp variables. I meant `wid-edit' doesn't even check whether it's a "directory name" in the sense of a filename ending with a slash (`wid-edit' doesn't discriminate directories and files although it provides separate widgets for them). > It would be incorrect to change call-process to change the default > directory on its own. Often the execution of a command depends on the > current directory, so that if the current directory is nonexistent, an > error is the right thing. Agreed. > We could make a subroutine which does this and calls call-process. What about `call-process-region', `start-process', `shell-command'? Maybe we could introduce a macro like (defmacro with-valid-default-directory (&rest body) "Run BODY with `default-directory' bound to an existing directory." (declare (indent 0) (debug t)) `(let ((default-directory (if (and (stringp default-directory) (file-directory-p default-directory)) default-directory (expand-file-name "~/")))) ,@body))