Function: macroexp-preserve-posification
macroexp-preserve-posification is a macro defined in macroexp.el.gz.
Signature
(macroexp-preserve-posification POS-FORM &rest BODY)
Documentation
Evaluate BODY..., posifying the result with POS-FORM's position, if any.
If the result of body happens to have a position already, we do not change this.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/macroexp.el.gz
(defmacro macroexp-preserve-posification (pos-form &rest body)
"Evaluate BODY..., posifying the result with POS-FORM's position, if any.
If the result of body happens to have a position already, we do not
change this."
(declare (debug (sexp body)) (indent 1))
`(let ((call-pos (cond
((consp ,pos-form)
(and (symbol-with-pos-p (car ,pos-form))
(symbol-with-pos-pos (car ,pos-form))))
((symbol-with-pos-p ,pos-form)
(symbol-with-pos-pos ,pos-form))))
(new-value (progn ,@body)))
(if (and call-pos
(not (or (and (consp new-value)
(symbol-with-pos-p (car new-value)))
(and (symbol-with-pos-p new-value)))))
(macroexp--posify-form new-value call-pos)
new-value)))