[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs24/gtk3 - how to mark rectangle of to primary selection?
From: |
Aurélien Aptel |
Subject: |
Re: emacs24/gtk3 - how to mark rectangle of to primary selection? |
Date: |
Wed, 27 Jun 2012 19:15:20 +0200 |
Well, it was longer than expected... Turns out if you don't deactive
the mark, emacs copies the regular active region. My guess is it
corresponds to mouse selection: once a region is selected it is copied
to the primary selection.
(defun my-copy-rect-to-primary ()
(interactive)
(when (region-active-p)
(let ((text (mapconcat 'identity
(extract-rectangle
(region-beginning)
(region-end)) "\n")))
(deactivate-mark) ;; lost 30mn because of this
(x-set-selection 'PRIMARY text)
(message "%s" text))))
Message not available
Message not availableRe: emacs24/gtk3 - how to mark rectangle of to primary selection?, Xah Lee, 2012/06/29