From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: ffap: Directory does not exist, create it? Yeah sure, without permission Date: Tue, 04 Mar 2003 11:59:24 -0700 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3E64F78C.3020804@ihs.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1046804518 13583 80.91.224.249 (4 Mar 2003 19:01:58 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 4 Mar 2003 19:01:58 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 04 20:01:57 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18qHeS-0003Qq-00 for ; Tue, 04 Mar 2003 20:00:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18qHeA-0000GK-09 for gnu-bug-gnu-emacs@m.gmane.org; Tue, 04 Mar 2003 14:00:14 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18qHdw-00008u-00 for bug-gnu-emacs@prep.ai.mit.edu; Tue, 04 Mar 2003 14:00:00 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18qHdf-00083S-00 for bug-gnu-emacs@prep.ai.mit.edu; Tue, 04 Mar 2003 13:59:46 -0500 Original-Received: from mailbox.ucsd.edu ([132.239.1.53] helo=mailbox1.ucsd.edu) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18qHdS-0007aX-00 for bug-gnu-emacs@prep.ai.mit.edu; Tue, 04 Mar 2003 13:59:30 -0500 Original-Received: from mail.fu-berlin.de (mail.fu-berlin.de [160.45.11.165]) by mailbox1.ucsd.edu (8.12.8/8.12.3) with ESMTP id h24IxO8M064066 for ; Tue, 4 Mar 2003 10:59:25 -0800 (PST) Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Tue, 4 Mar 2003 19:59:24 +0100 (MET) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Tue, 4 Mar 2003 19:59:24 +0100 (MET) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 40 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: fu-berlin.de 1046804363 62653161 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-MailScanner: PASSED (v1.2.7 42178 h24IxO8M064066 mailbox1.ucsd.edu) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4555 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4555 Dan Jacobson wrote: > Using ffap, many a mistype causes the often seen > Directory does not exist, create it? (y or n) > Well, as 99% of the time, the answer is n, at least it could check > if the user could indeed create a dir there before asking, as the > answer would be > Creating directory: permission denied, /etc/nurdly/ > anyway. *** emacs-20.7/lisp/ffap.el.orig Sat Feb 13 07:42:35 1999 --- emacs-20.7/lisp/ffap.el Tue Mar 4 11:54:20 2003 *************** *** 1658,1664 **** (if (file-directory-p filename) (dired (expand-file-name filename)) (dired (concat (expand-file-name filename) "*")))) ! ((y-or-n-p "Directory does not exist, create it? ") (make-directory filename) (dired filename)) ((error "No such file or directory `%s'" filename))))) --- 1658,1665 ---- (if (file-directory-p filename) (dired (expand-file-name filename)) (dired (concat (expand-file-name filename) "*")))) ! ((and (file-writable-p (file-name-directory filename)) ! (y-or-n-p "Directory does not exist, create it? ")) (make-directory filename) (dired filename)) ((error "No such file or directory `%s'" filename))))) > Better would be just to assist the user in typing the names of > existing files, i.e. don't wipe out what he has typed so far... ??? -- Kevin Rodgers