diff --git a/ChangeLog b/ChangeLog index 465490e2..4fb7aa84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ in order to avoid dead-lock. (twittering-get-list-index-sync): likewise. + * twittering-mode.el (twittering-verify-credentials): wait for the + process to exit in order to avoid dead-lock. + 2010-06-13 Tadashi MATSUO * twittering-mode.el (twittering-write-and-encrypt): fix arguments diff --git a/twittering-mode.el b/twittering-mode.el index 70a72114..7d41fa36 100644 --- a/twittering-mode.el +++ b/twittering-mode.el @@ -3114,10 +3114,19 @@ authorized -- The account has been authorized.") 'verify-credentials `((sentinel . twittering-http-get-verify-credentials-sentinel))))) - (unless proc + (cond + ((null proc) (setq twittering-account-authorization nil) (message "Authorization failed. Type M-x twit to retry.") - (setq twittering-oauth-access-token-alist nil)))) + (setq twittering-oauth-access-token-alist nil)) + (t + (while (and (eq twittering-account-authorization 'queried) + (memq (process-status proc) '(run connect open))) + (sit-for 0.1)) + (when (eq twittering-account-authorization 'queried) + (message "Authorization failed. Type M-x twit to retry.") + (setq twittering-oauth-access-token-alist nil) + (setq twittering-account-authorization nil)))))) (t (message "Failed to load an authorized token from \"%s\"." twittering-private-info-file)