comparison lisp/emacs-lisp/bytecomp.el @ 83228:2a3f27a45698

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-694 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-695 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-696 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-697 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-698 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-699 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-700 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-701 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-702 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-703 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-704 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-705 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-706 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-707 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-708 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-709 Update from CVS: src/indent.c (Fvertical_motion): Fix last change. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-710 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-711 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-712 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-713 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-72 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-73 Merge from emacs--cvs-trunk--0 git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-268
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 22 Nov 2004 11:06:39 +0000
parents 3ec251523b3e 01886d0fea34
children 4ee39d9428b0
comparison
equal deleted inserted replaced
83227:3ec251523b3e 83228:2a3f27a45698
912 ;; gross hack? And the answer, of course, would be yes. 912 ;; gross hack? And the answer, of course, would be yes.
913 (defun byte-compile-set-symbol-position (sym &optional allow-previous) 913 (defun byte-compile-set-symbol-position (sym &optional allow-previous)
914 (when byte-compile-read-position 914 (when byte-compile-read-position
915 (let (last entry) 915 (let (last entry)
916 (while (progn 916 (while (progn
917 (setq last byte-compile-last-position 917 (setq last byte-compile-last-position
918 entry (assq sym read-symbol-positions-list)) 918 entry (assq sym read-symbol-positions-list))
919 (when entry 919 (when entry
920 (setq byte-compile-last-position 920 (setq byte-compile-last-position
921 (+ byte-compile-read-position (cdr entry)) 921 (+ byte-compile-read-position (cdr entry))
922 read-symbol-positions-list 922 read-symbol-positions-list
923 (byte-compile-delete-first 923 (byte-compile-delete-first
924 entry read-symbol-positions-list))) 924 entry read-symbol-positions-list)))
925 (or (and allow-previous (not (= last byte-compile-last-position))) 925 (or (and allow-previous (not (= last byte-compile-last-position)))
926 (> last byte-compile-last-position))))))) 926 (> last byte-compile-last-position)))))))
927 927
928 (defvar byte-compile-last-warned-form nil) 928 (defvar byte-compile-last-warned-form nil)
929 (defvar byte-compile-last-logged-file nil) 929 (defvar byte-compile-last-logged-file nil)
2712 ;; (Use byte-compile-form-do-effect to reset the for-effect flag too.) 2712 ;; (Use byte-compile-form-do-effect to reset the for-effect flag too.)
2713 ;; 2713 ;;
2714 (defun byte-compile-form (form &optional for-effect) 2714 (defun byte-compile-form (form &optional for-effect)
2715 (setq form (macroexpand form byte-compile-macro-environment)) 2715 (setq form (macroexpand form byte-compile-macro-environment))
2716 (cond ((not (consp form)) 2716 (cond ((not (consp form))
2717 (when (symbolp form)
2718 (byte-compile-set-symbol-position form))
2719 (cond ((or (not (symbolp form)) (byte-compile-const-symbol-p form)) 2717 (cond ((or (not (symbolp form)) (byte-compile-const-symbol-p form))
2718 (when (symbolp form)
2719 (byte-compile-set-symbol-position form))
2720 (byte-compile-constant form)) 2720 (byte-compile-constant form))
2721 ((and for-effect byte-compile-delete-errors) 2721 ((and for-effect byte-compile-delete-errors)
2722 (when (symbolp form)
2723 (byte-compile-set-symbol-position form))
2722 (setq for-effect nil)) 2724 (setq for-effect nil))
2723 (t (byte-compile-variable-ref 'byte-varref form)))) 2725 (t (byte-compile-variable-ref 'byte-varref form))))
2724 ((symbolp (car form)) 2726 ((symbolp (car form))
2725 (let* ((fn (car form)) 2727 (let* ((fn (car form))
2726 (handler (get fn 'byte-compile))) 2728 (handler (get fn 'byte-compile)))
2727 (byte-compile-set-symbol-position fn)
2728 (when (byte-compile-const-symbol-p fn) 2729 (when (byte-compile-const-symbol-p fn)
2729 (byte-compile-warn "`%s' called as a function" fn)) 2730 (byte-compile-warn "`%s' called as a function" fn))
2730 (and (memq 'interactive-only byte-compile-warnings) 2731 (and (memq 'interactive-only byte-compile-warnings)
2731 (memq (car form) byte-compile-interactive-only-functions) 2732 (memq (car form) byte-compile-interactive-only-functions)
2732 (byte-compile-warn "`%s' used from Lisp code\n\ 2733 (byte-compile-warn "`%s' used from Lisp code\n\
2733 That command is designed for interactive use only" fn)) 2734 That command is designed for interactive use only" fn))
2734 (if (and handler 2735 (if (and handler
2735 (or (not (byte-compile-version-cond 2736 (or (not (byte-compile-version-cond
2736 byte-compile-compatibility)) 2737 byte-compile-compatibility))
2737 (not (get (get fn 'byte-opcode) 'emacs19-opcode)))) 2738 (not (get (get fn 'byte-opcode) 'emacs19-opcode))))
2738 (funcall handler form) 2739 (progn
2740 (byte-compile-set-symbol-position fn)
2741 (funcall handler form))
2739 (if (memq 'callargs byte-compile-warnings) 2742 (if (memq 'callargs byte-compile-warnings)
2740 (byte-compile-callargs-warn form)) 2743 (byte-compile-callargs-warn form))
2741 (byte-compile-normal-call form)) 2744 (byte-compile-normal-call form))
2742 (if (memq 'cl-functions byte-compile-warnings) 2745 (if (memq 'cl-functions byte-compile-warnings)
2743 (byte-compile-cl-warn form)))) 2746 (byte-compile-cl-warn form))))