Permalink
Browse files

Fixed showing the browse list after url-retrieve.

There was an async callback issue.
  • Loading branch information...
1 parent b82feb2 commit 01454f5228bcee1f16de3d68ec0b952013cdfe60 Brian Zwahr committed Jul 29, 2012
Showing with 16 additions and 7 deletions.
  1. +8 −1 emacs/todo.org
  2. +8 −6 emacs/vimgolf.el
View
@@ -33,6 +33,13 @@
:END:
Use ellipses to truncate titles that would normally be longer than the
fill-column width.
-*** TODO When first loading (via url-retrieve), list isn't showing after the call
+*** DONE When first loading (via url-retrieve), list isn't showing after the call
+ CLOSED: [2012-07-28 Sat 23:11]
+ :LOGBOOK:
+ - State "DONE" from "TODO" [2012-07-28 Sat 23:11] \\
+ The list insertion was happening outside of the async callback. Now it happens
+ during the callback (if url-retrieve is used) and during the browse function
+ itself (if not).
+ :END:
I'm not sure if the call back isn't working or what. Manually refreshing
will display the list.
View
@@ -337,11 +337,11 @@ unknown key sequence was entered).")
(defun vimgolf-browse (&optional force-pull)
(interactive)
- (when (or (eq *vimgolf-browse-list* nil)
- force-pull)
- (url-retrieve vimgolf-host 'vimgolf-parse-browse-html))
- (vimgolf-browse-list)
- (vimgolf-browse-next))
+ (if (or (eq *vimgolf-browse-list* nil)
+ force-pull)
+ (url-retrieve vimgolf-host 'vimgolf-parse-browse-html)
+ (vimgolf-browse-list)
+ (vimgolf-browse-next)))
(defun vimgolf-browse-refresh ()
(interactive)
@@ -378,7 +378,9 @@ unknown key sequence was entered).")
(match-string 3 html))))
t)
(setq html (substring html (match-end 0))))
- *vimgolf-browse-list*)))
+ *vimgolf-browse-list*))
+ (vimgolf-browse-list)
+ (vimgolf-browse-next))
(defun vimgolf-browse-list ()
(let ((browse-buffer (get-buffer-create "*VimGolf Browse*")))

0 comments on commit 01454f5

Please sign in to comment.