Skip to content

Commit

Permalink
Processes are registered with the corresponding timeline spec strings.
Browse files Browse the repository at this point in the history
* twittering-mode.el (twittering-register-process): store timeline
spec string.
(twittering-get-and-render-timeline): register a process together
with timeline spec string.
(twittering-release-process): use `delq' instead of `delete'.
(twittering-get-timeline-spec-string-from-process): new function
for registered timeline spec string.
  • Loading branch information
cvmat committed Mar 23, 2010
1 parent fc7d8e2 commit 7d73786
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
2010-03-24 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-register-process): store timeline
spec string.
(twittering-get-and-render-timeline): register a process together
with timeline spec string.
(twittering-release-process): use `delq' instead of `delete'.
(twittering-get-timeline-spec-string-from-process): new function
for registered timeline spec string.

2010-03-23 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-mode-map): bind "SPC" and "C-v" to
Expand Down
20 changes: 14 additions & 6 deletions twittering-mode.el
Expand Up @@ -1152,20 +1152,28 @@ Statuses are stored in ascending-order with respect to their IDs."
;;; Process info
;;;

(defun twittering-register-process (proc spec)
(add-to-list 'twittering-process-info-alist `(,proc ,spec)))
(defun twittering-register-process (proc spec &optional str)
(let ((str (or str (twittering-timeline-spec-to-string spec))))
(add-to-list 'twittering-process-info-alist `(,proc ,spec ,str))))

(defun twittering-release-process (proc)
(let ((spec (twittering-get-timeline-spec-from-process proc)))
(setq twittering-process-info-alist
(delete `(,proc ,spec) twittering-process-info-alist))))
(let ((pair (assoc proc twittering-process-info-alist)))
(when pair
(setq twittering-process-info-alist
(delq pair twittering-process-info-alist)))))

(defun twittering-get-timeline-spec-from-process (proc)
(let ((entry (assoc proc twittering-process-info-alist)))
(if entry
(elt entry 1)
nil)))

(defun twittering-get-timeline-spec-string-from-process (proc)
(let ((entry (assoc proc twittering-process-info-alist)))
(if entry
(elt entry 2)
nil)))

(defun twittering-find-processes-for-timeline-spec (spec)
(apply 'append
(mapcar
Expand Down Expand Up @@ -3282,7 +3290,7 @@ variable `twittering-status-format'."
id since_id word)))
(when proc
(twittering-switch-timeline spec-string)
(twittering-register-process proc spec))))))
(twittering-register-process proc spec spec-string))))))
(t
(let ((type (car spec)))
(error "%s has not been supported yet" type))))))
Expand Down

0 comments on commit 7d73786

Please sign in to comment.