[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#9258: 24.0.50; image-next-line doesnt allow omitting arg
From: |
Stefan Monnier |
Subject: |
bug#9258: 24.0.50; image-next-line doesnt allow omitting arg |
Date: |
Sun, 07 Aug 2011 13:59:13 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> (defun image-next-line (&optional n)
> "Scroll image in current window upward by N lines.
> Stop if the bottom edge of the image is reached."
> (interactive "p")
> (cond ((= n 0) nil)
> ((< n 0)
> (image-set-window-vscroll (max 0 (+ (window-vscroll) n))))
> (t
> (let* ((image (image-get-display-property))
> (edges (window-inside-edges))
> (win-height (- (nth 3 edges) (nth 1 edges)))
> (img-height (ceiling (cdr (image-display-size image)))))
> (image-set-window-vscroll (min (max 0 (- img-height win-height))
> (+ n (window-vscroll))))))))
> declaration says n is optional but nil will fail on the numeric tests.
> so, either n isn't optional or the cond rearanged.
Please just make it mandatory.
Stefan