Skip to content

Commit

Permalink
(twittering-read-username-with-completion): convert a list of usernam…
Browse files Browse the repository at this point in the history
…e strings to an alist before calling 'completing-read' to work on Emacs21;

same as 'twittering-read-timeline-spec-with-completion'.
  • Loading branch information
yata committed Jan 9, 2010
1 parent 2a8a2d1 commit 28cb9dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Expand Up @@ -19,6 +19,11 @@
(twittering-timeline-spec-to-host-method): Likewise.
(twittering-get-and-render-timeline): Likewise.

* twittering-mode.el (twittering-read-username-with-completion):
Convert a list of username strings to an alist before calling
`completing-read' to work on Emacs21; same as
`twittering-read-timeline-spec-with-completion'.

2010-01-09 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-http-get-list-index-sentinel):
Expand Down
15 changes: 10 additions & 5 deletions twittering-mode.el
Expand Up @@ -2384,11 +2384,16 @@ following symbols;
data))

(defun twittering-read-username-with-completion (prompt init-user &optional history)
(completing-read prompt
(append (twittering-make-list-from-assoc
'user-screen-name twittering-timeline-data)
twittering-user-history)
nil nil init-user history))
;; completing-read() of Emacs21 does not accepts candidates as a
;; list. Candidates must be given as an alist.
(let ((user-alist (mapcar
(lambda (x) (cons x nil))
(append (twittering-make-list-from-assoc
'user-screen-name twittering-timeline-data)
twittering-user-history))))
(when (fboundp 'delete-dups)
(delete-dups user-alist))
(completing-read prompt user-alist nil nil init-user history)))

(defun twittering-read-list-name (username &optional list-index)
(let* ((list-index (or list-index
Expand Down

0 comments on commit 28cb9dd

Please sign in to comment.