Function: byte-compile-set-symbol-position
byte-compile-set-symbol-position is a byte-compiled function defined
in bytecomp.el.gz.
Signature
(byte-compile-set-symbol-position SYM &optional ALLOW-PREVIOUS)
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/bytecomp.el.gz
;; The purpose of `byte-compile-set-symbol-position' is to attempt to
;; set `byte-compile-last-position' to the "current position" in the
;; raw source code. This is used for warning and error messages.
;;
;; The function should be called for most occurrences of symbols in
;; the forms being compiled, strictly in the order they occur in the
;; source code. It should never be called twice for any single
;; occurrence, and should not be called for symbols generated by the
;; byte compiler itself.
;;
;; The function works by scanning the elements in the alist
;; `read-symbol-positions-list' for the next match for the symbol
;; after the current value of `byte-compile-last-position', setting
;; that variable to the match's character position, then deleting the
;; matching element from the list. Thus the new value for
;; `byte-compile-last-position' is later than the old value unless,
;; perhaps, ALLOW-PREVIOUS is non-nil.
;;
;; So your're probably asking yourself: Isn't this function a gross
;; hack? And the answer, of course, would be yes.
(defun byte-compile-set-symbol-position (sym &optional allow-previous)
(when byte-compile-read-position
(let ((last byte-compile-last-position)
entry)
(while (progn
(setq 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)))
(and entry
(or (and allow-previous
(not (= last byte-compile-last-position)))
(> last byte-compile-last-position))))))))