all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: cyd@stupidchicken.com, 6774@debbugs.gnu.org, angelo.graziosi@alice.it
Subject: bug#6774: Cut and paste with C-w/mouse-2 not working?
Date: Fri, 13 Aug 2010 15:18:03 +0900	[thread overview]
Message-ID: <tl7eie32fz8.fsf@m17n.org> (raw)
In-Reply-To: <jwvvd7fbyv0.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Thu, 12 Aug 2010 18:09:28 +0200)

In article <jwvvd7fbyv0.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> Putting it in set_point_both would be much worse than on
>>> post-command-hook (set-point-both is a very low-level function,
>>> triggered in many more cases than just moving the cursor).
> > If a test to check if we have to newly own the PRIMARY
> > selection is trivial, there should be no problem.

> And what do we do with the result of the check?  This function too
> low-level to be able to perform the "set PRIMARY" from there.

I don't know your criteria for "too low-level".

> > Another candidate for checking that is somewher near here in
> > command_loop_1 () (around line 1818).

> >     finalize:

> >       if (current_buffer == prev_buffer
> > 	  && last_point_position != PT
> > 	  && NILP (Vdisable_point_adjustment)
> > 	  && NILP (Vglobal_disable_point_adjustment))
> > 	{

> > This place is similar to post-command-hook, but we can avoid
> > unnecessary Lisp calls in many cases.

> Yes, that's like post-command-hook.
> I'm more worried about the semantics than about the performance impact.
> Doing the "set PRIMARY" from C-w and friends is much easier and robust.
> Doing it in S-right is OK as well.  Doing it in forward-char is not and
> doing it for `right' (by rebinding it to a new command) doesn't sound
> too attractive.

I was wordering how "S-right" (and S-C-f, etc) are
implemented.  So, I read the code and was surprized by its
complication.  For every S-C-f, read_key_sequence sets
this-command-keys-shift-translated to t and
read_key_sequence_cmd to forward-char.  Next,
Fcall_interactively calls handle-shift-selection, and it
sets transient-mark-mode to a special cons (only . ...).  At
last, command_loop_1, after execuing forward-char, does some
check and eventually calls x-set-selection.  The detail is
more complicated.

I don't claim that the code is too complicated.  Perhaps,
there's no other way; I don't know.

Anyway, we are already doing that for forward-char.  Doing a
little bit more in command_loop_1 (and/or maybe in
Fcall_interactively) shouldn't be a problem.  It doesn't
change the semantics of forward-char (as well as handling of
S-C-f like above doesn't change the semantics).  At least,
command_loop_1 is not "too low-level" for calling
x-set-selection.

And, first of all, from a user point of view, as these two
highlights a region exactly the same way (with the default
setting),
  (1) S-C-n
  (2) C-@ C-n
it's very confusing that they behave differently as to
selection.

---
Kenichi Handa
handa@m17n.org





  parent reply	other threads:[~2010-08-13  6:18 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-01 22:04 bug#6774: Cut and paste with C-w/mouse-2 not working? Angelo Graziosi
2010-08-02  4:12 ` David De La Harpe Golden
     [not found]   ` <4C56C8F0.2010104@alice.it>
2010-08-02 14:52     ` David De La Harpe Golden
2010-08-02 19:41   ` Chong Yidong
2010-08-02 20:30     ` David De La Harpe Golden
2010-08-02 20:33       ` David De La Harpe Golden
2010-08-02 20:53       ` David De La Harpe Golden
2010-08-02 20:59       ` Chong Yidong
2010-08-02 21:35         ` David De La Harpe Golden
2010-08-02 22:26           ` David De La Harpe Golden
2010-08-05  2:20           ` Chong Yidong
2010-08-05 23:50             ` David De La Harpe Golden
2010-08-06  7:43               ` Eli Zaretskii
2010-08-06  9:13                 ` Stefan Monnier
2010-08-06 10:50                   ` Eli Zaretskii
2010-08-06 12:21                     ` Kenichi Handa
2010-08-06 13:17                       ` Jan Djärv
2010-08-06 20:23                         ` David De La Harpe Golden
2010-08-06 20:17                     ` David De La Harpe Golden
2010-08-06 15:28               ` Chong Yidong
2010-08-06 21:05                 ` David De La Harpe Golden
2010-08-07 19:50                   ` Chong Yidong
2010-08-07 23:05                     ` David De La Harpe Golden
2010-08-09  2:55                       ` Chong Yidong
2010-08-09 11:43                         ` Stefan Monnier
2010-08-09 17:19                           ` Jan Djärv
2010-08-10  7:29                             ` Stefan Monnier
2010-08-10 14:01                               ` Jan Djärv
2010-08-10 15:54                                 ` Stefan Monnier
2010-08-10 17:59                                   ` Jan Djärv
2010-08-11  7:46                                     ` Stefan Monnier
2010-08-11 16:06                                       ` Jan Djärv
2010-08-11 20:17                                         ` Stefan Monnier
2010-08-11 21:26                                           ` Jan Djärv
2010-08-11 21:32                                             ` Stefan Monnier
2010-08-12  3:54                                       ` Kenichi Handa
2010-08-12  7:43                                         ` Jan Djärv
2010-08-12  7:51                                           ` Kenichi Handa
2010-08-12  8:29                                         ` Stefan Monnier
2010-08-12 12:14                                           ` Kenichi Handa
2010-08-12 16:09                                             ` Stefan Monnier
2010-08-12 17:11                                               ` Jan Djärv
2010-08-13 10:38                                                 ` Stefan Monnier
2010-08-13 11:29                                                   ` Eli Zaretskii
2010-08-13  6:18                                               ` Kenichi Handa [this message]
2010-08-13 10:40                                                 ` Stefan Monnier
2010-08-16  8:16                                                   ` Kenichi Handa
2010-08-16  8:51                                                     ` Jan Djärv
2010-08-17  1:44                                                       ` Kenichi Handa
2010-08-17  5:52                                                         ` Jan Djärv
2010-08-17  7:17                                                           ` Eli Zaretskii
2010-08-17  8:24                                                             ` Jan Djärv
2010-08-17 10:26                                                               ` Eli Zaretskii
2010-08-17 11:43                                                           ` Kenichi Handa
2010-08-17 12:14                                                             ` Stefan Monnier
2010-08-17 12:57                                                               ` Kenichi Handa
2010-08-18  7:24                                                                 ` Stefan Monnier
2010-08-17 20:59                                                               ` David De La Harpe Golden
2010-08-18  7:25                                                                 ` Stefan Monnier
2010-08-07 23:08                     ` Angelo Graziosi
     [not found]       ` <mailman.23.1280783288.5118.bug-gnu-emacs@gnu.org>
2010-08-03 14:34         ` Miles Bader
2010-08-03 15:15           ` David De La Harpe Golden
2010-08-03 15:31             ` Miles Bader
2010-08-03 15:45               ` David De La Harpe Golden
2010-08-03 16:02                 ` Miles Bader
2010-08-04 18:02                   ` Stefan Monnier
2010-08-04 18:25                     ` Drew Adams
2010-08-04 21:10                       ` David De La Harpe Golden
2010-08-04 21:36                         ` Drew Adams
2010-08-05  0:17                           ` Chong Yidong
2010-08-05  0:24                             ` Drew Adams
2010-08-05  0:33                               ` Chong Yidong
2010-08-05  0:40                                 ` Drew Adams
2010-08-02 13:33 ` Angelo Graziosi

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=tl7eie32fz8.fsf@m17n.org \
    --to=handa@m17n.org \
    --cc=6774@debbugs.gnu.org \
    --cc=angelo.graziosi@alice.it \
    --cc=cyd@stupidchicken.com \
    --cc=monnier@iro.umontreal.ca \
    /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.