[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Small bug in image-dired-track-original-file - suggestions wanted
From: |
Mathias Dahl |
Subject: |
Re: Small bug in image-dired-track-original-file - suggestions wanted |
Date: |
Mon, 31 Mar 2008 20:08:51 +0200 |
> Thanks! I replaced some code with `dired-goto-file' and it seems to
> solve the bug and it sems to have acceptable performance.
And here is the fix:
diff -c /home/mathias/image-dired.el /home/mathias/prj/emacs/lisp/image-dired.el
*** /home/mathias/image-dired.el 2008-03-31 20:04:00.000000000 +0200
--- /home/mathias/prj/emacs/lisp/image-dired.el 2008-03-31
20:04:32.000000000 +0200
***************
*** 1030,1041 ****
(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))
(message "Could not track file")
- (dired-move-to-filename)
(set-window-point
(image-dired-get-buffer-window dired-buf) (point)))
(set-buffer old-buf))))
--- 1030,1038 ----
(dired-buf (image-dired-associated-dired-buffer))
(file-name (image-dired-original-file-name)))
(when (and (buffer-live-p dired-buf) file-name)
(set-buffer dired-buf)
! (if (not (dired-goto-file file-name))
(message "Could not track file")
(set-window-point
(image-dired-get-buffer-window dired-buf) (point)))
(set-buffer old-buf))))
***************
*** 1199,1206 ****
(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
unmarking file in dired or 'flag for flagging file for delete in
dired."
(let ((file-name (image-dired-original-file-name))
--- 1196,1202 ----
(defun image-dired-modify-mark-on-thumb-original-file (command)
"Modify mark in dired buffer.
! 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,1217 ****
(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)
(cond ((eq command 'mark) (dired-mark 1))
((eq command 'unmark) (dired-unmark 1))
((eq command 'toggle)
--- 1205,1211 ----
(message "No image, or image with correct properties, at point.")
(with-current-buffer dired-buf
(message "%s" file-name)
! (if (dired-goto-file file-name)
(cond ((eq command 'mark) (dired-mark 1))
((eq command 'unmark) (dired-unmark 1))
((eq command 'toggle)
Diff finished. Mon Mar 31 20:04:47 2008
The change that has been done is to use `dired-goto-file file-name'
instead of the too simple `search-forward', in both of these
functions.
Could someone commit this?
/Mathias