bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacs 21 bug scrolling image horizontally to right in other window


From: Greg Hill
Subject: Emacs 21 bug scrolling image horizontally to right in other window
Date: Mon, 3 Feb 2003 17:14:37 -0800

When scrolling a window to the right in an "other-window", if the window being scrolled contains an image, under certain circumstances the rightmost character-width's worth of the image gets duplicated.

To see this happen, use the showImage routine below (referencing some image file you have) to display an image. Use the scroll-image-left routine to scroll it to the left. Then, with some window selected other than the one displaying the showImage buffer, use the scroll-image-right routine to scroll the image to the right, and notice what happens to its right-hand edge.

Then choose the window displaying the image as the selected window, and use the same scrolling routines. Notice that the problem goes away.

Next, uncomment out the first (insert "\n") in showImage, and repeat the original experiment. Notice that the problem goes away.

Finally, leave the initial (insert "\n") not commented out, change the 1 in the call to goto-char to a 2, and notice that the problem comes back.

(defun showImage ()
  (interactive)
  (save-selected-window
    (switch-to-buffer-other-window "showImage")
    (erase-buffer)
;;; (insert "\n")
    (insert-image (create-image "rms.jpeg") (point))
    (insert "\n")
    (goto-char 1) ))

(defun scroll-image-left ()
  (interactive)
  (save-selected-window
    (select-window (get-buffer-window "showImage"))
    (scroll-left 1)))

(defun scroll-image-right ()
  (interactive)
  (save-selected-window
    (select-window (get-buffer-window "showImage"))
    (scroll-right 1)))

(global-set-key [M-left] 'scroll-image-left)

(global-set-key [M-right] 'scroll-image-right)

--Greg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]