松尾です。
> >
> > 現在のこの実装では、*twittering*が表示されていない場合は、
> > get-buffer-window-listはnilを返すと思います。window-listに
> > 期待した値が設定されていないのではないでしょうか。
>
> 昔のコードでは scroll-mode の時に、カーソル移動となっていましたが、今のコー
> ドでは逆に scroll-mode でない時にカーソル移動になっているようです。
> (render 前の (point) が保存される感じです)
>
> なので、 scroll-mode で additional が t の時には window-list も
> point-window-list も使われないように思います。
はい。 scroll-mode では window-list も point-window-list も
使わない実装になっています。
insert-before-markers で status を追加すると自動的にそれに
合わせて marker も動いてくれるので、 scroll-mode では使う
必要がなくなっています。
window-list や point-window-list を使うのは mapc の第2引数と
してだけなので、 nil の場合には mapc で指定した処理が行われ
ないだけで影響はないはずです。
どこでカーソルが移動しているのかは分かりませんが、もしかすると
save-excursion の範囲が広過ぎて他の process から割り込まれて
いるのかもしれません。そこで save-excursion の範囲を限定する
パッチを書いてみました。
現在の hayamiz/master のHEAD
ed67225499f77cadc419a4deffb13e3cace53b5c
に対するパッチです。
これを当ててもカーソル移動の問題が起きるでしょうか。
---
松尾 直志 <t...@mymail.twin.jp>
diff -r dcc04eee46d1 twittering-mode.el
--- a/twittering-mode.el Mon Feb 01 00:45:29 2010 +0900
+++ b/twittering-mode.el Tue Feb 02 23:59:13 2010 +0900
@@ -1900,27 +1900,27 @@
window-list)))
(twittering-update-mode-line)
(setq buffer-read-only nil)
- (save-excursion
- (unless additional
- (erase-buffer))
- (let ((pos (twittering-get-first-status-head)))
- (mapc
- (lambda (status)
- (let* ((id (cdr (assoc 'id status))))
- ;; Find where the status should be inserted.
- (while
- (let* ((buf-id (get-text-property pos 'id)))
- (if (and buf-id (twittering-status-id< id buf-id))
- (let ((next-pos
- (twittering-get-next-status-head pos)))
- (setq pos (or next-pos (point-max)))
- next-pos)
- nil)))
- (unless (twittering-status-id= id (get-text-property pos 'id))
- (let ((formatted-status
- (twittering-format-status
- status twittering-status-format))
- (separator "\n"))
+ (unless additional
+ (erase-buffer))
+ (let ((pos (twittering-get-first-status-head)))
+ (mapc
+ (lambda (status)
+ (let* ((id (cdr (assoc 'id status))))
+ ;; Find where the status should be inserted.
+ (while
+ (let* ((buf-id (get-text-property pos 'id)))
+ (if (and buf-id (twittering-status-id< id buf-id))
+ (let ((next-pos
+ (twittering-get-next-status-head pos)))
+ (setq pos (or next-pos (point-max)))
+ next-pos)
+ nil)))
+ (unless (twittering-status-id= id (get-text-property pos 'id))
+ (let ((formatted-status
+ (twittering-format-status
+ status twittering-status-format))
+ (separator "\n"))
+ (save-excursion
(goto-char pos)
;; Use `insert-before-markers' in order to keep
;; which status is pointed by each marker.
@@ -1928,8 +1928,8 @@
;; Now, `pos' points the head of the status.
;; It must be moved to the current point
;; in order to skip the status inserted just now.
- (setq pos (point))))))
- twittering-timeline-data)))
+ (setq pos (point)))))))
+ twittering-timeline-data))
(if (and twittering-image-stack window-system)
(clear-image-cache))
(setq buffer-read-only t)
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
twmode-users mailing list
twmode-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/twmode-users