From: Alex Schroeder Date: Fri, 3 Jul 2020 19:55:53 +0000 (+0200) Subject: Fixes to the Elpher menu code X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=235fa0433c7263a2dfb613e51c1296da82d79c4e;p=elpher.git Fixes to the Elpher menu code Added "P" for the interactive declaration of elpher-menu. Fixed the way current entries are added to the list of entries. Use (current-buffer) instead of buf because the file is compiled with lexical binding. --- diff --git a/elpher.el b/elpher.el index 1e46dd9..0965abb 100644 --- a/elpher.el +++ b/elpher.el @@ -2013,7 +2013,7 @@ functions which initialize the gopher client, namely (defun elpher-menu (&optional arg) "Show a list of all your `elpher' buffers. With an optional argument, add all the history items, too." - (interactive) + (interactive "P") (switch-to-buffer (get-buffer-create "*Elpher Menu*")) (elpher-menu-mode) (elpher-menu-refresh arg) @@ -2164,11 +2164,9 @@ With an optional argument, add all the history items, too." (dolist (buf (buffer-list)) (with-current-buffer buf (when (memq major-mode '(elpher-mode eww-mode)) - (setq entries - (nconc (if arg - (elpher-menu-refresh-current) - (elpher-menu-refresh-history)) - entries))))) + (if arg + (setq entries (nconc (elpher-menu-refresh-history) entries)) + (push (elpher-menu-refresh-current) entries))))) (setq tabulated-list-entries (nreverse entries))) (tabulated-list-init-header)) @@ -2176,7 +2174,7 @@ With an optional argument, add all the history items, too." "Return current entries for `elpher-menu-refresh'. If we're only interested in the current entries, then this function can only return a list of a single item per buffer." - (list buf + (list (current-buffer) (vector (cond ((eq major-mode 'elpher-mode) "E") ((eq major-mode 'eww-mode) "W"))