emacs-devel
[Top][All Lists]
Advanced

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

Re: The issue with with-temp-buffer (or with-current-buffer)


From: Eli Zaretskii
Subject: Re: The issue with with-temp-buffer (or with-current-buffer)
Date: Fri, 15 Dec 2017 22:51:29 +0200

> From: OGAWA Hirofumi <address@hidden>
> Date: Sat, 16 Dec 2017 03:25:58 +0900
> 
> and expected result is
> 
>     ---- test-case ----
>     2
>     1
>     -------------------
> 
> But actual result is
> 
>     ---- test-case ----
>     1
>     2
>     -------------------
> 
> [The actual issue that I'm hitted was using `shr-insert-document'
> like following. And above is simplied version to reproduce the issue.
> 
>   (with-current-buffer buf
>     (erase-buffer)
>     (insert ...)
>     (shr-insert-document '(html nil (body nil ...)))
>     (insert ...)))
> ]
> 
> After some debugging, I noticed `with-current-buffer' that is
> used in `with-temp-buffer' doesn't restore `point'.

Please try the latest shr.el from the emacs-26 branch, I think you
will find that this problem is solved there.

> Well so, this behavior (doesn't restore point) of
> `with-temp-buffer' (or `with-current-buffer') is intented or bug?

It's intended.

> And to fix this issue, we should change which one of
> with-temp-buffer, with-current-buffer, shr-insert-document, or
> user of shr-insert-document?

I think shr.el was already fixed.



reply via email to

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