From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Hiroshi Fujishima Newsgroups: gmane.emacs.devel Subject: [ffap.el] dired-at-point bug Date: Thu, 19 Feb 2004 13:57:40 +0900 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <7c7jyjr7i3.fsf@eyesore.nature.tsukuba.ac.jp> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1077166989 31115 80.91.224.253 (19 Feb 2004 05:03:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 19 Feb 2004 05:03:09 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Feb 19 06:03:01 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AtgKz-0007U0-00 for ; Thu, 19 Feb 2004 06:03:01 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AtgKy-0000eI-00 for ; Thu, 19 Feb 2004 06:03:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AtgJJ-0001TZ-Km for emacs-devel@quimby.gnus.org; Thu, 19 Feb 2004 00:01:17 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AtgIh-0001Qn-8s for emacs-devel@gnu.org; Thu, 19 Feb 2004 00:00:39 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AtgGC-0000ks-HA for emacs-devel@gnu.org; Wed, 18 Feb 2004 23:58:35 -0500 Original-Received: from [130.158.36.68] (helo=nature.tsukuba.ac.jp) by monty-python.gnu.org with smtp (Exim 4.24) id 1AtgFt-0000Ku-Uz for emacs-devel@gnu.org; Wed, 18 Feb 2004 23:57:46 -0500 Original-Received: (qmail 18235 invoked by uid 1031); 19 Feb 2004 04:57:40 -0000 Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (usg-unix-v) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20064 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20064 In emacs-21.3 M-x ffap-bindings and C-x d ~not-exest creates `~not-exest' directory. In emacs-21.3.50 (after 2003-03-06) M-x ffap-bindings and C-x d ~not-exest causes `Wrong type argument: stringp, nil' error, because (file-name-directory "~not-exest") return nil though file-writable-p() require string type argument. 2003-03-06 Kevin Rodgers (tiny change) * ffap.el (dired-at-point): Check whether the user can create a directory before asking about creating it. Index: ffap.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/ffap.el,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- ffap.el 15 Feb 2003 19:26:25 -0000 1.35 +++ ffap.el 6 Mar 2003 20:30:05 -0000 1.36 @@ -1,4 +1,4 @@ -;;; ffap.el --- find file (or url) at point +;; ffap.el --- find file (or url) at point ;; ;; Copyright (C) 1995, 96, 97, 2000 Free Software Foundation, Inc. ;; @@ -1658,7 +1658,8 @@ (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? ") + ((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))))) -- Hiroshi Fujishima