Skip to content

Instantly share code, notes, and snippets.

@cvmat
Created June 16, 2013 03:54
Show Gist options
  • Save cvmat/5790701 to your computer and use it in GitHub Desktop.
Save cvmat/5790701 to your computer and use it in GitHub Desktop.
A patch for fixing hook invocation and rendering of twittering-mode. This is for https://github.com/hayamiz/twittering-mode/commit/f802da30cf2b3b85e9d6be4469181187138f2e22 .
diff -r fabdaa984fad twittering-mode.el
--- a/twittering-mode.el Sat Jun 15 23:41:42 2013 +0900
+++ b/twittering-mode.el Sun Jun 16 12:46:55 2013 +0900
@@ -4774,10 +4774,7 @@
(let ((other-spec (twittering-get-timeline-spec-for-buffer buffer))
(other-spec-string
(twittering-get-timeline-spec-string-for-buffer buffer)))
- (when (and
- (twittering-timeline-spec-depending-on-p other-spec spec)
- ;; The hook has been alreadly invoked for `spec'.
- (not (equal spec other-spec)))
+ (when (twittering-timeline-spec-depending-on-p other-spec spec)
(let* ((twittering-new-tweets-spec other-spec)
(twittering-new-tweets-statuses
(twittering-generate-composite-timeline
@@ -4788,7 +4785,9 @@
(twittering-render-timeline
buffer twittering-new-tweets-statuses t)))
(when rendered-tweets
- (run-hooks 'twittering-new-tweets-hook)
+ (when (not (equal spec other-spec))
+ ;; The hook has been alreadly invoked for `spec'.
+ (run-hooks 'twittering-new-tweets-hook))
`(,other-spec-string ,(length rendered-tweets)))))))
(twittering-get-buffer-list))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment