(scan_sexps_forward): Fix previous change.
[bpt/emacs.git] / lisp / dired-x.el
index c8aaf78..e995024 100644 (file)
@@ -588,8 +588,7 @@ This functions works by temporarily binding `dired-marker-char' to
               (if (dired-mark-unmarked-files omit-re nil nil dired-omit-localp)
                   (progn
                     (setq count (dired-do-kill-lines nil "Omitted %d line%s."))
-                    ;; Force an update of modeline.
-                    (set-buffer-modified-p (buffer-modified-p)))
+                    (force-mode-line-update))
                 (message "(Nothing to omit)"))))
         ;; Try to preserve modified state of buffer.  So `%*' doesn't appear
         ;; in mode-line of omitted buffers.
@@ -1367,18 +1366,20 @@ See also variable `dired-vm-read-only-folders'."
 ;;; REDEFINE.
 ;;; Redefines dired.el's version of `dired-find-buffer-nocreate'
 (defun dired-find-buffer-nocreate (dirname)
-  (if dired-find-subdir
+  (if (and dired-find-subdir
+          ;; don't try to find a wildcard as a subdirectory
+          (string-equal dirname (file-name-directory dirname)))
       (let* ((cur-buf (current-buffer))
-             (buffers (nreverse
+            (buffers (nreverse
                       (dired-buffers-for-dir (expand-file-name dirname))))
-             (cur-buf-matches (and (memq cur-buf buffers)
-                                   ;; wildcards must match, too:
-                                   (equal dired-directory dirname))))
-        ;; We don't want to switch to the same buffer---
-        (setq buffers (delq cur-buf buffers));;need setq with delq
-        (or (car (sort buffers (function dired-buffer-more-recently-used-p)))
-            ;; ---unless it's the only possibility:
-            (and cur-buf-matches cur-buf)))
+            (cur-buf-matches (and (memq cur-buf buffers)
+                                  ;; wildcards must match, too:
+                                  (equal dired-directory dirname))))
+       ;; We don't want to switch to the same buffer---
+       (setq buffers (delq cur-buf buffers));;need setq with delq
+       (or (car (sort buffers (function dired-buffer-more-recently-used-p)))
+           ;; ---unless it's the only possibility:
+           (and cur-buf-matches cur-buf)))
     (dired-old-find-buffer-nocreate dirname)))
 
 ;; This should be a builtin