[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Omitting optional argument of `w3m-tab-previous-buffer' causes an error
- From: IRIE Shinsuke <irieshinsuke@xxxxxxxxxxx>
- Date: Thu, 14 Oct 2010 07:39:42 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 11389
Hi,
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))
Thanks.
IRIE Shinsuke