{"id":392,"date":"2022-08-30T15:00:35","date_gmt":"2022-08-30T15:00:35","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/how-can-i-get-mouse-selection-to-work-in-emacs-and-iterm2-on-mac-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:00:35","modified_gmt":"2022-08-30T15:00:35","slug":"how-can-i-get-mouse-selection-to-work-in-emacs-and-iterm2-on-mac-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-can-i-get-mouse-selection-to-work-in-emacs-and-iterm2-on-mac-collection-of-common-programming-errors\/","title":{"rendered":"How can I get mouse selection to work in emacs and iTerm2 on Mac?-Collection of common programming errors"},"content":{"rendered":"<p>For Emacs in iTerm 2, I&#8217;ve found that the following bit in my <code>~\/.emacs<\/code> file works very well, providing the ability to insert the character at an arbitrary location, mark a region, and use the scroll wheel:<\/p>\n<pre><code>;; Enable mouse support\n(unless window-system\n  (require 'mouse)\n  (xterm-mouse-mode t)\n  (global-set-key [mouse-4] '(lambda ()\n                              (interactive)\n                              (scroll-down 1)))\n  (global-set-key [mouse-5] '(lambda ()\n                              (interactive)\n                              (scroll-up 1)))\n  (defun track-mouse (e))\n  (setq mouse-sel-mode t)\n)\n<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-09 18:42:47. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>For Emacs in iTerm 2, I&#8217;ve found that the following bit in my ~\/.emacs file works very well, providing the ability to insert the character at an arbitrary location, mark a region, and use the scroll wheel: ;; Enable mouse support (unless window-system (require &#8216;mouse) (xterm-mouse-mode t) (global-set-key [mouse-4] &#8216;(lambda () (interactive) (scroll-down 1))) (global-set-key [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-392","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=392"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/392\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}