Subject: how to stop the annotation of lists by filenames?
From: Robert Dodier
Date: Sat, 31 May 2008 13:34:20 -0600
On 5/31/08, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> (defun add-lineinfo (lis)
> (if $dontaddloadinfo lis ;;; <<< the main change
> (if (or (atom lis) (and (eq *parse-window* *standard-input*)
> (not (find-stream *parse-stream*))))
> lis
> (let* ((st (get-instream *parse-stream*))
> (n (instream-line st))
> (nam (instream-name st)))
> (or nam (return-from add-lineinfo lis))
> (setq *current-line-info*
> (cond ((eq (cadr *current-line-info*) nam)
> (cond ((eql (car *current-line-info*) n)
> *current-line-info*)
> (t (cons n (cdr *current-line-info*)))))
> (t (list n nam 'src))))
> (cond ((null (cdr lis))
> (list (car lis) *current-line-info*))
> (t (append lis (list *current-line-info*)))))))
> ) ; one extra parenthesis to match
Cloning and modifying the original function causes trouble
if ever the original is modified (those changes are not
automatically inherited by this version).
Let's preserve the original function.
(let ((add-lineinfo-original (symbol-function 'add-lineinfo)))
(defun add-lineinfo (foo)
(if $dontaddloadinfo foo (funcall add-lineinfo-original foo))))
I guess that has its own problem; if you load it twice,
the original isn't called anymore. Well, maybe it's useful anyway.
FWIW
Robert Dodier