🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.epoch.misc
Article #736

double/triple clicks

#736
From: Maxim Markevitch
Date: Wed, 13 Apr 1994 15:29
50 lines
2285 bytes

nobody writes to gnu.epoch.misc anymore... 

in the version of motion.el from gerdh@ims.com (Gerd Hoeren) on 9 Jul 1993 which supported selection
of word/line by multiple clicks, a point and a mark were not put around the selected region, 
so one couldn't for example delete that selected piece. adding (exchange-point-and-mark) to these 2
functions from the package fixes that: 


(defun mouse-select-word (arg)
  "Select the word around the mouse cursor."
  (let (b)
    (mouse::set-point arg)
    (setq mouse::downp t)
    (forward-char 1)
    (forward-word -1)
    (setq b (point))
    (forward-word 1)
    (mouse-set-drag-position b (point) (current-buffer))
    (end-mouse-drag arg)
    ;; Leave cursor at start of word.
    ;(forward-word -1) ;; MM: instead of this, do exchange-point-and-mark:
    (exchange-point-and-mark)
    (what-cursor-coordinates)))

(defun mouse-select-line (arg)
  "Select the entire line around the mouse cursor."
  (let (b)
    (mouse::set-point arg)
    (setq mouse::downp t)
    (beginning-of-line 1)
    (setq b (point))
    (beginning-of-line 2)
    (if (and mouse-show-position (not (eq (nth 2 arg) (minibuffer-window))))
      (message "Marked 1 line (%d characters)" (- (point) b)))
    (mouse-set-drag-position b (point) (current-buffer))
    (end-mouse-drag arg)
    ;; Leave cursor at start of line.
    ;(forward-line -1) ;; MM: instead of this, do exchange-point-and-mark:
    (exchange-point-and-mark)
))



(I'm sorry if it's something which has already been fixed.)
-- 

Maxim Markevitch            
maxim@head-cfa.harvard.edu
Technical Details
Message-ID: <Co7F0u.4q9@cfanews.harvard.edu>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!qns1.qns.com!constellation!convex!convex!cs.utexas.edu!newsfeed.rice.edu!hsdndev!cfanews!maxim

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc7ee,d0c68b8bf48efcd3,start
X-Google-Attributes: gidfc7ee,public
X-Google-ArrivalTime: 1994-04-13 09:16:54 PST
Newsgroups: gnu.epoch.misc
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!qns1.qns.com!constellation!convex!convex!cs.utexas.edu!newsfeed.rice.edu!hsdndev!cfanews!maxim
From: maxim@head-cfa.harvard.edu (Maxim Markevitch)
Subject: double/triple clicks
Message-ID: <Co7F0u.4q9@cfanews.harvard.edu>
Originator: maxim@cfa208.harvard.edu
Sender: news@cfanews.harvard.edu
Organization: Smithsonian Astrophysical Observatory, Cambridge, MA,  USA
Date: Wed, 13 Apr 1994 15:29:17 GMT
Lines: 51