0

I am using the crafted-emacs from SystemCrafters and have found it great for getting a feel for elisp and emacs management.

One issue I do have is that for some reason, my cursor has kind of got 'sticky'. By this I mean that if I click in a buffer then click somewhere else, the area between those two click gets highlighted. The only way I can get out of this is to click exactly where the cursor is.

As far as I know, I don't have anything like transient-mark-mode active so I'm at a loss. Does anyone here know:

  • how might I have caused this?
  • how might I stop this from happening?
Drew
  • 75,699
  • 9
  • 109
  • 225
  • Please show the related configuration and clarify how you click (left or right button of your mouse, or the wheel). – shynur Jul 19 '23 at 09:05
  • 1
    "As far as I know, I don't have anything like transient-mark-mode active" -- that is enabled by default... I would think you'd know with more certainty if you've disabled it? – phils Jul 19 '23 at 09:14
  • Maybe you have changed the settings for mouse behavior to make it left-handed? I.e you *think* you are clicking ``, but maybe you are really clicking ``. See the answer below. – NickD Jul 19 '23 at 19:13

2 Answers2

2

If you’re clicking with the right mouse button (aka mouse3), then this is the default behavior. See chapter 22.1 Mouse Commands for Editing in the Emacs manual, where it says:

‘mouse-3’
     If the region is active, move the nearer end of the region to the
     click position; otherwise, set mark at the current value of point
     and point at the click position.  Save the resulting region in the
     kill ring; on a second click, kill it (‘mouse-save-then-kill’).
db48x
  • 15,741
  • 1
  • 19
  • 23
  • Hi @db48x , This was a good idea - although it turned out to be not exactly mouse-3 related, you were right about it being related to 'set mark'. I've now gone head first into mouse event configuration on a mode by mode basis. So many possibilities!! – simon.watson.sjw Jul 21 '23 at 07:48
0

Thanks everyone for your thoughts!

I did some investigations yesterday and it appears to be a problem that I am 'setting the mark' by clicking on a spot on the screen and moving the cursor a little.

In more detail - it seems that this happens more readily when the mouse is beyond the last character on a line. If I have the mouse over characters but away from the cursor, it seems that the drag event is less prone to triggering. I don't quite understand this because I don't think the drag event is related to the state of the buffer directly under where the drag occurs. I suspect this has become more noticeable to me recently as I've now started actively managing my init file and cleaning up what happens when a buffer takes on a mode. In particular, by cleaning up my prog-mode settings, I think I now have some whitespace cleaning going on that wasn't previously. I suspect the fact that I have less space characters at the end of my lines is what has brought the issue to prominence.

I think the solution is for me to disable the drag to mark feature unless it is done with a 'hot key' depressed. Interesting take away for me - the issue was caused by the fact that my settings are getting more organized so things are working rather than because something had stopped working. Once I have set that up, I'll update this post for future generations!

Drew
  • 75,699
  • 9
  • 109
  • 225