Skip to content

Commit

Permalink
On rendering, the position is moved even if the buffer is invisible.
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-render-timeline): move the
position correctly even if the buffer is invisible.
  • Loading branch information
cvmat committed Feb 9, 2010
1 parent 6908a9f commit db0fcfa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Expand Up @@ -10,6 +10,9 @@
when inserting a status at the end of the buffer in order to keep
the marker pointing the end of the buffer.

* twittering-mode.el (twittering-render-timeline): move the
position correctly even if the buffer is invisible.

2010-02-08 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-http-default-sentinel): Delete a
Expand Down
23 changes: 15 additions & 8 deletions twittering-mode.el
Expand Up @@ -1921,6 +1921,7 @@ If ID of STATUS-DATUM is already in ID-TABLE, return nil. If not, return t."
(mapcar (lambda (window)
(cons (window-point window) window))
window-list))
(original-pos (point))
(buffer-read-only nil))
(twittering-update-mode-line)
(save-excursion
Expand Down Expand Up @@ -1966,16 +1967,22 @@ If ID of STATUS-DATUM is already in ID-TABLE, return nil. If not, return t."
;; After additional insertion, the current position exists
;; on the same status.
;; Go to the original position.
(mapc (lambda (pair)
(let ((point (car pair))
(window (cdr pair)))
(set-window-point window point)))
point-window-list))
(if point-window-list
(mapc (lambda (pair)
(let ((point (car pair))
(window (cdr pair)))
(set-window-point window point)))
point-window-list)
;; Move the buffer position if the buffer is invisible.
(goto-char original-pos)))
((not additional)
;; Go to the beginning of buffer after full insertion.
(mapc
(lambda (window) (set-window-point window (point-min)))
window-list))))
(if window-list
(mapc
(lambda (window) (set-window-point window (point-min)))
window-list)
;; Move the buffer position if the buffer is invisible.
(goto-char (point-min))))))
))

(defun twittering-make-display-spec-for-icon (image-url)
Expand Down

0 comments on commit db0fcfa

Please sign in to comment.