[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/rcirc-menu 69ec5b3: rcirc-menu.el: make rcirc-menu-update
From: |
Alex Schroeder |
Subject: |
[elpa] scratch/rcirc-menu 69ec5b3: rcirc-menu.el: make rcirc-menu-update more resilient |
Date: |
Fri, 11 Aug 2017 03:40:19 -0400 (EDT) |
branch: scratch/rcirc-menu
commit 69ec5b367d3658faf3b94a8c6d891d66196338a3
Author: Alex Schroeder <address@hidden>
Commit: Alex Schroeder <address@hidden>
rcirc-menu.el: make rcirc-menu-update more resilient
If the buffer doesn't exist, don't create it. If it exists but it
doesn't have use a mode derived from tabulated-list-mode, ignore it.
If we don't do that, updating the rcirc activity string will call
tabulated-list-revert which might throw an error.
---
packages/rcirc-menu/rcirc-menu.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/packages/rcirc-menu/rcirc-menu.el
b/packages/rcirc-menu/rcirc-menu.el
index 6905130..64c0faa 100644
--- a/packages/rcirc-menu/rcirc-menu.el
+++ b/packages/rcirc-menu/rcirc-menu.el
@@ -249,8 +249,13 @@ elements of ‘tabulated-list-entries’."
(defun rcirc-menu-update ()
"Update the Rcirc Menu buffer, if any."
- (with-current-buffer (get-buffer-create "*Rcirc Menu*")
- ;; this will move point
- (tabulated-list-revert)))
+ (let ((buf (get-buffer "*Rcirc Menu*")))
+ (when buf
+ (with-current-buffer buf
+ (when (derived-mode-p 'tabulated-list-mode)
+ ;; this will move point
+ (tabulated-list-revert))))))
+
+(provide 'rcirc-menu)
;;; rcirc-menu.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] scratch/rcirc-menu 69ec5b3: rcirc-menu.el: make rcirc-menu-update more resilient,
Alex Schroeder <=