summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2018-12-12 15:26:26 -0500
committerAmin Bandali <bandali@gnu.org>2018-12-12 15:26:26 -0500
commitb9d46ec704f654b7a95762810b54c95a6a194789 (patch)
tree3677b4156ca5d1fb5f452e990b727374cc04c918
parente87abe21e1508a23d17c14b02ca9b0244b329106 (diff)
downloadconfigs-b9d46ec704f654b7a95762810b54c95a6a194789.tar.gz
configs-b9d46ec704f654b7a95762810b54c95a6a194789.tar.xz
configs-b9d46ec704f654b7a95762810b54c95a6a194789.zip
[emacs] focus follows mouse, except in gnus-summary-mode buffers
-rw-r--r--init.org21
1 files changed, 20 insertions, 1 deletions
diff --git a/init.org b/init.org
index 7c12ad5..9c64204 100644
--- a/init.org
+++ b/init.org
@@ -419,6 +419,24 @@ Font stack with better unicode support, around =Ubuntu Mono= and
(setq text-scale-mode-step 1.05)
#+end_src
+** Focus follows mouse
+
+I’d like focus to follow the mouse when I move the cursor from one
+window to the next.
+
+#+begin_src emacs-lisp
+(setq mouse-autoselect-window t)
+#+end_src
+
+Let’s define a function to conveniently disable this for certain
+buffers and/or modes.
+
+#+begin_src emacs-lisp
+(defun amin--no-mouse-autoselect-window ()
+ (make-local-variable 'mouse-autoselect-window)
+ (setq mouse-autoselect-window nil))
+#+end_src
+
** Libraries
#+begin_src emacs-lisp
@@ -2243,7 +2261,8 @@ For when I /have to/ use GH.
:map gnus-summary-mode-map
("r" . gnus-summary-reply-with-original)
("R" . gnus-summary-wide-reply-with-original)
- ("M-L" . org-store-link)))
+ ("M-L" . org-store-link))
+ :hook (gnus-summary-mode . amin--no-mouse-autoselect-window))
(use-package gnus-msg
:config