From 27921a14635ba1b991a271e7c62cd8b5a7752c13 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Sat, 4 Jul 2020 15:06:28 +0200 Subject: [PATCH] Add Gemini Mode to the menu When I'm using Elpher, and I'm editing Gemini files, chances are that I want both of them in the same list. --- elpher.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/elpher.el b/elpher.el index 13cd006..dc83212 100644 --- a/elpher.el +++ b/elpher.el @@ -2158,7 +2158,7 @@ With an optional argument, add all the history items, too." (let (entries) (dolist (buf (buffer-list)) (with-current-buffer buf - (when (memq major-mode '(elpher-mode eww-mode)) + (when (memq major-mode '(elpher-mode eww-mode gemini-mode)) (if arg (setq entries (nconc (elpher-menu-refresh-history) entries)) (push (elpher-menu-refresh-current) entries))))) @@ -2171,17 +2171,25 @@ If we're only interested in the current entries, then this function can only return a list of a single item per buffer." (list (current-buffer) (vector - (cond ((eq major-mode 'elpher-mode) "E") + (cond ((eq major-mode 'elpher-mode) "G") + ((eq major-mode 'gemini-mode) "E") ((eq major-mode 'eww-mode) "W")) (cond ((eq major-mode 'elpher-mode) (or (elpher-address-to-url (elpher-page-address elpher-current-page)) "none")) + ((eq major-mode 'gemini-mode) + (or (elpher-address-to-url + (elpher-page-address elpher-current-page)) + "none")) ((eq major-mode 'eww-mode) (eww-current-url))) (cond ((eq major-mode 'elpher-mode) (or (elpher-find-title) (elpher-page-display-string elpher-current-page))) + ((eq major-mode 'gemini-mode) + (or (elpher-page-display-string elpher-current-page) + (buffer-name))) ((eq major-mode 'eww-mode) (plist-get eww-data :title)))))) -- 2.20.1