unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15884: 24.3; image-dired is mixing up buffers
@ 2013-11-13 16:36 eschulte
  2013-11-13 16:54 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: eschulte @ 2013-11-13 16:36 UTC (permalink / raw)
  To: 15884

When in an `image-dired-thumbnail-mode' buffer the movement functions
(`image-dired-forward-image' and `image-dired-backward-image') get
confused if the corresponding dired buffer is not visible and throws the
point to the end of the thumbnail buffer making navigation impossible.
Changing the definition of `image-dired-track-original-file' from the
original,

    (defun image-dired-track-original-file ()
      "Track the original file in the associated dired buffer.
    See documentation for `image-dired-toggle-movement-tracking'.
    Interactive use only useful if `image-dired-track-movement' is nil."
      (interactive)
      (let ((old-buf (current-buffer))
            (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))))

to the following

    (defun image-dired-track-original-file ()
      "Track the original file in the associated dired buffer.
    See documentation for `image-dired-toggle-movement-tracking'.
    Interactive use only useful if `image-dired-track-movement' is nil."
      (interactive)
      (let ((old-buf (current-buffer))
            (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")
            (let ((window (image-dired-get-buffer-window dired-buf)))
              (if window (set-window-point window (point))
                (message "Could not find associated dired buffer."))))
          (set-buffer old-buf))))

fixes this bug.

Best, Eric





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#15884: 24.3; image-dired is mixing up buffers
  2013-11-13 16:36 bug#15884: 24.3; image-dired is mixing up buffers eschulte
@ 2013-11-13 16:54 ` Glenn Morris
  0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2013-11-13 16:54 UTC (permalink / raw)
  To: eschulte; +Cc: 15884


I believe this is already fixed in Emacs trunk.
http://debbugs.gnu.org/14909





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-13 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-13 16:36 bug#15884: 24.3; image-dired is mixing up buffers eschulte
2013-11-13 16:54 ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).