From 3310f9dfe2348b11e6414d65ebbcecc3609cd8e8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 2 Apr 2019 12:50:18 -0400 Subject: [PATCH] tools/gist: open gists in non-popups - Removes +gist/kill-cache (gist-list and gist-list-user with a universal argument already does this). - Removes +gist/open-current. No longer necessary when gists aren't opened in popups. - Makes keybinds more consistent with other "porcelains", like elfeed's or magit. --- modules/config/default/+evil-bindings.el | 9 ++++----- modules/tools/gist/autoload/gist.el | 16 ---------------- modules/tools/gist/config.el | 2 ++ 3 files changed, 6 insertions(+), 21 deletions(-) delete mode 100644 modules/tools/gist/autoload/gist.el diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index ac1617fd7..56999ad4f 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -467,14 +467,13 @@ (:when (featurep! :tools gist) :after gist :map gist-list-menu-mode-map - :n "RET" #'+gist/open-current - :n [return] #'+gist/open-current - :n "b" #'gist-browse-current-url + :n "go" #'gist-browse-current-url + :n "gr" #'gist-list-reload :n "c" #'gist-add-buffer :n "d" #'gist-kill-current + :n "e" #'gist-edit-current-description :n "f" #'gist-fork - :n "q" #'quit-window - :n "r" #'gist-list-reload + :n "q" #'kill-this-buffer :n "s" #'gist-star :n "S" #'gist-unstar :n "y" #'gist-print-current-url)) diff --git a/modules/tools/gist/autoload/gist.el b/modules/tools/gist/autoload/gist.el deleted file mode 100644 index 1202b003a..000000000 --- a/modules/tools/gist/autoload/gist.el +++ /dev/null @@ -1,16 +0,0 @@ -;;; tools/gist/autoload/gist.el -*- lexical-binding: t; -*- - -;;;###autoload -(defun +gist/open-current () - (interactive) - (gist-fetch-current) - (when-let* ((win (get-buffer-window "*github:gists*"))) - (doom/popup-close win))) - -;;;###autoload -(defun +gist/kill-cache () - "Clears the gist cache. Necessary when a faulty cache causes gist.el to be -entirely unuseable." - (interactive) - (delete-directory (expand-file-name "gh" pcache-directory) t) - (message "gist.el cache cleared")) diff --git a/modules/tools/gist/config.el b/modules/tools/gist/config.el index 9fa0e730d..4e8f84b52 100644 --- a/modules/tools/gist/config.el +++ b/modules/tools/gist/config.el @@ -7,6 +7,8 @@ (after! gist (set-evil-initial-state! 'gist-list-mode 'normal) + (set-popup-rule! "^\\*gist-" :ignore t) + (defun +gist*list-render (orig-fn &rest args) (funcall orig-fn (car args) t) (unless (cadr args)