aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-06-04 09:02:55 +0000
committerRichard M. Stallman2003-06-04 09:02:55 +0000
commite9407052f9beb827d98b8a2f1c134935f660e9cd (patch)
treee3700cd24fc0f0490da121274b4f0a4e9c438604
parent638df3f700ee26cd18a7ca9fd9b2890cf44857a7 (diff)
downloademacs-e9407052f9beb827d98b8a2f1c134935f660e9cd.tar.gz
emacs-e9407052f9beb827d98b8a2f1c134935f660e9cd.zip
(dired-get-filename): Err for . and .. in usual case.
(dired-get-file-for-visit): Specify no-error to dired-get-filename, and check for real errors here. (dired-unmark-all-files): Specify no-error to dired-get-filename.
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/dired.el18
2 files changed, 27 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b2c79eb4e6e..6695307260b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12003-06-04 Richard M. Stallman <rms@gnu.org>
2
3 * dired.el (dired-get-filename): Err for . and .. in usual case.
4 (dired-get-file-for-visit): Specify no-error to dired-get-filename,
5 and check for real errors here.
6 (dired-unmark-all-files): Specify no-error to dired-get-filename.
7
8 * buff-menu.el (list-buffers-noselect): Use window-inside-edges
9 to compute the number of offset spaces.
10 (list-buffers-noselect): Use Buffer-menu-buffer+size to
11 indent the dashes properly. Put some in fixed-pitch.
12
12003-06-04 Lars Hansen <larsh@math.ku.dk> 132003-06-04 Lars Hansen <larsh@math.ku.dk>
2 14
3 * desktop.el (desktop-create-buffer): Undo last change. 15 * desktop.el (desktop-create-buffer): Undo last change.
diff --git a/lisp/dired.el b/lisp/dired.el
index 5397bad8b7c..02841adcb13 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1350,7 +1350,12 @@ Creates a buffer if necessary."
1350(defun dired-get-file-for-visit () 1350(defun dired-get-file-for-visit ()
1351 "Get the current line's file name, with an error if file does not exist." 1351 "Get the current line's file name, with an error if file does not exist."
1352 (interactive) 1352 (interactive)
1353 (let ((file-name (file-name-sans-versions (dired-get-filename) t))) 1353 ;; We pass t for second arg so that we don't get error for `.' and `..'.
1354 (let ((raw (dired-get-filename nil t))
1355 file-name)
1356 (if (null raw)
1357 (error "No file on this line"))
1358 (setq file-name (file-name-sans-versions raw t))
1354 (if (file-exists-p file-name) 1359 (if (file-exists-p file-name)
1355 file-name 1360 file-name
1356 (if (file-symlink-p file-name) 1361 (if (file-symlink-p file-name)
@@ -1482,6 +1487,11 @@ Optional arg NO-ERROR-IF-NOT-FILEP means return nil if no filename on
1482 (cond 1487 (cond
1483 ((null file) 1488 ((null file)
1484 nil) 1489 nil)
1490 ((and (not no-error-if-not-filep)
1491 (save-excursion
1492 (beginning-of-line)
1493 (looking-at dired-re-dir)))
1494 (error "Cannot operate on `.' or `..'"))
1485 ((eq localp 'verbatim) 1495 ((eq localp 'verbatim)
1486 file) 1496 file)
1487 ((and (eq localp 'no-dir) already-absolute) 1497 ((and (eq localp 'no-dir) already-absolute)
@@ -2658,8 +2668,10 @@ Type SPC or `y' to unmark one file, DEL or `n' to skip to next,
2658 (re-search-forward dired-re-mark nil t) 2668 (re-search-forward dired-re-mark nil t)
2659 (search-forward string nil t)) 2669 (search-forward string nil t))
2660 (if (or (not arg) 2670 (if (or (not arg)
2661 (dired-query 'query "Unmark file `%s'? " 2671 (let ((file (dired-get-filename t t)))
2662 (dired-get-filename t))) 2672 (and file
2673 (dired-query 'query "Unmark file `%s'? "
2674 file))))
2663 (progn (subst-char-in-region (1- (point)) (point) 2675 (progn (subst-char-in-region (1- (point)) (point)
2664 (preceding-char) ?\ ) 2676 (preceding-char) ?\ )
2665 (setq count (1+ count))))) 2677 (setq count (1+ count)))))