changeset 59026:ef5a485f984f

Implement context-sentitive dual behaviour for mouse-1 click.
author Kim F. Storm <storm@cua.dk>
date Fri, 17 Dec 2004 15:19:33 +0000
parents ad6398d47add
children 4154f5d4733b
files etc/NEWS lisp/ChangeLog lisp/gnus/ChangeLog
diffstat 3 files changed, 78 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Fri Dec 17 15:18:39 2004 +0000
+++ b/etc/NEWS	Fri Dec 17 15:19:33 2004 +0000
@@ -98,6 +98,35 @@
 
 * Changes in Emacs 21.4
 
+** You can now follow links by clicking mouse-1 on the link.
+
+Traditionally, Emacs uses a mouse-1 click to set point and a mouse-2
+click to follow a link, whereas most other applications use a mouse-1
+click for both purposes, depending on whether you click outside or
+inside a link.  With release 21.4, the behaviour of a mouse-1 click
+has been changed to match this context-sentitive dual behaviour.
+
+Depending on the current mode, a mouse-2 click in Emacs may do much
+more than just follow a link, so the new mouse-1 behaviour is only
+activated for modes which explicitly mark a clickable text as a "link"
+(see the new function `mouse-on-link-p' for details).  The lisp
+packages that are included in release 21.4 have been adapted to do
+this, but external packages may not yet support this.  However, there
+is no risk in using such packages, as the worst thing that could
+happen is that you get the original mouse-1 behaviour when you click
+on a link, which typically means that you set point where you click.
+
+If you want to get the original mouse-1 action also inside a link, you
+just need to press the mouse-1 button a little longer than a normal
+click (i.e. press and hold the mouse-1 button for half a second before
+you release it).
+
+Dragging the mouse-1 inside a link still performs the original
+drag-mouse-1 action, typically copy the text.
+
+You can customize the new mouse-1 behaviour via the new user option
+`mouse-1-click-follows-link'.
+
 ** line-move-ignore-invisible now defaults to t.
 
 ** In Outline mode, hide-body no longer hides lines at the top
@@ -2372,6 +2401,10 @@
 
 * Lisp Changes in Emacs 21.4
 
+** Lisp code can now test if a given buffer position is inside a
+clickable link with the new function `mouse-on-link-p'.  This is the
+function used by the new `mouse-1-click-follows-link' functionality.
+
 ** (while-no-input BODY...) runs BODY, but only so long as no input
 arrives.  If the user types or clicks anything, BODY stops as if a
 quit had occurred.  while-no-input returns the value of BODY, if BODY
--- a/lisp/ChangeLog	Fri Dec 17 15:18:39 2004 +0000
+++ b/lisp/ChangeLog	Fri Dec 17 15:19:33 2004 +0000
@@ -1,3 +1,41 @@
+2004-12-17  Kim F. Storm  <storm@cua.dk>
+
+	* mouse.el (mouse-1-click-follows-link): New defcustom.
+	(mouse-on-link-p): New function.
+	(mouse-drag-region-1): Implement mouse-1-click-follows-link
+	functionality.  Map a mouse-1 click event into a mouse-2 (or
+	other) event when position is inside a link.
+
+	* tooltip.el (tooltip-show-help-function): Replace "mouse-2"
+	prefix in tooltip text with "mouse-1" when this is a link
+	recognized by mouse-1-click-follows-link functionality.
+
+	* help.el (describe-key): Report effective and original binding
+	for mouse-1 when clicked on a link.
+	(describe-mode): Add follow-link property to "minor-mode" button.
+
+	* help-fns.el (describe-variable): Add follow-link property to
+	"below" button.
+
+	* help-mode.el (help-xref): Add follow-link property.
+
+	* apropos.el (apropos-symbol, apropos-function, apropos-macro)
+	(apropos-command, apropos-variable, apropos-face, apropos-group)
+	(apropos-widget, apropos-plist): Add follow-link property.
+
+	* pcvs-defs.el (cvs-mode-map): Map follow-link to a function which
+	checks if position is in a filename, rather than some other
+	clickable item.  Function looks for cvs-filename-face at position.
+
+	* wid-edit.el (widget-specify-field, widget-specify-button):
+	Map a :follow-link keyword into a follow-link property.
+	(link): Add :follow-link keyword, map to RET binding.
+
+	* dired.el (dired-mode-map): Map follow-link to mouse-face.
+
+	* progmodes/compile.el (compilation-minor-mode-map)
+	(compilation-button-map, compilation-mode-map): Likewise.
+
 2004-12-17  Thien-Thi Nguyen  <ttn@gnu.org>
 
 	* play/zone.el (zone): Init `line-spacing' from orig buffer.
--- a/lisp/gnus/ChangeLog	Fri Dec 17 15:18:39 2004 +0000
+++ b/lisp/gnus/ChangeLog	Fri Dec 17 15:19:33 2004 +0000
@@ -1,3 +1,9 @@
+2004-12-17  Kim F. Storm  <storm@cua.dk>
+
+	* gnus-group.el (gnus-group-mode-map): Map follow-link to mouse-face.
+
+	* gnus-sum.el (gnus-summary-mode-map): Likewise.
+
 2004-12-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* gnus-art.el (gnus-narrow-to-page): Don't hardcode point-min.
@@ -905,7 +911,7 @@
 	* gnus-delay.el (gnus-delay-default-hour): Add :version.
 
 	* gnus-cite.el (gnus-cite-blank-line-after-header)
-	(gnus-article-boring-faces): 
+	(gnus-article-boring-faces):
 
 	* gnus-art.el (gnus-buttonized-mime-types)
 	(gnus-inhibit-mime-unbuttonizing)