emacs-devel
[Top][All Lists]
Advanced

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

Re: Mysterious gzipped images


From: Lars Magne Ingebrigtsen
Subject: Re: Mysterious gzipped images
Date: Sat, 17 Aug 2013 17:01:09 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> (url-retrieve "https://icons.duckduckgo.com/i/a-z-animals.com.ico";
>>               (lambda (&rest ignore)
>>                 (message "%s" (point))
>>                 (switch-to-buffer (current-buffer))))

[...]

> Did you look at the source of switch-to-buffer?  This portion sounds
> relevant:
>
>       (let* ((entry (assq buffer (window-prev-buffers)))
>            (displayed (and (eq switch-to-buffer-preserve-window-point
>                                'already-displayed)
>                            (get-buffer-window buffer 0))))
>       (set-window-buffer nil buffer)
>       (when (and entry
>                  (or (eq switch-to-buffer-preserve-window-point t)
>                      displayed))
>         ;; Try to restore start and point of buffer in the selected
>         ;; window (Bug#4041).
>         (set-window-start (selected-window) (nth 1 entry) t)
>         (set-window-point nil (nth 2 entry))))))

switch-to-buffer-preserve-window-point is a variable defined in `window.el'.
Its value is nil

Documentation:
If non-nil, `switch-to-buffer' tries to preserve `window-point'.
If this is nil, `switch-to-buffer' displays the buffer at that
buffer's `point'.

So point here was at the beginning of the buffer.  But switching to this
buffer, which isn't displayed, puts point at the end of the buffer.

Surely that's not the intended result?

-- 
(domestic pets only, the antidote for overdose, milk.)
  No Gnus T-Shirt for sale: http://ingebrigtsen.no/no.php
  and http://lars.ingebrigtsen.no/2013/08/twenty-years-of-september.html



reply via email to

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