all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Proulx <bob@proulx.com>
To: cplum984@gmail.com
Cc: help-gnu-emacs@gnu.org
Subject: Re: Need help with emacs clipboard.
Date: Tue, 13 Jan 2015 21:46:51 -0700	[thread overview]
Message-ID: <20150113212722522787447@bob.proulx.com> (raw)
In-Reply-To: <f131879b-046b-4413-aca2-be9838d60217@googlegroups.com>

cplum984@gmail.com wrote:
> I've switched from xemacs to emacs, and I'm trying to get
> undo/cut/copy/paste all working again.

I assume you are using emacs with a graphical interface?  Such as the
GTK or Lucid libraries?

> ...  Also, the clipboard is properly imported and exported with
> other X apps.  ...
> ... Still no import or export of the clipboards.

I see exactly the opposite behavior.  Emacs by default uses the
clipboard for cut-and-paste.  But on my system nothing else uses the
clipboard as Firefox and Chromium both use the X primary selection.
Therefore to make Emacs compatible with Firefox and Chromium I need to
configure emacs to use the primary selection (as it used to do) too.

In the Emacs NEWS (seen with C-h n) find this:

  * Editing Changes in Emacs 24.1
  ...
  ** Selection changes.

  The default handling of clipboard and primary selections has been
  changed to conform with modern X applications.  In short, most
  commands for killing and yanking text now use the clipboard, while
  mouse commands use the primary selection.

So I am surprised that you need to configure emacs to use the
clipboard since that is now the default.

Try running emacs with:

  emacs -Q
  emacs -q

Then check the behavior again.  That will avoid running any of your
personal configuration (-q) and the local system config (-Q) and if
those work then you know some personal configuration is affecting this.

> The only way I seem to be able to import the clipboard is if I first
> paste into an xemacs buffer, and then use the xemacs Copy menu item
> (not f4, which won't work), and then switch to emacs and use the
> emacs Paste menu item (not f4 or C-v, which won't work). f4 and C-v
> work after using the Paste menu item however. For exporting the
> clipboard from emacs, I'm forced to paste into a clipboard file that
> I save and open from xemacs so I can then copy the contents to the
> clipboard.

Are you familiar with the "xclip" command?  It is a useful utility for
working with cut and paste.  Works with either the primary selection
or the clipboard.

  xclip -selection clipboard -o  # paste from clipboard
  xclip -selection primary -o    # paste from primary selection

If nothing else it will allow you to verify what is where.

> So this is getting very frustrating since I interact with emacs
> sessions using the clipboard a lot, and the above workaround just
> isn't going to cut it. There's got to be a better solution. I'm
> hoping someone here can help.

This won't help you because you want the opposite but just to post my
example this is what I do to configure emacs to be usable on the X
desktop using the primary selection.

      (setq transient-mark-mode nil)
      (setq select-active-regions nil) 	; default is nil in 23, t in 24
      (setq mouse-drag-copy-region t)	; default is t in 23, nil in 24
      (setq x-select-enable-primary t)	; default is nil in 23, t in 24
      (setq x-select-enable-clipboard nil) ; default is nil in 23, t in 24
      (setq x-select-enable-clipboard-manager nil) ; new in 24, default is t

Bob



  reply	other threads:[~2015-01-14  4:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  2:47 Need help with emacs clipboard cplum984
2015-01-14  4:46 ` Bob Proulx [this message]
2015-01-14 16:36   ` Harry Putnam
2015-01-14 20:46     ` Bob Proulx
2015-01-15 20:50       ` Harry Putnam
     [not found]       ` <mailman.17973.1421355042.1147.help-gnu-emacs@gnu.org>
2015-01-15 21:05         ` Joost Kremers
2015-01-25 22:53   ` Robert Thorpe
2015-01-31  3:18     ` Bob Proulx
2015-01-31 19:02       ` Robert Thorpe
2015-02-01  4:45         ` Bob Proulx
2015-02-01 13:53           ` Robert Thorpe

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

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

  git send-email \
    --in-reply-to=20150113212722522787447@bob.proulx.com \
    --to=bob@proulx.com \
    --cc=cplum984@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.