]> git.eshelyaron.com Git - emacs.git/commitdiff
(image-dired-track-original-file)
authorJuri Linkov <juri@jurta.org>
Tue, 22 Apr 2008 22:49:02 +0000 (22:49 +0000)
committerJuri Linkov <juri@jurta.org>
Tue, 22 Apr 2008 22:49:02 +0000 (22:49 +0000)
(image-dired-modify-mark-on-thumb-original-file):
Use `dired-goto-file' instead of `search-forward'.  This solves
a bug with finding files where the file name is a subset of other
file names.  Doc fix.

lisp/ChangeLog
lisp/image-dired.el

index fac09bccdb9a9f682c56a0519ee982f129bc2aee..445b805cd7a0cac917ff0fac47d17ecf33d0ba61 100644 (file)
@@ -1,3 +1,11 @@
+2008-04-22  Mathias Dahl  <mathias.dahl@gmail.com>
+
+       * image-dired.el (image-dired-track-original-file)
+       (image-dired-modify-mark-on-thumb-original-file):
+       Use `dired-goto-file' instead of `search-forward'.  This solves
+       a bug with finding files where the file name is a subset of other
+       file names.  Doc fix.
+
 2008-04-22  Juri Linkov  <juri@jurta.org>
 
        * menu-bar.el (buffers-menu-max-size): Move its definition down to
index 14e98f97075389bf4f2dc911995b5c5862023a9f..ffefef847a763fbb7e2d5addb7679dfe48503c68 100644 (file)
@@ -1030,12 +1030,9 @@ use only useful if `image-dired-track-movement' is nil."
         (dired-buf (image-dired-associated-dired-buffer))
         (file-name (image-dired-original-file-name)))
     (when (and (buffer-live-p dired-buf) file-name)
-      (setq file-name (file-name-nondirectory file-name))
       (set-buffer dired-buf)
-      (goto-char (point-min))
-      (if (not (search-forward file-name nil t))
+      (if (not (dired-goto-file file-name))
           (message "Could not track file")
-        (dired-move-to-filename)
         (set-window-point
          (image-dired-get-buffer-window dired-buf) (point)))
       (set-buffer old-buf))))
@@ -1199,8 +1196,7 @@ comment."
 
 (defun image-dired-modify-mark-on-thumb-original-file (command)
   "Modify mark in dired buffer.
-This is quite ugly but I don't know how to implemented in a better
-way.  COMMAND is one of 'mark for marking file in dired, 'unmark for
+COMMAND is one of 'mark for marking file in dired, 'unmark for
 unmarking file in dired or 'flag for flagging file for delete in
 dired."
   (let ((file-name (image-dired-original-file-name))
@@ -1209,9 +1205,7 @@ dired."
         (message "No image, or image with correct properties, at point.")
     (with-current-buffer dired-buf
         (message "%s" file-name)
-        (setq file-name (file-name-nondirectory file-name))
-        (goto-char (point-min))
-        (if (search-forward file-name nil t)
+        (if (dired-goto-file file-name)
             (cond ((eq command 'mark) (dired-mark 1))
                   ((eq command 'unmark) (dired-unmark 1))
                   ((eq command 'toggle)