From 6ea8bf890d9db7f936f4e9aa12ee8f5843a54618 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 15 Nov 2025 04:13:45 -0600 Subject: fix(mousetrap): Fix dashboard click/scroll blocking issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change dashboard profile from primary-click to scroll+primary (allows both scrolling and left-clicking in dashboard) - Remove incorrect manual manipulation of minor-mode-map-alist (define-minor-mode handles this automatically via mouse-trap-mode-map) - Simplify disable logic to just clear the buffer-local keymap The bug was that manually prepending to minor-mode-map-alist interfered with Emacs' automatic buffer-local keymap lookup. Now each buffer gets its own keymap based on major mode, and Emacs handles the lookup correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- modules/mousetrap-mode.el | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/mousetrap-mode.el b/modules/mousetrap-mode.el index e656e447..7ee91d3b 100644 --- a/modules/mousetrap-mode.el +++ b/modules/mousetrap-mode.el @@ -66,7 +66,7 @@ Profiles: - full: Allow all mouse events") (defvar mouse-trap-mode-profiles - '((dashboard-mode . primary-click) + '((dashboard-mode . scroll+primary) (pdf-view-mode . full) (nov-mode . full)) "Map major modes to mouse-trap profiles. @@ -178,16 +178,11 @@ See `mouse-trap-profiles' for available profiles and (if mouse-trap-mode (progn (setq mouse-trap-mode-map (mouse-trap--build-keymap)) - ;; Force the keymap to be recognized by the minor mode system - (setq minor-mode-map-alist - (cons (cons 'mouse-trap-mode mouse-trap-mode-map) - (assq-delete-all 'mouse-trap-mode minor-mode-map-alist))) ;; Add dynamic lighter to mode-line-misc-info (always visible) (unless (member '(:eval (mouse-trap--lighter-string)) mode-line-misc-info) (push '(:eval (mouse-trap--lighter-string)) mode-line-misc-info))) - ;; When disabling, remove from minor-mode-map-alist - (setq minor-mode-map-alist - (assq-delete-all 'mouse-trap-mode minor-mode-map-alist)) + ;; When disabling, clear the keymap + (setq mouse-trap-mode-map nil) ;; Note: We keep the lighter in mode-line-misc-info so it shows 🐭 when disabled )) -- cgit v1.2.3