emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs crashes with eval-region and marker


From: Kim F. Storm
Subject: Re: emacs crashes with eval-region and marker
Date: Sat, 09 Apr 2005 01:45:05 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

address@hidden (Mario Domgörgen) writes:

> I start a clean emacs with emacs -q --no-init-file and evaluate
> the following function:
>
> (defun html-eval-scripts ()
>   (interactive)
>   (save-excursion
>     (goto-char (point-min))
>     (while (re-search-forward
>               "<script.*type=\"text/elisp\">\\(.*\\)</script>" nil t)
>       (eval-region (match-beginning 1)(match-end 1) (point-marker)))))
>
> When i call html-eval-scripts on a buffer with a line like this
>
> <script type="text/elisp">(insert "Hallo bold world")</script>
>
> Emacs crashed with "Fatal error (6).Abort". This seems to happen with
> all emacs i have emacs20,emacs21 and several cvs versions.

I have just installed changes to eval-region which fixes the crash,
as well as properly move/restore point while the expression(s) in the region.

After fixing just the crash, your code gave the following result:

<script type="text/elisp">(insert "Hallo bold world")Hallo bold 
world</script>nil

With further fixes (also installed), your code now (correctly) results in:

<script type="text/elisp">(insert "Hallo bold world")</script>
nil
Hallo bold world

The reason is that the 'value' of (insert...) is 'nil' and that is inserted
at the point marker as you requested.

However, I think you had expected this output:

<script type="text/elisp">(insert "Hallo bold world")</script>Hallo bold world

To get that, you must _remove_ the third (point-marker) arg to eval-region.

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]