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: Michael Heerdegen
Subject: Re: select text without moving the point in graphical interface
Date: Tue, 10 Dec 2013 20:13:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Ernest Adrogué <nfdisco@gmail.com> writes:

> I can't get this to work, because I don't have this `advice-add`
> function in my Emacs

Here's the same for the old defadvice:

--8<---------------cut here---------------start------------->8---
(defadvice mouse-drag-region (around test activate)
  (let ((opoint (with-selected-window
                    (posn-window (event-start (ad-get-arg 0)))
                  (point))))
    (prog1 ad-do-it
      (run-with-idle-timer
       0 nil
       (lambda (win pos)
         (with-selected-window win
           (deactivate-mark)
           (goto-char pos)))
       (selected-window)  opoint))))
--8<---------------cut here---------------end--------------->8---

This let's you copy text with the mouse, but disallows to manipulate the
region with the mouse.


Regards,

Michael.




reply via email to

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