unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25784: 25.2; mouse-1 binding in debbugs-gnu.el
@ 2017-02-18 11:20 Charles A. Roelli
  2017-02-18 13:43 ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Charles A. Roelli @ 2017-02-18 11:20 UTC (permalink / raw)
  To: 25784

`mouse-1' is bound in debbugs-gnu.el, which means that a nil value of
`mouse-1-click-follows-link' is not respected.  The following patch is
needed:

--- debbugs-0.12/debbugs-gnu.el.~2~     2017-02-17 17:54:15.000000000 +0100
+++ debbugs-0.12/debbugs-gnu.el        	2017-02-18 12:07:56.000000000 +0100
@@ -909,7 +909,6 @@
 	(menu-map (make-sparse-keymap)))
     (set-keymap-parent map tabulated-list-mode-map)
     (define-key map "\r" 'debbugs-gnu-select-report)
-    (define-key map [mouse-1] 'debbugs-gnu-select-report)
     (define-key map [mouse-2] 'debbugs-gnu-select-report)
     (define-key map "g" 'debbugs-gnu-rescan)
     (define-key map "R" 'debbugs-gnu-show-all-blocking-reports)
@@ -1587,7 +1586,6 @@
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map tabulated-list-mode-map)
     (define-key map "\r" 'debbugs-gnu-select-usertag)
-    (define-key map [mouse-1] 'debbugs-gnu-select-usertag)
     (define-key map [mouse-2] 'debbugs-gnu-select-usertag)
     map))

There already was a ChangeLog entry to this effect in the past:

2012-12-23  Lars Ingebrigtsen  <larsi@gnus.org>

	Don't explicitly bind mouse-1.

	As Michael Heerdegen <michael_heerdegen@web.de> says:

	However, also binding mouse-1 is not necessary.	 Depending on the 
	setting of `mouse-1-click-follows-link', which is non-nil by default, 
	mouse-1 already follows links - see its doc.  We should leave it up to 
	the user if he wants to use mouse-1 for following or not.

But the change does not seem to have been made, or maybe it was reverted
at some point.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#25784: 25.2; mouse-1 binding in debbugs-gnu.el
  2017-02-18 11:20 bug#25784: 25.2; mouse-1 binding in debbugs-gnu.el Charles A. Roelli
@ 2017-02-18 13:43 ` Andreas Schwab
  2017-02-19 11:22   ` Charles A. Roelli
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2017-02-18 13:43 UTC (permalink / raw)
  To: Charles A. Roelli; +Cc: 25784

On Feb 18 2017, charles@aurox.ch (Charles A. Roelli) wrote:

> There already was a ChangeLog entry to this effect in the past:
>
> 2012-12-23  Lars Ingebrigtsen  <larsi@gnus.org>
>
> 	Don't explicitly bind mouse-1.
>
> 	As Michael Heerdegen <michael_heerdegen@web.de> says:
>
> 	However, also binding mouse-1 is not necessary.	 Depending on the 
> 	setting of `mouse-1-click-follows-link', which is non-nil by default, 
> 	mouse-1 already follows links - see its doc.  We should leave it up to 
> 	the user if he wants to use mouse-1 for following or not.
>
> But the change does not seem to have been made, or maybe it was reverted
> at some point.

This commit only changed debbugs-gnu-widget-map, not the other
occurrences.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#25784: 25.2; mouse-1 binding in debbugs-gnu.el
  2017-02-18 13:43 ` Andreas Schwab
@ 2017-02-19 11:22   ` Charles A. Roelli
  2017-02-20  8:16     ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Charles A. Roelli @ 2017-02-19 11:22 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 25784

On Sat, Feb 18 2017 at 02:43:49 pm, Andreas Schwab wrote:

> This commit only changed debbugs-gnu-widget-map, not the other
> occurrences.

Thanks for pointing that out.  The other occurrences should be changed
too.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#25784: 25.2; mouse-1 binding in debbugs-gnu.el
  2017-02-19 11:22   ` Charles A. Roelli
@ 2017-02-20  8:16     ` Michael Albinus
  2017-02-20  8:55       ` Charles A. Roelli
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Albinus @ 2017-02-20  8:16 UTC (permalink / raw)
  To: Charles A. Roelli; +Cc: Andreas Schwab, 25784-done

charles@aurox.ch (Charles A. Roelli) writes:

Hi Charles,

>> This commit only changed debbugs-gnu-widget-map, not the other
>> occurrences.
>
> Thanks for pointing that out.  The other occurrences should be changed
> too.

I've applied your patch, extended to the other occurences. debbugs
version is increased to 0.14, shall appear soon.

Thanks for your report, and best regards, Michael.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#25784: 25.2; mouse-1 binding in debbugs-gnu.el
  2017-02-20  8:16     ` Michael Albinus
@ 2017-02-20  8:55       ` Charles A. Roelli
  2017-02-20 12:32         ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Charles A. Roelli @ 2017-02-20  8:55 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Andreas Schwab, 25784-done

Thanks for looking into this, Michael.  I realize now that this change
only makes sense if mouse-2 sets point when clicked, as it does in Gnus.
I think what follows is the correct way to do it, and it works as
expected.

--- debbugs-0.12/debbugs-gnu.el.~1~	2016-10-31 22:02:05.000000000 +0100
+++ debbugs-0.12/debbugs-gnu.el	2017-02-19 12:56:02.000000000 +0100
@@ -909,7 +909,6 @@
 	(menu-map (make-sparse-keymap)))
     (set-keymap-parent map tabulated-list-mode-map)
     (define-key map "\r" 'debbugs-gnu-select-report)
-    (define-key map [mouse-1] 'debbugs-gnu-select-report)
     (define-key map [mouse-2] 'debbugs-gnu-select-report)
     (define-key map "g" 'debbugs-gnu-rescan)
     (define-key map "R" 'debbugs-gnu-show-all-blocking-reports)
@@ -1347,9 +1346,10 @@
 	 (format "Re: bug#%d: %s" id (cdr (assq 'subject status))))
     (debbugs-gnu-summary-mode 1)))
 
-(defun debbugs-gnu-select-report ()
+(defun debbugs-gnu-select-report (&optional event)
   "Select the report on the current line."
-  (interactive)
+  (interactive "e")
+  (when event (mouse-set-point event))
   ;; We open the report messages.
   (let* ((status (debbugs-gnu-current-status))
 	 (id (cdr (assq 'id status)))
@@ -1587,7 +1587,6 @@
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map tabulated-list-mode-map)
     (define-key map "\r" 'debbugs-gnu-select-usertag)
-    (define-key map [mouse-1] 'debbugs-gnu-select-usertag)
     (define-key map [mouse-2] 'debbugs-gnu-select-usertag)
     map))
 
@@ -1665,9 +1664,10 @@
 	(set-buffer-modified-p nil)
 	(goto-char (point-min)))))
 
-(defun debbugs-gnu-select-usertag ()
+(defun debbugs-gnu-select-usertag (&optional event)
   "Select the user tag on the current line."
-  (interactive)
+  (interactive "e")
+  (when event (mouse-set-point event))
   ;; We open the bug reports.
   (let ((args (get-text-property (line-beginning-position) 'tabulated-list-id)))
     (when args (apply 'debbugs-gnu args))))





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#25784: 25.2; mouse-1 binding in debbugs-gnu.el
  2017-02-20  8:55       ` Charles A. Roelli
@ 2017-02-20 12:32         ` Michael Albinus
  2017-02-20 19:40           ` Charles A. Roelli
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Albinus @ 2017-02-20 12:32 UTC (permalink / raw)
  To: Charles A. Roelli; +Cc: Andreas Schwab, 25784-done

charles@aurox.ch (Charles A. Roelli) writes:

Hi Charles,

> I realize now that this change only makes sense if mouse-2 sets point
> when clicked, as it does in Gnus.

Good catch!

> I think what follows is the correct way to do it, and it works as
> expected.

This patch works for using the mouse, but there are problems when you
enter a bug report via RET or menu <Debbugs> -> <Show Reports>.

I've applied the following patch to the repository:

--8<---------------cut here---------------start------------->8---
diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el
index f814642..eb94679 100644
--- a/packages/debbugs/debbugs-gnu.el
+++ b/packages/debbugs/debbugs-gnu.el
@@ -1350,6 +1350,7 @@ MERGED is the list of bugs merged with this one."
 (defun debbugs-gnu-select-report ()
   "Select the report on the current line."
   (interactive)
+  (when (mouse-event-p last-input-event) (mouse-set-point last-input-event))
   ;; We open the report messages.
   (let* ((status (debbugs-gnu-current-status))
 	 (id (cdr (assq 'id status)))
@@ -1673,6 +1674,7 @@ The following commands are available:
 (defun debbugs-gnu-select-usertag ()
   "Select the user tag on the current line."
   (interactive)
+  (when (mouse-event-p last-input-event) (mouse-set-point last-input-event))
   ;; We open the bug reports.
   (let ((args (get-text-property (line-beginning-position) 'tabulated-list-id)))
     (when args (apply 'debbugs-gnu args))))
--8<---------------cut here---------------end--------------->8---

Will appear with the next debbugs version 0.15. I've not decided yet,
when to release.

Best regards, Michael.





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#25784: 25.2; mouse-1 binding in debbugs-gnu.el
  2017-02-20 12:32         ` Michael Albinus
@ 2017-02-20 19:40           ` Charles A. Roelli
  0 siblings, 0 replies; 7+ messages in thread
From: Charles A. Roelli @ 2017-02-20 19:40 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Andreas Schwab, 25784-done

Thanks Michael, this looks good to me.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-02-20 19:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-18 11:20 bug#25784: 25.2; mouse-1 binding in debbugs-gnu.el Charles A. Roelli
2017-02-18 13:43 ` Andreas Schwab
2017-02-19 11:22   ` Charles A. Roelli
2017-02-20  8:16     ` Michael Albinus
2017-02-20  8:55       ` Charles A. Roelli
2017-02-20 12:32         ` Michael Albinus
2017-02-20 19:40           ` Charles A. Roelli

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).