emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OSX: Interprogram cut/paste issues ///


From: YAMAMOTO Mitsuharu
Subject: Re: OSX: Interprogram cut/paste issues ///
Date: Tue, 03 May 2005 10:28:17 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Fri, 29 Apr 2005 14:55:53 +0100, David Reitter <address@hidden> said:

>> Is (setq x-select-enable-clipboard nil) what you want?  I tried to
>> use with this setting for a while and noticed that the patch below
>> may be needed.

> OK, obviously yes. I'm a little confused with regards to the
> documentation of this variable, which says that "Non-nil means
> cutting and pasting uses the clipboard.  This is in addition to the
> primary selection."

The variable `x-select-enable-clipboard' and its documentation is
common to various platforms.  Non-nil means
yank/kill-ring-save/kill-region use the selection CLIPBOARD as well as
PRIMARY, and nil means they don't use CLIPBOARD.  The functions
clipboard-{yank/kill-ring-save/kill-region} use CLIPBOARD regardless
of the variable because they are defined as follows:

(defun clipboard-yank ()
  "Insert the clipboard contents, or the last stretch of killed text."
  (interactive)
  (let ((x-select-enable-clipboard t))
    (yank)))

>> to make the Services menu work when x-select-enable-clipboard is
>> set to nil.

> Right, will do that, but I suggest this be integrated directly, as
> the documentation of x-select-enable-clipboard does not mention that
> a value of nil breaks the Services menu, and I guess it shouldn't do
> so either way.

Strictly speaking, it does not break but requires two actions, copying
to the clipboard and then activate the Services menu.  Anyway, I'm
thinking about making the following setting as default regardless of
the value of x-select-enable-clipboard, because the clipboard may be
cleared by other applications.

  (setq mac-services-selection 'PRIMARY)
  (put 'PRIMARY 'mac-scrap-name
       (format "org.gnu.Emacs.%d.PRIMARY" (emacs-pid)))

I was concerned about the performance issue described in

  http://lists.gnu.org/archive/html/emacs-devel/2005-04/msg00398.html

but it seems to be acceptable.

> The following code in cua-base might contribute to the problem:

> (define-key cua-global-keymap [remap yank] 'cua-paste)
> (define-key cua-global-keymap [remap clipboard-yank] 'cua-paste)

How about using the definition similar to clipboard-yank?

(defun clipboard-cua-paste (arg)
  (interactive "P")
  (let ((x-select-enable-clipboard t))
    (cua-paste arg)))

(define-key cua-global-keymap [remap clipboard-yank] 'clipboard-cua-paste)

> Also, I still have the "No overlay corresponding..." error when
> trying to close a frame with the mouse.

This error occurs even on X11 when x-select-enable-clipboard is set to
t.  As I said earlier, it seems that mouse-sel is primarily designed
to use PRIMARY and SECONDARY selections.  For what features are you
trying to use mouse-sel?

                                     YAMAMOTO Mitsuharu
                                address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]