unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What happens during eval-buffer?
@ 2006-05-16 19:25 Lennart Borgman
  2006-05-16 19:33 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman @ 2006-05-16 19:25 UTC (permalink / raw)


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?

I am doing this on w32: GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195) of 
2006-05-13

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: What happens during eval-buffer?
  2006-05-16 19:25 What happens during eval-buffer? Lennart Borgman
@ 2006-05-16 19:33 ` Andreas Schwab
  2006-05-16 19:46   ` Lennart Borgman
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2006-05-16 19:33 UTC (permalink / raw)
  Cc: Emacs Devel

Lennart Borgman <lennart.borgman.073@student.lu.se> 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, schwab@suse.de
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."

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: What happens during eval-buffer?
  2006-05-16 19:33 ` Andreas Schwab
@ 2006-05-16 19:46   ` Lennart Borgman
  0 siblings, 0 replies; 3+ messages in thread
From: Lennart Borgman @ 2006-05-16 19:46 UTC (permalink / raw)
  Cc: Emacs Devel

Andreas Schwab wrote:
>> (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.
>   
Ah! Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-16 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-16 19:25 What happens during eval-buffer? Lennart Borgman
2006-05-16 19:33 ` Andreas Schwab
2006-05-16 19:46   ` Lennart Borgman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).