Fix bug in M-x dired-create-directory: PROMPT-FOR-DIRECTORY recently
authorChris Hanson <org/chris-hanson/cph>
Wed, 9 May 2001 21:03:05 +0000 (21:03 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 9 May 2001 21:03:05 +0000 (21:03 +0000)
changed so that it always returns the result as a directory pathname
with no file part.  The code here was assuming that the name part was
always present.

v7/src/edwin/dired.scm

index 03c6e1ebe26d7a27c73d647aca1b41ed4e1534b7..5d33d34683df80bfaa96b3854e9aedbb370de363 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: dired.scm,v 1.182 2000/04/30 22:17:01 cph Exp $
+;;; $Id: dired.scm,v 1.183 2001/05/09 21:03:05 cph Exp $
 ;;;
-;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
+;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology
 ;;;
 ;;; This program is free software; you can redistribute it and/or
 ;;; modify it under the terms of the GNU General Public License as
@@ -16,7 +16,8 @@
 ;;;
 ;;; You should have received a copy of the GNU General Public License
 ;;; along with this program; if not, write to the Free Software
-;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;;; 02111-1307, USA.
 
 ;;;; Directory Editor
 ;; package: (edwin dired)
@@ -524,13 +525,15 @@ With a prefix argument you can edit the current listing switches instead."
   "Create a directory named DIRECTORY."
   "DCreate directory"
   (lambda (directory)
-    (make-directory directory)
-    (let ((lstart (mark-right-inserting-copy (line-start (current-point) 0))))
-      (with-read-only-defeated lstart
-       (lambda ()
-         (insert-dired-entry! directory lstart)))
-      (set-dired-point! lstart)
-      (mark-temporary! lstart))))
+    (let ((directory (directory-pathname-as-file directory)))
+      (make-directory directory)
+      (let ((lstart
+            (mark-right-inserting-copy (line-start (current-point) 0))))
+       (with-read-only-defeated lstart
+         (lambda ()
+           (insert-dired-entry! directory lstart)))
+       (set-dired-point! lstart)
+       (mark-temporary! lstart)))))
 
 (define-command dired-do-copy
   "Copy all marked (or next ARG) files, or copy the current file.