all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 8996@debbugs.gnu.org
Subject: bug#8996: Set PRIMARY from last selection, not last selected window
Date: Sat, 24 Mar 2012 19:10:53 +0800	[thread overview]
Message-ID: <87pqc2b6f6.fsf@gnu.org> (raw)
In-Reply-To: <jwv4ntsy76s.fsf-monnier+gnus-read-ephemeral-bug@gnu.org> (Stefan Monnier's message of "Tue, 13 Mar 2012 09:23:01 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Hmm. bug #6872 was addressed by trunk r101176, which suppresses the
>> primary update on handle_switch_frame, but, well, that only covers
>> that immediate frame switch case.  Kinda need to address switching
>> between individual windows too (or actually instead since
>> handle_switch_frame will always wind up calling select_window itself,
>> I think).  However, select-window itself is not a command afaiui, and
>> enumerating all potential window-switching commands is probably not
>> viable.  I can't say I like the attached solution (modelled on the
>> deactivate-mark variable) very much, though nor did I have any
>> especially better ideas.
>
> I think this approach isn't as terrible as it sounds (tho I don't much
> like the name you chose, sorry).  We'd want to let-bind that new var
> in things like save-selected-window, with-selected-window, ... which
> is kind of ugly.
>
> Maybe a better approach is to record the selected window before
> running a command, and only do the select-active-regions dance if the
> command did not change the selected window.

Why not just extend the Bug#6872 approach to handle-select-window too?

=== modified file 'src/keyboard.c'
*** src/keyboard.c	2012-02-24 08:34:09 +0000
--- src/keyboard.c	2012-03-24 11:09:56 +0000
***************
*** 241,246 ****
--- 241,247 ----
  Time last_event_timestamp;
  
  static Lisp_Object Qx_set_selection, Qhandle_switch_frame;
+ static Lisp_Object Qhandle_select_window;
  Lisp_Object QPRIMARY;
  
  static Lisp_Object Qself_insert_command;
***************
*** 1647,1653 ****
  		      ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
  		      : (!NILP (Vselect_active_regions)
  			 && !NILP (Vtransient_mark_mode)))
! 		  && !EQ (Vthis_command, Qhandle_switch_frame))
  		{
  		  EMACS_INT beg =
  		    XINT (Fmarker_position (BVAR (current_buffer, mark)));
--- 1648,1655 ----
  		      ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
  		      : (!NILP (Vselect_active_regions)
  			 && !NILP (Vtransient_mark_mode)))
! 		  && !EQ (Vthis_command, Qhandle_switch_frame)
! 		  && !EQ (Vthis_command, Qhandle_select_window))
  		{
  		  EMACS_INT beg =
  		    XINT (Fmarker_position (BVAR (current_buffer, mark)));
***************
*** 11649,11654 ****
--- 11651,11657 ----
    DEFSYM (Qx_set_selection, "x-set-selection");
    DEFSYM (QPRIMARY, "PRIMARY");
    DEFSYM (Qhandle_switch_frame, "handle-switch-frame");
+   DEFSYM (Qhandle_select_window, "handle-select-window");
  
    DEFSYM (Qinput_method_function, "input-method-function");
    DEFSYM (Qinput_method_exit_on_first_char, "input-method-exit-on-first-char");






  parent reply	other threads:[~2012-03-24 11:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04 17:19 bug#8996: Set PRIMARY from last selection, not last selected window Stefan Monnier
2011-07-04 19:11 ` David De La Harpe Golden
2011-07-04 20:27   ` Chong Yidong
2011-07-05  3:26     ` Stefan Monnier
2011-07-05 10:11       ` David De La Harpe Golden
2011-07-08  5:54       ` David De La Harpe Golden
2011-07-11  2:57         ` David De La Harpe Golden
2012-03-13 13:23           ` Stefan Monnier
2012-03-18 19:18             ` David De La Harpe Golden
2012-03-24 11:10             ` Chong Yidong [this message]
2012-03-25  3:32               ` David De La Harpe Golden
2012-03-25  3:42                 ` Chong Yidong
2012-03-25 13:42                   ` David De La Harpe Golden
2012-03-25 14:20                 ` David De La Harpe Golden
2012-03-26  4:06                   ` Chong Yidong
2012-03-27  0:16                     ` 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=87pqc2b6f6.fsf@gnu.org \
    --to=cyd@gnu.org \
    --cc=8996@debbugs.gnu.org \
    --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.