branch: externals/poke
commit 4fe7b7d8d3839e17a5658daa821515f38c77f05d
Author: Jose E. Marchesi <[email protected]>
Commit: Jose E. Marchesi <[email protected]>
poke.el: fix pouplating map buffer
---
poke.el | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/poke.el b/poke.el
index f73f334d5d..d3c83cb635 100644
--- a/poke.el
+++ b/poke.el
@@ -1068,11 +1068,20 @@ Each entry in the stack is a list of strings, and may
be empty.")
(list nil name type offset)
(car poke-maps-stack))
(cdr poke-maps-stack)))
- (poke-maps-populate)
- (poke-maps-do-line)
+ (let ((buf (get-buffer-create "*poke-maps*")))
+ (with-current-buffer buf
+ (poke-maps-do-buffer)))
(when (not (get-buffer-window "*poke-maps*"))
(switch-to-buffer-other-window "*poke-maps*")))
+(defun poke-maps-do-buffer ()
+ (let ((inhibit-read-only t))
+ (erase-buffer))
+ (remove-overlays)
+ (poke-maps-mode)
+ (poke-maps-populate)
+ (poke-maps-do-line))
+
(defun poke-maps-populate ()
"Populate a `poke-maps-mode' buffer with the map listing
at the top of the `poke-maps-stack' stack."
@@ -1189,9 +1198,7 @@ at the top of the `poke-maps-stack' stack."
(interactive)
(let ((buf (get-buffer-create "*poke-maps*")))
(with-current-buffer buf
- (poke-maps-mode)
- (poke-maps-populate)
- (poke-maps-update-overlay)))
+ (poke-maps-do-buffer)))
(when (called-interactively-p)
(switch-to-buffer-other-window "*poke-maps*")))