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

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

bug#6872: 24.0.50; Mouse-2 pastes the wrong text.


From: Jan Djärv
Subject: bug#6872: 24.0.50; Mouse-2 pastes the wrong text.
Date: Mon, 23 Aug 2010 09:06:09 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2

The patch fixes the bug.

        Jan D.


Chong Yidong skrev 2010-08-23 01.27:
Jan Djärv<jan.h.d@swipnet.se>  writes:

In the first frame, go to *scratch* if not alread there.
C-x 5 2.  In the new frame C-x b tmp
Select the text "This buffer is for notes".
Move mouse to the other frame and press mouse-2.  The text is inserted
as it should.
Double click on "buffer" (in the line that was just inserted) to select
it.
Go back to the frame with *scratch* and press mouse-2.  The selected
word "buffer" is not inserted, but the old selection "This buffer is for
notes".

Could you help test this patch?

*** lisp/mouse.el       2010-08-21 04:46:23 +0000
--- lisp/mouse.el       2010-08-22 23:25:55 +0000
***************
*** 1271,1277 ****
     (when select-active-regions
       ;; Without this, confusing things happen upon e.g. inserting into
       ;; the middle of an active region.
!     (deactivate-mark))
     (or mouse-yank-at-point (mouse-set-point click))
     (let ((primary
         (cond
--- 1271,1278 ----
     (when select-active-regions
       ;; Without this, confusing things happen upon e.g. inserting into
       ;; the middle of an active region.
!     (let ((select-active-regions nil))
!       (deactivate-mark)))
     (or mouse-yank-at-point (mouse-set-point click))
     (let ((primary
         (cond

=== modified file 'src/keyboard.c'
*** src/keyboard.c      2010-08-22 15:14:37 +0000
--- src/keyboard.c      2010-08-22 23:22:34 +0000
***************
*** 368,374 ****
      Used by the `select-active-regions' feature.  */
   Lisp_Object Vsaved_region_selection;

! Lisp_Object Qx_set_selection, QPRIMARY;

   Lisp_Object Qself_insert_command;
   Lisp_Object Qforward_char;
--- 368,374 ----
      Used by the `select-active-regions' feature.  */
   Lisp_Object Vsaved_region_selection;

! Lisp_Object Qx_set_selection, QPRIMARY, Qhandle_switch_frame;

   Lisp_Object Qself_insert_command;
   Lisp_Object Qforward_char;
***************
*** 1799,1808 ****
            {
              /* Even if not deactivating the mark, set PRIMARY if
                 `select-active-regions' is non-nil.  */
!             if (EQ (Vselect_active_regions, Qonly)
!                 ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
!                 : (!NILP (Vselect_active_regions)
!               &&  !NILP (Vtransient_mark_mode)))
                {
                  int beg = XINT (Fmarker_position (current_buffer->mark));
                  int end = XINT (make_number (PT));
--- 1799,1809 ----
            {
              /* Even if not deactivating the mark, set PRIMARY if
                 `select-active-regions' is non-nil.  */
!             if ((EQ (Vselect_active_regions, Qonly)
!                  ? EQ (CAR_SAFE (Vtransient_mark_mode), Qonly)
!                  : (!NILP (Vselect_active_regions)
!               &&  !NILP (Vtransient_mark_mode)))
!               &&  !EQ (Vthis_command, Qhandle_switch_frame))
                {
                  int beg = XINT (Fmarker_position (current_buffer->mark));
                  int end = XINT (make_number (PT));
***************
*** 11725,11730 ****
--- 11726,11733 ----
     staticpro (&Qx_set_selection);
     QPRIMARY = intern_c_string ("PRIMARY");
     staticpro (&QPRIMARY);
+   Qhandle_switch_frame = intern_c_string ("handle-switch-frame");
+   staticpro (&Qhandle_switch_frame);

     Qinput_method_exit_on_first_char = intern_c_string 
("input-method-exit-on-first-char");
     staticpro (&Qinput_method_exit_on_first_char);





reply via email to

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