summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-05-13 06:34:56 +0900
committerSean Whitton <spwhitton@spwhitton.name>2015-05-13 06:34:56 +0900
commit14965f0b4c41ffd2afa9ccbd6b372d54c733c3f2 (patch)
treea3b9e6ed3a378ed6c3c364a1aff4b3d3b8d84a62
parent3f1c03a7a9b7e532b1a690bd53fb66774e58ed9e (diff)
downloaddotfiles-14965f0b4c41ffd2afa9ccbd6b372d54c733c3f2.tar.gz
more consistent paste & primary selection
-rw-r--r--.emacs.d/init.el20
1 files changed, 15 insertions, 5 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 2873b946..81161b56 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -1917,12 +1917,22 @@ BINDEE may be a command or another keymap, but whatever it is, it should not be
(setq browse-url-generic-program "iceweasel"
browse-url-browser-function 'browse-url-generic)
-;; return to Emacs 23 selection/clipboard behaviour
-(setq select-active-regions nil
+;; clipboard & primary selection: see https://www.gnu.org/software/emacs/manual/html_node/emacs/Clipboard.html
+
+;; with this setup, C-y and M-w access the clipboard, while selecting
+;; a region and then pressing C-g and middle click access the primary
+;; selection
+
+(setq select-active-regions t
mouse-drag-copy-region t
- x-select-enable-primary t
- x-select-enable-clipboard t)
-(global-set-key [mouse-2] 'mouse-yank-at-click)
+ x-select-enable-primary nil
+ x-select-enable-clipboard t
+ mouse-yank-at-point t
+ yank-pop-change-selection t
+ save-interprogram-paste-before-kill t
+ x-select-enable-clipboard-manager t)
+
+(global-set-key [mouse-2] 'mouse-yank-primary)
;; require a buffer to have a final newline
(setq require-final-newline 'visit-save)