unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Ittay Dror <ittay@qlusters.com>
Subject: Re: copy/paste & Emacs on XWindows
Date: 20 Mar 2003 07:59:07 +0200	[thread overview]
Message-ID: <1048139947.1181.4.camel@rum> (raw)
In-Reply-To: <ud6kngpvz.fsf@swbell.net>

On Wed, 2003-03-19 at 20:41, Peter Lee wrote:
> Ittay Dror <ittay@qlusters.com> writes:
> 
> > i have this hack:
> > (defun if-copy-mark-to-primary-selection ()
> >   (if mark-active
> > 	  (x-set-selection 'PRIMARY (buffer-substring (region-beginning)
> > (region-end)))))
> > 
> > (add-hook 'post-command-hook 'if-copy-mark-to-primary-selection)
> > 
> > what it does is copy the region to the primary selection, (which is not
> > the clipboard), use the middle mouse button to paste it in another
> > window. if you wish to copy to the clipboard, change PRIMARY to
> > CLIPBOARD.
> 
> Thanks a bunch!  I will try this when I get home.  One other
> thing... what about copying from clipboard to Emacs?  Any tricks for
> that ?  Or should that just work as is?  
it should work as it. check that the variable x-select-enable-clipboard
is set to t. however, i think that the middle mouse button will try to
paste from there and not the primary selection, as it normally does.
anyway, below are other hacks i use. 

(defadvice mouse-yank-at-click (around yank-from-primary last act)
  "i want the middle mouse button to always paste the primary selection"
  (let ((x-select-enable-clipboard nil))
	ad-do-it))

(defadvice mouse-set-region (around kill-to-primary last act)
  "i want the mouse drags to copy only to primary selection"
  (let ((x-select-enable-clipboard nil))
	ad-do-it))

(defadvice mouse-drag-region (around kill-to-primary last act)
  "i want the mouse drags to copy only to primary selection"
  (let ((x-select-enable-clipboard nil))
	ad-do-it))


and while i'm at it, these are my hacks for using the cut buffers
instead of the kill ring (if you use kde, then the cut buffers is the
history you see in klipper).

(defadvice current-kill (around use-cut-buffer first act)
  "use the cut buffer instead of the kill ring"
   (let ((text (if (> n 0)
 				  (x-get-cut-buffer n)
 				ad-do-it)))
 	(setq ad-return-value text)))

(defadvice yank (before fix-arg last act)
  "when invoked with prefix argument, yank passes current-kill the value
of arg-1. so if
i do <esc> 1 <shift>-<insert>, i get the same as just <shift>-<insert>"
  (if (not (or (listp arg) (eq arg '-)))
	  (setq arg (1+ arg))))


-- 
===================================
Ittay Dror (ittay@qlusters.com)
User Space Team, R&D
Qlusters Inc.
+972-3-6081976 Fax: +972-3-6081841

  reply	other threads:[~2003-03-20  5:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-17 23:59 copy/paste & Emacs on XWindows Peter Lee
2003-03-18 21:25 ` Roman A. Lagunov
2003-03-19  9:52   ` Ittay Dror
     [not found]   ` <mailman.3367.1048067622.21513.help-gnu-emacs@gnu.org>
2003-03-19 18:41     ` Peter Lee
2003-03-20  5:59       ` Ittay Dror [this message]
     [not found]       ` <mailman.3403.1048139991.21513.help-gnu-emacs@gnu.org>
2003-03-20 16:17         ` Peter Lee
2003-04-18  4:24         ` David Combs
     [not found] ` <mailman.3341.1048023843.21513.help-gnu-emacs@gnu.org>
2003-03-19  9:41   ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1048139947.1181.4.camel@rum \
    --to=ittay@qlusters.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).