emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] emacs-26 f274cbd: Avoid reordering of output in 'shr-i


From: Stefan Monnier
Subject: Re: [Emacs-diffs] emacs-26 f274cbd: Avoid reordering of output in 'shr-insert-document'
Date: Sat, 16 Dec 2017 17:23:02 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> > +    ;; Save and restore point across with-temp-buffer, since
>> > +    ;; shr-pixel-column uses save-window-excursion, which can reset
>> > +    ;; point to 1.
>> > +    (let ((pt (point)))
>> > +      (with-temp-buffer
>> > +        (insert string)
>> > +        (shr-pixel-column))
>> > +      (goto-char pt))))
>> Is it possible to fix the problem in shr-pixel-column (since, according
>> to the comment above, the problems comes from there)?
> No, because the value of point to preserve is from the buffer which
> was current before with-temp-buffer.

But when we enter shr-pixel-column, that buffer's point is still the
right one, and when we leave shr-pixel-column it isn't any more, so
somehow shr-pixel-column manages to "find" that buffer in order to
modify it and hence we should also be able to similarly find that buffer
and restore its point.

I mean, from a purely theoretical point of view, it *can* be
solved there.  What I don't understand is where practical aspects end up
getting it the way.


        Stefan



reply via email to

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