Subject: 24.3; Woman elapsed time calculation fails.

From: "Greenberg, Adam" <[email-masked]>
Date: Wed, 3 Jul 2013 08:57:18 -0400

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

Emacs reports this error: Invalid time specification
whenever I execute woman.  For example m-x woman hostname
(invoke woman to view the hostname man page).

This error occurs in:
Debugger entered--Lisp error: (error "Invalid time specification")
  float-time(0.04446005821228027)
  woman-decode-buffer()
  woman-process-buffer()
  woman-really-find-file("/usr/share/man/man1/gzip.1.gz" t "*WoMan 1 gzip*<3>")
  woman-find-file("/usr/share/man/man1/gzip.1.gz")
  woman(nil nil)
  call-interactively(woman record nil)
  command-execute(woman record)
  execute-extended-command(nil "woman")
  call-interactively(execute-extended-command nil nil)

The code in question is in woman.el (woman-decode-buffer):
(defun woman-decode-buffer ()
  "Decode a buffer in UN*X man-page source format.
No external programs are used."
  (interactive)                         ; mainly for testing
  (WoMan-log-begin)
  (run-hooks 'woman-pre-format-hook)
  (and (boundp 'font-lock-mode) font-lock-mode (font-lock-mode -1))
  ;; (fundamental-mode)
  (let ((start-time (current-time))
        time)
    (message "WoMan formatting buffer...")
;  (goto-char (point-min))
;  (cond
;   ((re-search-forward "^\\.[ \t]*TH" nil t) ; wrong format if not found?
;    (beginning-of-line)
;    (delete-region (point-min) (point))) ; potentially dangerous!
;   (t (message "WARNING: .TH request not found -- not man-page format?")))
    (woman-decode-region (point-min) (point-max))
    (setq time (float-time (time-since start-time)))
    (message "WoMan formatting buffer...done in %g seconds" time)
    (WoMan-log-end time))
  (run-hooks 'woman-post-format-hook))

The error occurs in the line:
    (setq time (float-time (time-since start-time)))

The error is that time-since returns the value of a time difference
(already a float value) not a time value.  The float-time function gags
on this.  A corrected version omits float-time:
    (setq time (time-since start-time))

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/autohome/a248214/gmacs/emacs-24.3/etc/DEBUG.

In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.18.9)
 of 2013-07-01 on vlelayerdev3
Windowing system distributor `The X.Org Foundation', version 11.0.11004000
System Description:     Oracle Linux Server release 6.3

Configured using:
 `configure '--with-x-toolkit=gtk''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  nxhtml-menu-mode: t
  nxhtml-tag-do-also: t
  popcmp-group-alternatives: t
  popcmp-short-help-beside-alts: t
  mlinks-active-links: t
  rngalt-minimal-validation-header: t
  rngalt-display-validation-header: t
  display-time-mode: t
  shell-dirtrack-mode: t
  dynamic-completion-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f
C-f C-f SPC % g C-f SPC ( f l o a t - t i m e SPC (
c u r r e n t - t i m e ) ) C-n C-a C-k C-k C-n C-n
C-e C-x C-e C-x 1 M-x t t <return> C-x C-b C-n SPC
C-x b <return> C-p C-b C-b C-b C-b C-b C-b C-b C-b
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-a
<tab> ' <backspace> ; C-k C-y <return> C-y C-a C-f
C-b <tab> C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f
C-d C-d C-d C-d C-d C-d C-d C-d C-d C-d C-d C-d C-f
C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f
C-f C-f C-f C-f C-f C-f C-f C-f C-d C-n C-e C-x C-e
M-x t t <return> <down-mouse-1> <mouse-1> M-x a p r
o p o s <return> c l o a t <backspace> <backspace>
<backspace> <backspace> <backspace> f l o a t e <backspace>
- t i m e <return> M-x a p o r p <backspace> <backspace>
<backspace> r p o <backspace> <backspace> o p o s <return>
t i m e - s i n c e <return> <down-mouse-1> <mouse-1>
C-x 1 M-x w o m a n <return> h o s t n a m e <return>
1 <tab> <return> C-x k <return> M-x w o m a n <return>
h o s t n a m e <return> 1 <tab> <return> <down-mouse-1>
<mouse-movement> <mouse-1> M-x r e p o r t SPC e m
a c s SPC b u g <return>

Recent messages:
start time is: 1.37286e+09
elapsed time is 0.000147104 seconds
Auto-saving...
Making completion list...
uncompressing hostname.1.gz...done
WoMan formatting buffer...
woman-decode-buffer: Invalid time specification
Making completion list...
uncompressing hostname.1.gz...done
WoMan formatting buffer...
woman-decode-buffer: Invalid time specification

Load-path shadows:
/autohome/a248214/gmacs/gmacs-hacks-general/comint-extra hides /autohome/a248214/gmacs/gmacs-hacks-moose/comint-extra
/autohome/a248214/gmacs/gmacs-hacks-general/javascript-mode hides /autohome/a248214/gmacs/gmacs-hacks-moose/javascript-mode
/autohome/a248214/gmacs/gmacs-hacks-general/diff hides /autohome/a248214/gmacs/emacs-24.3/lisp/vc/diff
/autohome/a248214/gmacs/gmacs-hacks-general/metamail hides /autohome/a248214/gmacs/emacs-24.3/lisp/mail/metamail
/autohome/a248214/gmacs/nxhtml/tests/ert hides /autohome/a248214/gmacs/emacs-24.3/lisp/emacs-lisp/ert
/autohome/a248214/gmacs/emacs-24.3/lisp/gnus/.dir-locals hides ~/gmacs/emacs-24.3/.dir-locals

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mailabbrev
gmm-utils mailheader sendmail mail-utils dired-aux mule-util misearch
multi-isearch extras diff tabify disp-table view jka-compr pcmpl-unix
pcmpl-gnu debug cc-langs mmm-auto mmm-vars mmm-compat javascript-mode
nxhtml-autostart nxhtml-autoload moz majmodpri nxhtml-menu udev-rinari
udev-ecb udev flymake-js flymake css-color nxhtml-mode html-quote
tidy-xhtml ediff-merg ediff-diff ediff-wind ediff-help ediff-util
ediff-mult ediff-init ediff html-imenu imenu loadhist popcmp xhtml-help
mlinks html-toc xml fupd html-pagetoc foldit appmenu-fold appmenu mumamo
sgml-mode rngalt rng-nxml nxml-mode nxml-outln nxml-rap nxml-glyph
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-util nxml-enc xmltok desktop help-mode flyspell
ispell fold-dwim hideshow html-upl html-site ourcomments-util uniquify
recentf tree-widget org warnings ob-tangle ob-ref ob-lob ob-table
org-footnote org-src ob-comint ob-keys org-pcomplete org-list org-faces
org-entities noutline outline org-version ob-emacs-lisp ob org-compat
org-macs ob-eval org-loaddefs format-spec find-func cal-menu calendar
cal-loaddefs ido bookmark pp apropos grep ffip compile gimpedit dired
web-vcs rx advice help-fns advice-preload url-http tls url url-proxy
url-privacy url-expand url-methods url-history mailcap url-auth
url-cookie url-domsuf url-util url-parse auth-source eieio byte-opt
bytecomp byte-compile cconv gnus-util password-cache url-gw url-vars
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr cus-edit cus-start cus-load wid-edit
web-autoload nxhtml-base easy-mmode woman man bison-mode make-regexp
derived cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs ange-ftp cl-macs gv cl cl-lib time
shell pcomplete rlogin login ebuff-menu electric completion font
comint-extra comint ansi-color ring time-date tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dynamic-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)