Skip to content

Instantly share code, notes, and snippets.

@JEG2
Created March 26, 2012 15:02
Show Gist options
  • Select an option

  • Save JEG2/2205705 to your computer and use it in GitHub Desktop.

Select an option

Save JEG2/2205705 to your computer and use it in GitHub Desktop.
I'm trying to understand how to write a command that leaves an active region.
(defun jeg2s-yank-and-select ()
"This is a test command for how to create a selection."
(interactive)
(kill-new "selected")
(yank)
;; what can I replace to following with to activate the selection
(exchange-point-and-mark))
(global-set-key (kbd "C-c y") 'jeg2s-yank-and-select)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment