emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/rcirc-menu 4e9c6d1 03/13: rcirc-menu.el: make rcirc-men


From: Stefan Monnier
Subject: [elpa] externals/rcirc-menu 4e9c6d1 03/13: rcirc-menu.el: make rcirc-menu-update more resilient
Date: Tue, 1 Dec 2020 16:56:11 -0500 (EST)

branch: externals/rcirc-menu
commit 4e9c6d1507968df0f68875eb0123b36499f7f3f7
Author: Alex Schroeder <alex@gnu.org>
Commit: Alex Schroeder <alex@gnu.org>

    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.
---
 rcirc-menu.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/rcirc-menu.el b/rcirc-menu.el
index 6905130..64c0faa 100644
--- a/rcirc-menu.el
+++ b/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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]