1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-02 11:21:42 +00:00

(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.
This commit is contained in:
Juri Linkov 2008-04-22 22:49:02 +00:00
parent 367c9b7c85
commit ebdb6f22b1
2 changed files with 11 additions and 9 deletions

View 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

View 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)