diff options
author | Richard M. Stallman <rms@gnu.org> | 2004-11-21 00:47:13 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2004-11-21 00:47:13 +0000 |
commit | 0b46acbff5889afe9442a588880e1f8e19ec8e30 (patch) | |
tree | 29cf0f344da75708d2da830e5223176a5ad94d3f /lisp/emacs-lisp/bytecomp.el | |
parent | 9961365e7f3e7772d881be2629c3e0bfcf8bcc86 (diff) | |
download | emacs-0b46acbff5889afe9442a588880e1f8e19ec8e30.tar.gz |
(byte-compile-form): Move the calls to byte-compile-set-symbol-position,
to avoid having two for the same symbol occurrence.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index ee29039e05e..2048bd6212f 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -914,14 +914,14 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (when byte-compile-read-position (let (last entry) (while (progn - (setq last byte-compile-last-position - entry (assq sym read-symbol-positions-list)) - (when entry - (setq byte-compile-last-position - (+ byte-compile-read-position (cdr entry)) - read-symbol-positions-list - (byte-compile-delete-first - entry read-symbol-positions-list))) + (setq last byte-compile-last-position + entry (assq sym read-symbol-positions-list)) + (when entry + (setq byte-compile-last-position + (+ byte-compile-read-position (cdr entry)) + read-symbol-positions-list + (byte-compile-delete-first + entry read-symbol-positions-list))) (or (and allow-previous (not (= last byte-compile-last-position))) (> last byte-compile-last-position))))))) @@ -2714,17 +2714,18 @@ If FORM is a lambda or a macro, byte-compile it as a function." (defun byte-compile-form (form &optional for-effect) (setq form (macroexpand form byte-compile-macro-environment)) (cond ((not (consp form)) - (when (symbolp form) - (byte-compile-set-symbol-position form)) (cond ((or (not (symbolp form)) (byte-compile-const-symbol-p form)) + (when (symbolp form) + (byte-compile-set-symbol-position form)) (byte-compile-constant form)) ((and for-effect byte-compile-delete-errors) + (when (symbolp form) + (byte-compile-set-symbol-position form)) (setq for-effect nil)) (t (byte-compile-variable-ref 'byte-varref form)))) ((symbolp (car form)) (let* ((fn (car form)) (handler (get fn 'byte-compile))) - (byte-compile-set-symbol-position fn) (when (byte-compile-const-symbol-p fn) (byte-compile-warn "`%s' called as a function" fn)) (and (memq 'interactive-only byte-compile-warnings) @@ -2735,7 +2736,9 @@ That command is designed for interactive use only" fn)) (or (not (byte-compile-version-cond byte-compile-compatibility)) (not (get (get fn 'byte-opcode) 'emacs19-opcode)))) - (funcall handler form) + (progn + (byte-compile-set-symbol-position fn) + (funcall handler form)) (if (memq 'callargs byte-compile-warnings) (byte-compile-callargs-warn form)) (byte-compile-normal-call form)) |