From xemacs-m  Mon Feb  3 23:07:44 1997
Received: from dres.elam.org (dres@cola163.scsn.net [206.25.247.163])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id XAA26842
	for <xemacs-beta@xemacs.org>; Mon, 3 Feb 1997 23:07:40 -0600 (CST)
Received: (from dres@localhost)
	by dres.elam.org (8.8.5/8.8.5) id AAA25243;
	Tue, 4 Feb 1997 00:03:52 -0500
X-Face: #3!F#4{@=h{N/(&O{x0;?nGgy#|_D%{<n>h?Q#Z6x)O\4lZ&sq"PAy?Wq<kkzA{Umn"\EtJ
 ;3*SSaF@|qR1~jt&:9Gi@ts!YZo$W}S#gic;}M6[UdUVfomDx?kQg#o?d.9}-AlY%b\YS"(kVn8hT}
 _/QA$%on0<ESZI0S%B&`s%PMhf^Fh,rH0\.;X&HSBjA:;Z1,6?"B$UCrbAm,
To: xemacs-beta@xemacs.org
Cc: wmperry@cs.indiana.edu
Subject: w3 error
Mime-Version: 1.0 (generated by tm-edit 7.101)
Content-Type: multipart/mixed;
 boundary="Multipart_Tue_Feb__4_00:03:51_1997-1"
Content-Transfer-Encoding: 7bit
From: James LewisMoss <dres@scsn.net>
Date: 04 Feb 1997 00:03:51 -0500
Message-ID: <hhbua117t4.fsf@dres.elam.org>
Lines: 154
X-Mailer: Gnus v5.4.8/XEmacs 20.0

--Multipart_Tue_Feb__4_00:03:51_1997-1
Content-Type: text/plain; charset=US-ASCII


This is with xemacs 20.0 (sorta-maybe-pre-release).  Linux 2.0.28,
libc 5.4.20, XFree86 3.2...

I reported this a little earlier today.  I was getting the backtrace:


--Multipart_Tue_Feb__4_00:03:51_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="w3-error"
Content-Transfer-Encoding: 7bit

Signaling: (wrong-type-argument stringp nil)
  string-match("^ *\\([-+*/]\\) *" nil)
  font-spatial-to-canonical(nil)
  font-spatial-to-canonical("+12pt")
  css-expand-length("+12pt")
  css-expand-value(length "+12pt")
  css-parse-args(320 339)
  css-parse("file:/usr/local/lib/xemacs-20.0-b93/etc/w3/stylesheet" nil nil)
  w3-find-default-stylesheets()
  w3-refresh-stylesheets()
  w3-do-setup()
  #<compiled-function (from "w3.elc") (&optional url) "...(347)" [w3-setup-done w3-do-setup boundp w3-working-buffer url-working-buffer command-line-args-left string-match url-nonrelative-link url "" error "No document specified!" "^www:[^/].*" file-name-directory url-current-file 4 nil string-to-char ?\  1 ?\# w3-relative-link current-prefix-arg w3-dump-to-disk w3-download-url url-view-url t url-buffer-visiting buf lastbuf x "file:nil" url-request-method "GET" "get" w3-reuse-buffers (no never reload) (yes reuse always) ask ding message "Warning: Invalid value for variable w3-reuse-buffers: %s" prin1-to-string sit-for 2 url-confirmation-func format "Reuse URL in buffer %s? " buffer-name url-retrieve ...] 6 ("/usr/local/lib/xemacs-20.0-b93/lisp/w3/w3.elc" . 9042) (list (w3-read-url-with-default))>("http://www.cs.sc.edu/~moss")
  call-interactively(w3-fetch)
  command-execute(w3-fetch t)
  execute-extended-command(nil)
  call-interactively(execute-extended-command)

After I loaded my options file, but not before it.  I still have no
idea what was actually causing this difference between before and
after.  I tracked the problem down to a function in lisp/w3/font.el.
The problem was that '(font-default-size-for-device nil)' returns
nil.  When '(string-match "some string" nil)' is called we error out.
The following patch fixes this for me.

Jim

--Multipart_Tue_Feb__4_00:03:51_1997-1
Content-Type: text/plain; charset=US-ASCII

@James LewisMoss                 | moss@cs.sc.edu | Blessed Be!
@    http://www.cs.sc.edu/~moss  | dres@scsn.net  | Linux is cool!
@"Argue for your limitations and sure enough, they're yours." Bach


--Multipart_Tue_Feb__4_00:03:51_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="w3.diff"
Content-Transfer-Encoding: 7bit

--- ./font.el.old	Mon Feb  3 23:37:24 1997
+++ ./font.el	Mon Feb  3 23:43:20 1997
@@ -297,49 +297,52 @@
   ;; 1 in = 6 pa = 25.4 mm = 72 pt
   (if (numberp spec)
       spec
-    (let ((num nil)
-	  (type nil)
-	  ;; If for any reason we get null for any of this, default
-	  ;; to 1024x768 resolution on a 17" screen
-	  (pix-width (float (or (device-pixel-width device) 1024)))
-	  (mm-width (float (or (device-mm-width device) 293)))
-	  (retval nil))
-      (cond
-       ((string-match "^ *\\([-+*/]\\) *" spec) ; math!  whee!
-	(let ((math-func (intern (match-string 1 spec)))
-	      (other (font-spatial-to-canonical
-		      (substring spec (match-end 0) nil)))
-	      (default (font-spatial-to-canonical
-			(font-default-size-for-device device))))
-	  (if (fboundp math-func)
-	      (setq type "px"
-		    spec (int-to-string (funcall math-func default other)))
-	    (setq type "px"
-		  spec (int-to-string other)))))
-       ((string-match "[^0-9.]+$" spec)
-	(setq type (substring spec (match-beginning 0))
-	      spec (substring spec 0 (match-beginning 0))))
-       (t
-	(setq type "px"
-	      spec spec)))
-      (setq num (string-to-number spec))
-      (cond
-       ((member type '("pixel" "px" "pix"))
-	(setq retval (* num (/ pix-width mm-width) (/ 25.4 72.0))))
-       ((member type '("point" "pt"))
-	(setq retval num))
-       ((member type '("pica" "pa"))
-	(setq retval (* num 12.0)))
-       ((member type '("inch" "in"))
-	(setq retval (* num 72.0)))
-       ((string= type "mm")
-	(setq retval (* num (/ 72.0 25.4))))
-       ((string= type "cm")
-	(setq retval (* num 10 (/ 72.0 25.4))))
-       (t
-	(setq retval num))
-       )
-      retval)))
+    (if (not spec)
+        nil
+      (let ((num nil)
+            (type nil)
+            ;; If for any reason we get null for any of this, default
+            ;; to 1024x768 resolution on a 17" screen
+            (pix-width (float (or (device-pixel-width device) 1024)))
+            (mm-width (float (or (device-mm-width device) 293)))
+            (retval nil))
+        (cond
+         ((string-match "^ *\\([-+*/]\\) *" spec) ; math!  whee!
+          (let ((math-func (intern (match-string 1 spec)))
+                (other (font-spatial-to-canonical
+                        (substring spec (match-end 0) nil)))
+                (default (or (font-spatial-to-canonical
+                              (font-default-size-for-device device))
+                             12)))
+            (if (fboundp math-func)
+                (setq type "px"
+                      spec (int-to-string (funcall math-func default other)))
+              (setq type "px"
+                    spec (int-to-string other)))))
+         ((string-match "[^0-9.]+$" spec)
+          (setq type (substring spec (match-beginning 0))
+                spec (substring spec 0 (match-beginning 0))))
+         (t
+          (setq type "px"
+                spec spec)))
+        (setq num (string-to-number spec))
+        (cond
+         ((member type '("pixel" "px" "pix"))
+          (setq retval (* num (/ pix-width mm-width) (/ 25.4 72.0))))
+         ((member type '("point" "pt"))
+          (setq retval num))
+         ((member type '("pica" "pa"))
+          (setq retval (* num 12.0)))
+         ((member type '("inch" "in"))
+          (setq retval (* num 72.0)))
+         ((string= type "mm")
+          (setq retval (* num (/ 72.0 25.4))))
+         ((string= type "cm")
+          (setq retval (* num 10 (/ 72.0 25.4))))
+         (t
+          (setq retval num))
+         )
+        retval))))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

--Multipart_Tue_Feb__4_00:03:51_1997-1--

