Subject: bug#12110: 23.4; woman.el error on non-numeric arg

From: Kevin Ryde <[email-masked]>
Date: Wed, 01 Aug 2012 10:36:18 +1000

Processing the file ip.1 below with

    (woman-find-file "ip.1")

gets an error

    Symbol's function definition is void: nil

with backtrace ip-backtrace.txt below.

The .IP line in ip.1 is bad in that the indentation arg is not a number
but I hoped woman would give some warning log and then continue
formatting the rest.

Putting the debugger on woman-parse-numeric-value suggests the two
skip-syntax-forward calls end up putting point in the middle of the .SH
request on the next line.

I wonder if woman-parse-numeric-value should confine itself to the
current line, per diff below.

2012-07-31  Kevin Ryde  <[email-masked]>

	* woman.el (woman-parse-numeric-value): Don't go past end of line for
	a bad value or expression.  Ensures point isn't moved part-way into a
	request on the following line, such as
	.IP "str" (notanumber)
	.SH FOO

I struck this in the sdbm.3 man page

    http://cpansearch.perl.org/src/RJBS/perl-5.16.0/ext/SDBM_File/sdbm/sdbm.3

which has a bad .IP line for the author.  Maybe the quotes should be on
the whole string, but in any case it'd be good if woman didn't error out.

    .SH AUTHOR
    .IP "Ozan S. Yigit" ([email-masked])
    .SH BUGS

--- woman-24.el	2012-07-09 12:07:42.000000000 +1000
+++ woman.el	2012-07-31 10:16:26.000000000 +1000
@@ -3588,7 +3588,7 @@
       (let (n)
 	(forward-char)
 	(setq n (woman-parse-numeric-arg))
-	(skip-syntax-forward " ")
+	(skip-syntax-forward " " (line-end-position))
 	(if (eq (following-char) ?\))
 	    (forward-char)
 	  (WoMan-warn "Parenthesis confusion in numeric expression!"))
@@ -3640,7 +3640,7 @@
 			(buffer-substring
 			 (point)
 			 (line-end-position)))
-	    (skip-syntax-forward "^ ")
+	    (skip-syntax-forward "^ " (line-end-position))
 	    0)
 	(goto-char (match-end 0))
 	;; Check for scale factor:

In GNU Emacs 23.4.1 (i486-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-04-08 on biber, modified by Debian
configured using `configure  '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.4/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -DDEBIAN -O2' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t