]> code.delx.au - gnu-emacs/blobdiff - lisp/nxml/rng-valid.el
Fix w32 memory-management problem when extending buffer text
[gnu-emacs] / lisp / nxml / rng-valid.el
index fb8bd037bdcd7a831ddd6050a9af6e2d2d6e1a6c..1020cad2089965daec9bf31f9e1987ede5935efd 100644 (file)
@@ -1,9 +1,9 @@
 ;;; rng-valid.el --- real-time validation of XML using RELAX NG
 
-;; Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
 
 ;; Author: James Clark
-;; Keywords: XML, RelaxNG
+;; Keywords: wp, hypermedia, languages, XML, RelaxNG
 
 ;; This file is part of GNU Emacs.
 
@@ -345,17 +345,11 @@ The schema is set like `rng-auto-set-schema'."
 
 (defun rng-compute-mode-line-string ()
   (cond (rng-validate-timer
-        (concat " Validated:"
-                (number-to-string
-                 ;; Use floor rather than round because we want
-                 ;; to show 99% rather than 100% for changes near
-                 ;; the end.
-                 (floor (if (eq (buffer-size) 0)
-                            0.0
-                          (/ (* (- rng-validate-up-to-date-end (point-min))
-                                 100.0)
-                             (- (point-max) (point-min))))))
-                "%%"))
+        (format " Validated:%d%%"
+                (if (= 0 (buffer-size))
+                    0
+                  (floor (- rng-validate-up-to-date-end (point-min))
+                         (- (point-max) (point-min))))))
        ((> rng-error-count 0)
         (concat " "
                 (propertize "Invalid"