From 9b2bacb956e64cc68f3778da27362f353eed9421 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 18 Mar 2023 15:48:11 +0100 Subject: views: comment on keymap inheritace - all maps inherit --- lisp/mastodon-views.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-views.el') diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index 45317cf..544c362 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -68,6 +68,17 @@ ;;; KEYMAPS +;; copy `mastodon-mode-map' if possible, as then all timeline functions are +;; available. this is helpful because if a minor view is the only buffer left +;; open, calling `mastodon' will switch to it, but then we will be unable to +;; switch to timlines without closing the minor view. + +;; copying the mode map however means we need to avoid/unbind/override any +;; functions that might cause interfere with the minor view. + +;; this is not redundant, as while the buffer -init function calls +;; `mastodon-mode', it gets overridden in some but not all cases. + (defvar mastodon-views--view-filters-keymap (let ((map (copy-keymap mastodon-mode-map))) @@ -116,7 +127,9 @@ "Keymap for when point is on list name.") (defvar mastodon-views--scheduled-map - (let ((map (make-sparse-keymap))) + (let ((map ;(make-sparse-keymap))) + (copy-keymap mastodon-mode-map))) + ;; (let ((map (make-sparse-keymap))) (define-key map (kbd "n") 'mastodon-tl--goto-next-item) (define-key map (kbd "p") 'mastodon-tl--goto-prev-item) (define-key map (kbd "r") 'mastodon-views--reschedule-toot) -- cgit v1.2.3