all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: David De La Harpe Golden <david@harpegolden.net>
Cc: cyd@stupidchicken.com, jan.h.d@swipnet.se, emacs-devel@gnu.org
Subject: Re: Selection changes in revno 100822
Date: Sat, 14 Aug 2010 18:18:11 +0300	[thread overview]
Message-ID: <83hbixte8c.fsf@gnu.org> (raw)
In-Reply-To: <4C66A8C5.4040203@harpegolden.net>

> Date: Sat, 14 Aug 2010 15:31:33 +0100
> From: David De La Harpe Golden <david@harpegolden.net>
> CC: Jan Djärv <jan.h.d@swipnet.se>, 
>  cyd@stupidchicken.com, emacs-devel@gnu.org
> 
> 
> > Thanks, this clears up quite a bit of the confusion.  So would it be
> > correct to modify the doc string of x-select-enable-primary to say
> > this:
> >
> >     Non-nil means cutting text sets the primary selection.
> 
> [and pasting (yanking) gets from the primary selection.]

But pasting gets from the primary selection unconditionally, so it
seems.  E.g., under the default nil value of x-select-enable-primary,
mouse-2 still pastes from the primary selection.  That's why I didn't
mention pasting in the suggested modification of the doc string.  Am I
missing something?

> >     When the value is nil, the primary selection is still set by
> >     selecting the text.
> >
> 
> ...if select-active-regions is t

You mean, non-nil, right?  At least in deactivate-mark, we have this:

  (when (or transient-mark-mode force)
    (when (and select-active-regions   <<<<<<<<<<<<<<
	       (region-active-p)
	       (display-selections-p))
      ;; The var `saved-region-selection', if non-nil, is the text in
      ;; the region prior to the last command modifying the buffer.
      ;; Set the selection to that, or to the current region.
      (cond (saved-region-selection
	     (x-set-selection 'PRIMARY saved-region-selection)
	     (setq saved-region-selection nil))
	    ((/= (region-beginning) (region-end))
	     (x-set-selection 'PRIMARY
			      (buffer-substring-no-properties
			       (region-beginning)
			       (region-end))))))

Is this a bug or intended behavior?

> As just mentioned elsepost, a third option other than nil and t, 'lazy, 
> for select-active-regions was introduced recently, which means that 
> mouse/shift selections do, but c-spc selections don't immediately, c-spc 
> selections will defer setting primary to C-w/M-w time.
> 
> I don't like 'lazy.

And I don't like in general the situation where it seems impossible to
say if and when will selected text be put into the primary selection.

May I suggest to step back and post a clear set of requirements for
when Emacs should and shouldn't put selected text into the primary
selection and into the clipboard?  Forget the w32 case for now; let's
just spell out the requirements for X.

> > Why is it important not to touch the kill ring?
> >
> 
> Well, if you do that, you break a conceptually straightforward 
> kill-ring<=>clipboard mapping

What mapping is that?  Do you mean that only killed text goes to the
clipboard?  If so, that's fine, but I wasn't talking about the
clipboard.  I was talking about the primary selection on X and about
platforms that don't have any selections at all.  I was wondering why
is it important to stay away of the kill-ring like mouse-yank-primary
does, instead of doing it like mouse-yank-at-click, which was
previously bound to mouse-2?

> and pretty much depart from other-x11-app behaviour again.

What behavior is that?  What other apps have something similar to the
kill ring?

> there may be certain 
> platforms that have an "only one selection (the primary)" - think gpm, 
> where the user expectation would in fact be that mere selection of text 
> changes the gpm "selection buffer" (as it is referred to in the gpm 
> manpage) i.e. gpm happens to be more analogous to an x11 primary than an 
> x11 clipboard, unlike the w32 clipboard where users generally do not 
> expect mere selection of text to erase the previous clipboard contents).

IMO, whenever there's only one selection, its name, whether primary or
clipboard, is not important.  Thus, GPM can be thought of as being
like w32, not like X, because the distinction between the primary and
all the other selections is null and void.

IOW, the clipboard-related behavior of Emacs on Windows should be the
same as what Emacs does on X wrt the primary selection.

> >  And there should be a variable to
> > optionally set the clipboard when the text is selected.  (Do we
> > already have such a variable?
> 
> No, that would be the clipboard-active-regions I've mentioned before.

Why do we need a separate variable for the clipboard on w32? why not
reuse select-active-regions?  The amount of subtly dependent variables
that control the behavior regarding selected text wrt selections is
already too large, why introduce yet another one?

> However, it used to "symptomatically" for mouse selections only on
> w32, because mouse selections used to implicitly copy
> (mouse-drag-copy-region=>t).

So maybe we should continue setting the clipboard data on selecting
text, since w32 users always had that (mis-)feature.  They are used to
it.




  reply	other threads:[~2010-08-14 15:18 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-13 17:05 Selection changes in revno 100822 Eli Zaretskii
2010-08-14  1:08 ` Chong Yidong
2010-08-14  8:00   ` Eli Zaretskii
2010-08-14  8:24     ` Miles Bader
2010-08-14  9:16       ` Eli Zaretskii
2010-08-14 12:16         ` Miles Bader
2010-08-14 12:20           ` Eli Zaretskii
2010-08-14 12:35             ` Miles Bader
2010-08-14 13:02               ` Eli Zaretskii
2010-08-14 13:23                 ` Miles Bader
2010-08-14 13:27                   ` Eli Zaretskii
2010-08-14 13:32                     ` David De La Harpe Golden
2010-08-14 13:53                       ` Eli Zaretskii
2010-08-16  0:55                   ` Kenichi Handa
2010-08-14  9:46     ` Jan Djärv
2010-08-14 11:20       ` Eli Zaretskii
2010-08-14 13:54         ` Jan Djärv
2010-08-14 14:31         ` David De La Harpe Golden
2010-08-14 15:18           ` Eli Zaretskii [this message]
2010-08-14 17:21             ` David De La Harpe Golden
2010-08-14 19:04               ` Drew Adams
2010-08-14 22:16               ` Eli Zaretskii
2010-08-14 22:33                 ` David De La Harpe Golden
2010-08-14 22:58                   ` Eli Zaretskii
2010-08-14 23:42                     ` David De La Harpe Golden
2010-08-15  2:55                       ` Eli Zaretskii
2010-08-15 19:16                   ` James Cloos
2010-08-15 13:52                 ` Stephen J. Turnbull
2010-08-15 15:07                   ` Eli Zaretskii
2010-08-15 17:36                     ` Stephen J. Turnbull
2010-08-15 17:57                       ` Eli Zaretskii
2010-08-15 17:48                   ` Drew Adams
2010-08-15 18:16                     ` Eli Zaretskii
2010-08-15 19:29                       ` Drew Adams
2010-08-15 20:10                         ` Eli Zaretskii
2010-08-15 23:01                           ` Drew Adams
2010-08-16  3:01                             ` Eli Zaretskii
2010-08-16  3:42                     ` Stephen J. Turnbull
2010-08-16  5:23                       ` Eli Zaretskii
2010-08-16  6:10                         ` Stephen J. Turnbull
2010-08-16  8:11                           ` Manoj Srivastava
2010-08-16  8:25                             ` Miles Bader
2010-08-16  9:31                               ` Manoj Srivastava
2010-08-16  9:50                                 ` Miles Bader
2010-08-16 11:27                                   ` David Kastrup
2010-08-16 11:38                                     ` Jan Djärv
2010-08-14 22:43               ` Eli Zaretskii
2010-08-14 17:39             ` Jan Djärv
2010-08-14 21:52             ` Chong Yidong
2010-08-14 22:49               ` Eli Zaretskii
2010-08-15  1:11                 ` Miles Bader
2010-08-15  2:57                   ` Eli Zaretskii
2010-08-15 15:05                     ` Chong Yidong
2010-08-15 15:14                       ` Eli Zaretskii
2010-08-16  2:35                         ` Chong Yidong
2010-08-16  2:50                           ` David Kastrup
2010-08-16  3:05                             ` Eli Zaretskii
2010-08-16  7:07                               ` David Kastrup
2010-08-16  8:57                                 ` Jan Djärv
2010-08-16  9:18                                 ` Eli Zaretskii
2010-08-16  9:28                                   ` Miles Bader
2010-08-16  6:53                             ` Jan Djärv
2010-08-16  7:09                               ` David Kastrup
2010-08-16  8:52                                 ` Jan Djärv
2010-08-15  4:48                   ` Drew Adams
2010-08-15  5:31                     ` Miles Bader
2010-08-15  6:06                     ` Eli Zaretskii
2010-08-15 14:04                   ` Stephen J. Turnbull
2010-08-15 15:20                     ` Eli Zaretskii
2010-08-15 17:27                       ` David De La Harpe Golden
2010-08-15 17:59                         ` Eli Zaretskii
2010-08-15 19:50                           ` David De La Harpe Golden
2010-08-15 20:19                             ` Eli Zaretskii
2010-08-15 20:40                               ` David De La Harpe Golden
2010-08-15 21:13                                 ` Eli Zaretskii
2010-08-15 21:42                                   ` David De La Harpe Golden
2010-08-15 22:55                                     ` Drew Adams
2010-08-16  3:09                                     ` Eli Zaretskii
2010-08-15 16:57                     ` David De La Harpe Golden
2010-08-15 19:19                   ` James Cloos
2010-08-16 11:06                   ` Stefan Monnier
2010-08-15  4:48               ` Drew Adams
2010-08-15  6:01                 ` Eli Zaretskii
2010-08-15  7:19                   ` Jan Djärv
2010-08-15  8:26                     ` Miles Bader
2010-08-15  9:27                     ` Eli Zaretskii
2010-08-15 10:25                       ` Jan Djärv
2010-08-15 12:48                         ` David De La Harpe Golden
2010-08-15  7:22                   ` Thierry Volpiatto
2010-08-15  9:30                     ` Eli Zaretskii
2010-08-16 11:03               ` Stefan Monnier
2010-08-16 11:17                 ` Eli Zaretskii
2010-08-16 13:47                   ` Stefan Monnier
2010-08-16 19:00                     ` Eli Zaretskii
2010-08-16 22:44                       ` Stefan Monnier
2010-08-17  2:43                         ` Stephen J. Turnbull
2010-08-17  7:10                           ` Eli Zaretskii
2010-08-17  2:56                         ` Eli Zaretskii
2010-08-17 15:12                           ` Chong Yidong
2010-08-17 15:39                             ` Miles Bader
2010-08-17 16:10                               ` Miles Bader
2010-08-17 16:45                             ` Eli Zaretskii
2010-08-17 16:50                               ` Miles Bader
2010-08-17 18:14                                 ` Eli Zaretskii
2010-08-17 21:07                                   ` David De La Harpe Golden
2010-08-17 21:35                             ` David De La Harpe Golden
2010-08-18  2:12                               ` Miles Bader
2010-08-18 22:28                             ` James Cloos
2010-08-14 12:28     ` Johan Bockgård
2010-08-14 12:58       ` Eli Zaretskii
2010-08-14 15:59     ` Eli Zaretskii
2010-08-14 18:49       ` David De La Harpe Golden
2010-08-14 18:54         ` David De La Harpe Golden
2010-08-14 22:23         ` Eli Zaretskii
2010-08-14 22:39           ` David De La Harpe Golden

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=83hbixte8c.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=david@harpegolden.net \
    --cc=emacs-devel@gnu.org \
    --cc=jan.h.d@swipnet.se \
    /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.