[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need help with emacs clipboard.
From: |
Bob Proulx |
Subject: |
Re: Need help with emacs clipboard. |
Date: |
Tue, 13 Jan 2015 21:46:51 -0700 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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