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

Re: Omitting optional argument of `w3m-tab-previous-buffer' causes an error



IRIE-san wrote:
> I found that a function `w3m-tab-previous-buffer' causes an error
> "Wrong type argument: number-or-marker-p, nil" if it is called with
> no arguments non-interactively like "(w3m-tab-previous-buffer)".

> Currently the code is as follows:

> (defun w3m-tab-previous-buffer (&optional n event)
>   "Turn N pages of emacs-w3m buffers behind."
>   (interactive (list (prefix-numeric-value current-prefix-arg)
> 		     last-command-event))
>   (w3m-tab-next-buffer (- n) event))

> Here, "(- n)" cannot be calculated if N is omitted. To avoid the error,
> it should be modified as:

> (defun w3m-tab-previous-buffer (&optional n event)
>   "Turn N pages of emacs-w3m buffers behind."
>   (interactive (list (prefix-numeric-value current-prefix-arg)
> 		     last-command-event))
>   (w3m-tab-next-buffer (- (or n 1)) event))

Yeah, that's exactly a bug.  Thank you for finding it out.
Fixed in the emacs-w3m CVS trunk.

Regards,