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

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

Re: select text without moving the point in graphical interface


From: Bob Proulx
Subject: Re: select text without moving the point in graphical interface
Date: Sun, 8 Dec 2013 18:53:13 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

Drew Adams wrote:
> Ernest Adrogué wrote:
> > one of the things I like about running emacs in a terminal is that I
> > can select text without moving the point; is it possible to do the
> > same when running in a graphical interface (GTK)?

I also dearly would like to have this behavior too.  For pasting there
is of course the mouse-middle button.  And with mouse-yank-at-point it
will paste at the point just like in a raw terminal.

  (setq mouse-yank-at-point t)

But that is only the paste half.  The cut half is still missing.

> > Sorry, I wasn't specific enough. I meant selecting text using the mouse.
> >
> > In a terminal, the mouse is independent from emacs and it doesn't interfere
> > with it in any perceivable way, except when I paste something with a middle
> > click.  I think it's the terminal program, and not emacs, who handles the
> > mouse inputs.
> 
> Yes.  The relevant doc is (emacs) `Text-Only Mouse', which explains
> that only some text terminals support mouse clicks.

That is the opposite case.  That covers adding mouse support to a text
terminal.  (Personally I would never want that.  Blech!  But each to
their own.)

The question being asked is to have the graphics terminal behave such
that cutting with the mouse does not move the point.

> > In a GUI, it doesn't work the same way - as soon as I click anywhere the
> > point moves to that location.  I was wondering if tweaking some options I
> > could make GUI emacs behave more or less like when it runs inside a
> > terminal.  For example, to be able to select text (using the X cursor)
> > without moving emacs's point in the process.
> 
> Mouse selection in GUI Emacs is specifically for setting the region
> to the selected text.  So no, to have `mouse-1' not set point you
> would need to redefine a fair number of things.

It is a shame that there isn't some way to create a replacement for
mouse-drag-region that does a save-excursion so that it can cut the
text and then return the point to the previous position when done.  I
have wanted that behavior for years.

> In terminal mode, Emacs does not even recognize the mouse, in the
> sense that if you do `C-h k' and then click or drag the mouse, that
> action is unrecognized.

In terminal mode everything always works "correctly".  :-)  The desire
would be to have the gui mode work the same.

Bob



reply via email to

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