[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What happens during eval-buffer?
From: |
Andreas Schwab |
Subject: |
Re: What happens during eval-buffer? |
Date: |
Tue, 16 May 2006 21:33:23 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) |
Lennart Borgman <address@hidden> writes:
> Start with
>
> emacs -Q
>
> Put this into *Scratch*:
>
> <<<<<<<<<<<<<<<<<<<<<
>
> (defvar temp-html nil)
> (setq temp-html
> ;; Start-here
> "
> <html>
> <head>
> </head>
> </html>
> ") ;; Stop-here
>
> (let ((start (progn
> (goto-char (point-min))
> (search-forward "Start-here")
> (forward-line 2)
> (point)
> ))
> )
> )
>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> With that as the current buffer then do
>
> M-x eval-buffer
>
> I get an error saying "Symbol's value as variable is void: <html>". Have I
> done something completely wrong or?
Yes, replace progn by save-excursion. You have modified point under
eval-buffer's feet, it will continue evaluation until point equals
point-max.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."