[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bibtex-convert-alien fails
From: |
Ulrich Mueller |
Subject: |
bibtex-convert-alien fails |
Date: |
Tue, 19 Feb 2008 23:06:52 +0100 |
Andreas K. Huettel has discovered a bug in bibtex.el in Emacs 22.1
(also in 22.1.90 and current EMACS_22_BASE CVS):
Function bibtex-convert-alien always fails with error message
"Wrong type argument: number-or-marker-p, nil".
The reason is that "sit-for" is called with 3 arguments, while it
accepts only 2. There are actually two problems:
1) bibtex-convert-alien calls sit-for in the obsolete three-argument
form.
2) sit-for cannot be called with three arguments if the second
argument is nil (i.e. the second argument is not optional).
This is not backwards compatible with the behaviour of the function
in Emacs 21.
The patch included below should fix both problems.
Ulrich
Index: lisp/textmodes/bibtex.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/bibtex.el,v
retrieving revision 1.128.2.2
diff -u -B -u -r1.128.2.2 bibtex.el
--- lisp/textmodes/bibtex.el 7 Jan 2008 02:21:46 -0000 1.128.2.2
+++ lisp/textmodes/bibtex.el 19 Feb 2008 21:34:37 -0000
@@ -4176,14 +4176,14 @@
entries from minibuffer."
(interactive "*P")
(message "Starting to validate buffer...")
- (sit-for 1 nil t)
+ (sit-for 1 t)
(bibtex-realign)
(deactivate-mark) ; So bibtex-validate works on the whole buffer.
(if (not (let (bibtex-maintain-sorted-entries)
(bibtex-validate)))
(message "Correct errors and call `bibtex-convert-alien' again")
(message "Starting to reformat entries...")
- (sit-for 2 nil t)
+ (sit-for 2 t)
(bibtex-reformat read-options)
(goto-char (point-max))
(message "Buffer is now parsable. Please save it.")))
Index: lisp/subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.554.2.11
diff -u -B -u -r1.554.2.11 subr.el
--- lisp/subr.el 4 Feb 2008 15:31:09 -0000 1.554.2.11
+++ lisp/subr.el 19 Feb 2008 21:55:13 -0000
@@ -1764,7 +1764,7 @@
\(fn SECONDS &optional NODISP)"
(when (or obsolete (numberp nodisp))
- (setq seconds (+ seconds (* 1e-3 nodisp)))
+ (setq seconds (+ seconds (* 1e-3 (or nodisp 0))))
(setq nodisp obsolete))
(cond
(noninteractive
- bibtex-convert-alien fails,
Ulrich Mueller <=