# HG changeset patch # User Kenichi Handa # Date 904306959 0 # Node ID 99ab9c46504a8ad713132db14ff57be325535196 # Parent 173e152366287d3c711cc1aed5c3d3885b45b5c2 (byte-compile-output-as-comment): Calculate the total bytes using position-bytes instead of char-bytes. diff -r 173e15236628 -r 99ab9c46504a lisp/emacs-lisp/bytecomp.el --- a/lisp/emacs-lisp/bytecomp.el Fri Aug 28 12:22:39 1998 +0000 +++ b/lisp/emacs-lisp/bytecomp.el Fri Aug 28 12:22:39 1998 +0000 @@ -9,7 +9,7 @@ ;;; This version incorporates changes up to version 2.10 of the ;;; Zawinski-Furuseth compiler. -(defconst byte-compile-version "$Revision: 2.49 $") +(defconst byte-compile-version "$Revision: 2.50 $") ;; This file is part of GNU Emacs. @@ -1907,8 +1907,7 @@ ;; and return the file position it will have. ;; If QUOTED is non-nil, print with quoting; otherwise, print without quoting. (defun byte-compile-output-as-comment (exp quoted) - (let ((position (point)) - total-bytes) + (let ((position (point))) (set-buffer (prog1 (current-buffer) (set-buffer outbuffer) @@ -1932,12 +1931,8 @@ (goto-char (point-max)) (insert "\037") (goto-char position) - (setq total-bytes 0) - (while (not (eobp)) - (setq total-bytes (+ total-bytes (char-bytes (char-after (point))))) - (forward-char 1)) - (goto-char position) - (insert "#@" (format "%d" total-bytes)) + (insert "#@" (format "%d" (- (position-bytes (point-max)) + (position-bytes position)))) ;; Save the file position of the object. ;; Note we should add 1 to skip the space