/[emacs]/emacs/lisp/emacs-lisp/bytecomp.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/bytecomp.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2.98.2.25 by miles, Thu Sep 16 00:12:21 2004 UTC revision 2.98.2.26 by miles, Mon Oct 25 04:22:29 2004 UTC
# Line 872  Each function's symbol gets added to `by Line 872  Each function's symbol gets added to `by
872              (let ((xs (pop hist-new))              (let ((xs (pop hist-new))
873                    old-autoloads)                    old-autoloads)
874                ;; Make sure the file was not already loaded before.                ;; Make sure the file was not already loaded before.
875                (unless (assoc (car xs) hist-orig)                (unless (or (assoc (car xs) hist-orig)
876                              (equal (car xs) "cl"))
877                  (dolist (s xs)                  (dolist (s xs)
878                    (cond                    (cond
879                     ((symbolp s)                     ((symbolp s)
# Line 889  Each function's symbol gets added to `by Line 890  Each function's symbol gets added to `by
890                  (when (and (symbolp s) (not (memq s old-autoloads)))                  (when (and (symbolp s) (not (memq s old-autoloads)))
891                    (push s byte-compile-noruntime-functions))                    (push s byte-compile-noruntime-functions))
892                  (when (and (consp s) (eq t (car s)))                  (when (and (consp s) (eq t (car s)))
893                    (push (cdr s) old-autoloads))))))))))                    (push (cdr s) old-autoloads)))))))
894          (when (memq 'cl-functions byte-compile-warnings)
895            (let ((hist-new load-history)
896                  (hist-nil-new current-load-list))
897              ;; Go through load-history, look for newly loaded files
898              ;; and mark all the functions defined therein.
899              (while (and hist-new (not (eq hist-new hist-orig)))
900                (let ((xs (pop hist-new))
901                      old-autoloads)
902                  ;; Make sure the file was not already loaded before.
903                  (when (and (equal (car xs) "cl") (not (assoc (car xs) hist-orig)))
904                    (byte-compile-find-cl-functions)))))))))
905    
906  (defun byte-compile-eval-before-compile (form)  (defun byte-compile-eval-before-compile (form)
907    "Evaluate FORM for `eval-and-compile'."    "Evaluate FORM for `eval-and-compile'."
# Line 928  Each function's symbol gets added to `by Line 940  Each function's symbol gets added to `by
940  ;; Log something that isn't a warning.  ;; Log something that isn't a warning.
941  (defun byte-compile-log-1 (string)  (defun byte-compile-log-1 (string)
942    (with-current-buffer "*Compile-Log*"    (with-current-buffer "*Compile-Log*"
943      (goto-char (point-max))      (let ((inhibit-read-only t))
944      (byte-compile-warning-prefix nil nil)        (goto-char (point-max))
945      (cond (noninteractive        (byte-compile-warning-prefix nil nil)
946             (message " %s" string))        (cond (noninteractive
947            (t               (message " %s" string))
948             (insert (format "%s\n" string))))))              (t
949                 (insert (format "%s\n" string)))))))
950    
951  (defvar byte-compile-read-position nil  (defvar byte-compile-read-position nil
952    "Character position we began the last `read' from.")    "Character position we began the last `read' from.")
# Line 984  Each function's symbol gets added to `by Line 997  Each function's symbol gets added to `by
997  ;; This is used as warning-prefix for the compiler.  ;; This is used as warning-prefix for the compiler.
998  ;; It is always called with the warnings buffer current.  ;; It is always called with the warnings buffer current.
999  (defun byte-compile-warning-prefix (level entry)  (defun byte-compile-warning-prefix (level entry)
1000    (let* ((dir default-directory)    (let* ((inhibit-read-only t)
1001             (dir default-directory)
1002           (file (cond ((stringp byte-compile-current-file)           (file (cond ((stringp byte-compile-current-file)
1003                        (format "%s:" (file-relative-name byte-compile-current-file dir)))                        (format "%s:" (file-relative-name byte-compile-current-file dir)))
1004                       ((bufferp byte-compile-current-file)                       ((bufferp byte-compile-current-file)
# Line 1030  Each function's symbol gets added to `by Line 1044  Each function's symbol gets added to `by
1044         (save-excursion         (save-excursion
1045           (set-buffer (get-buffer-create "*Compile-Log*"))           (set-buffer (get-buffer-create "*Compile-Log*"))
1046           (goto-char (point-max))           (goto-char (point-max))
1047           (let* ((dir (and byte-compile-current-file           (let* ((inhibit-read-only t)
1048                    (dir (and byte-compile-current-file
1049                            (file-name-directory byte-compile-current-file)))                            (file-name-directory byte-compile-current-file)))
1050                  (was-same (equal default-directory dir))                  (was-same (equal default-directory dir))
1051                  pt)                  pt)
# Line 1064  Each function's symbol gets added to `by Line 1079  Each function's symbol gets added to `by
1079  (defun byte-compile-log-warning (string &optional fill level)  (defun byte-compile-log-warning (string &optional fill level)
1080    (let ((warning-prefix-function 'byte-compile-warning-prefix)    (let ((warning-prefix-function 'byte-compile-warning-prefix)
1081          (warning-type-format "")          (warning-type-format "")
1082          (warning-fill-prefix (if fill "    ")))          (warning-fill-prefix (if fill "    "))
1083            (inhibit-read-only t))
1084      (display-warning 'bytecomp string level "*Compile-Log*")))      (display-warning 'bytecomp string level "*Compile-Log*")))
1085    
1086  (defun byte-compile-warn (format &rest args)  (defun byte-compile-warn (format &rest args)
# Line 2217  list that represents a doc string refere Line 2233  list that represents a doc string refere
2233        (setq tail (cdr tail))))        (setq tail (cdr tail))))
2234    form)    form)
2235    
2236  (put 'require 'byte-hunk-handler 'byte-compile-file-form-eval-boundary)  (put 'require 'byte-hunk-handler 'byte-compile-file-form-require)
2237  (defun byte-compile-file-form-eval-boundary (form)  (defun byte-compile-file-form-require (form)
2238    (let ((old-load-list current-load-list))    (let ((old-load-list current-load-list)
2239      (eval form)          (args (mapcar 'eval (cdr form))))
2240      ;; (require 'cl) turns off warnings for cl functions.      (apply 'require args)
2241      (let ((tem current-load-list))      ;; Detech (require 'cl) in a way that works even if cl is already loaded.
2242        (while (not (eq tem old-load-list))      (if (member (car args) '("cl" cl))
2243          (when (equal (car tem) '(require . cl))          (setq byte-compile-warnings
2244            (setq byte-compile-warnings                (remq 'cl-functions byte-compile-warnings))))
                 (remq 'cl-functions byte-compile-warnings)))  
         (setq tem (cdr tem)))))  
2245    (byte-compile-keep-pending form 'byte-compile-normal-call))    (byte-compile-keep-pending form 'byte-compile-normal-call))
2246    
2247  (put 'progn 'byte-hunk-handler 'byte-compile-file-form-progn)  (put 'progn 'byte-hunk-handler 'byte-compile-file-form-progn)

Legend:
Removed from v.2.98.2.25  
changed lines
  Added in v.2.98.2.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26