From 5b09f655cb530f9ea3aff9e8f2fd316edae09025 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sun, 3 Jan 2021 00:38:59 +0800 Subject: [PATCH 1/5] Revet and use wrapped mouse click. --- dashboard.el | 1 + 1 file changed, 1 insertion(+) diff --git a/dashboard.el b/dashboard.el index acb28490..86ef31aa 100644 --- a/dashboard.el +++ b/dashboard.el @@ -41,6 +41,7 @@ (define-key map (kbd "C-i") 'widget-forward) (define-key map [backtab] 'widget-backward) (define-key map (kbd "RET") 'dashboard-return) + (define-key map [down-mouse-1] 'dashboard-widget-button-click) (define-key map (kbd "g") #'dashboard-refresh-buffer) (define-key map (kbd "}") #'dashboard-next-section) (define-key map (kbd "{") #'dashboard-previous-section) From ce61f4b845fbec380ed160db6010ab2133493e48 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sun, 3 Jan 2021 00:39:08 +0800 Subject: [PATCH 2/5] Impls mouse click. --- dashboard-widgets.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index b07411be..2749ff07 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -345,6 +345,11 @@ If nil it is disabled. Possible values for list-type are: ;; ;; Generic widget helpers ;; +(defun dashboard-widget-button-click () + "Mouse click on widget button." + (interactive) + (or (call-interactively 'widget-button-click) nil)) + (defun dashboard-subseq (seq start end) "Return the subsequence of SEQ from START to END.. Uses `cl-subseq`, but accounts for end points greater than the size of the From 5472ab30c01a0f34586b90eefc63c1e2deef3329 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sun, 3 Jan 2021 00:58:09 +0800 Subject: [PATCH 3/5] Make record of TODO, wrapped widget-button-block. --- dashboard-widgets.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 2749ff07..54d654e6 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -348,7 +348,12 @@ If nil it is disabled. Possible values for list-type are: (defun dashboard-widget-button-click () "Mouse click on widget button." (interactive) - (or (call-interactively 'widget-button-click) nil)) + ;; TODO: I don't think returning `nil' would fix issue #184 + ;; On my Window machine, I need to call function `widget-button-click' + ;; to trigger it's functionality on both graphic and terminal versions. + ;; + ;; In issue #184, we need to set keymap `down-mouse-1' to `nil' to resolve this. + (or (call-interactively #'widget-button-click) nil)) (defun dashboard-subseq (seq start end) "Return the subsequence of SEQ from START to END.. From 39d08446d55eb926b6a3061956df8cdfe6755d33 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sun, 3 Jan 2021 00:58:29 +0800 Subject: [PATCH 4/5] Revert to empty. --- dashboard-widgets.el | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dashboard-widgets.el b/dashboard-widgets.el index 54d654e6..b07411be 100644 --- a/dashboard-widgets.el +++ b/dashboard-widgets.el @@ -345,16 +345,6 @@ If nil it is disabled. Possible values for list-type are: ;; ;; Generic widget helpers ;; -(defun dashboard-widget-button-click () - "Mouse click on widget button." - (interactive) - ;; TODO: I don't think returning `nil' would fix issue #184 - ;; On my Window machine, I need to call function `widget-button-click' - ;; to trigger it's functionality on both graphic and terminal versions. - ;; - ;; In issue #184, we need to set keymap `down-mouse-1' to `nil' to resolve this. - (or (call-interactively #'widget-button-click) nil)) - (defun dashboard-subseq (seq start end) "Return the subsequence of SEQ from START to END.. Uses `cl-subseq`, but accounts for end points greater than the size of the From 8c7f1754870f81e02cbce543d78145e98f2d6490 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sun, 3 Jan 2021 00:58:39 +0800 Subject: [PATCH 5/5] Use mouse-1 instead of down-mouse-1. --- dashboard.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard.el b/dashboard.el index 86ef31aa..cb850eb4 100644 --- a/dashboard.el +++ b/dashboard.el @@ -41,7 +41,7 @@ (define-key map (kbd "C-i") 'widget-forward) (define-key map [backtab] 'widget-backward) (define-key map (kbd "RET") 'dashboard-return) - (define-key map [down-mouse-1] 'dashboard-widget-button-click) + (define-key map [mouse-1] 'widget-button-click) (define-key map (kbd "g") #'dashboard-refresh-buffer) (define-key map (kbd "}") #'dashboard-next-section) (define-key map (kbd "{") #'dashboard-previous-section)