GNU bug report logs -
#26725
patch for mouse.el
Previous Next
Full log
Message #34 received at 26725-done <at> debbugs.gnu.org (full text, mbox):
> Date: Fri, 19 May 2017 11:07:43 +0900 (JST)
> Cc: 26725 <at> debbugs.gnu.org, tkk <at> misasa.okayama-u.ac.jp,
> tkk <at> misasa.okayama-u.ac.jp
> From: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
>
> Thank you for the comments.
>
> * English
>
> I revised English as suggested.
>
>
> * Algorithm in detection of clicking region
>
> >> +(defun mouse-on-region-p (position &optional start end)
> >> + "Return if POSITION is in between START and END in the current buffer.
> >> +When START and END are nil but there is active region, those of
> >> +active region is fed."
> >> + (when (region-active-p)
> >> + (setq start (or start (region-beginning)))
> >> + (setq end (or end (region-end))))
> >> + (let ((point (posn-point position)))
> >> + (and
> >> + (numberp start)
> >> + (numberp end)
> >> + (numberp point)
> >> + (<= start point)
> >> + (<= point end))))
> >
> > This algorithm will fail with bidirectional text, where buffer
> > positions don't increase monotonically with screen coordinates. How
> > about testing the face of the character under mouse instead?
>
> I revised the code using following statements. Accordingly,
> `mouse-on-region-p' is deleted.
>
> (equal (mouse-posn-property (event-end event) 'face) 'region)
> (member 'secondary-selection(mapcar (lambda (xxx) (overlay-get xxx 'face))
> (overlays-at (posn-point (event-end event)))))
>
>
> * Name of function
>
> >> +(defun mouse-drag-region-pasting (event)
> >
> > The function's name is confusing. Why not name it like the defcustom?
>
> I changed the name from `mouse-drag-region-pasting' to
> `mouse-drag-and-drop-region'. As a consequence, variable and function
> have the same name. I suppose it is OK.
>
>
> * NEWS, ChangeLog, and Info
>
> > Please add a NEWS entry and some minimal documentation in the user
> > manual.
>
> I add ChangeLog, NEWS, and Info as shown below.
>
>
> * Copy on Drag and Drop with meta key pressed
>
> I found that sometimes I want to copy on drop (instead of cut) even
> when source buffer and destination buffer are the same.
>
> I added a logic to let me do so. When modifier key is pressed on
> drop, the function does not delete the original region.
>
> The modifier key is specified by the variable
> `mouse-drag-and-drop-region' that is used as flag. I did not create a
> new variable.
Thanks, pushed to master.
This bug report was last modified 8 years and 56 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.