branch: scratch/rcirc-menu commit 69ec5b367d3658faf3b94a8c6d891d66196338a3 Author: Alex Schroeder <a...@gnu.org> Commit: Alex Schroeder <a...@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. --- 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