unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: joakim@verona.se
Cc: 9258@debbugs.gnu.org
Subject: bug#9258: 24.0.50; image-next-line doesnt allow omitting arg
Date: Sun, 07 Aug 2011 13:59:13 -0400	[thread overview]
Message-ID: <jwvei0xm7c9.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m3sjpe89zh.fsf@chopper.vpn.verona.se> (joakim@verona.se's message of "Sun, 07 Aug 2011 00:13:06 +0200")

> (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





  reply	other threads:[~2011-08-07 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-06 22:13 bug#9258: 24.0.50; image-next-line doesnt allow omitting arg joakim
2011-08-07 17:59 ` Stefan Monnier [this message]
2011-09-11  2:31   ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvei0xm7c9.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=9258@debbugs.gnu.org \
    --cc=joakim@verona.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).