aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-01-13 19:59:22 +0000
committerRichard M. Stallman2005-01-13 19:59:22 +0000
commitcf819102fc70595984c96c4e3c0dcaa0c4402cc4 (patch)
tree2e8acc200d2f3946015b8d00c531018766f231cf
parentd43f4539cc450f6cd13a9c7318fe9bece41ae5da (diff)
downloademacs-cf819102fc70595984c96c4e3c0dcaa0c4402cc4.tar.gz
emacs-cf819102fc70595984c96c4e3c0dcaa0c4402cc4.zip
(Links and Mouse-1): Clarify text.
-rw-r--r--lispref/text.texi57
1 files changed, 27 insertions, 30 deletions
diff --git a/lispref/text.texi b/lispref/text.texi
index 9807fda05dd..970b8f0eec1 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -3403,29 +3403,29 @@ customize this behaviour through the variable
3403@code{mouse-1-click-follows-link}. 3403@code{mouse-1-click-follows-link}.
3404 3404
3405 To define text as a link at the Lisp level, you should bind the 3405 To define text as a link at the Lisp level, you should bind the
3406@code{mouse-2} event to a command to follow the link. Then, to 3406@code{mouse-2} event to a command to follow the link. Then, to indicate that
3407indicate that @key{Mouse-1} should also follow the link, here is what 3407@key{Mouse-1} should also follow the link, you should specify a
3408you do: 3408@code{follow-link} condition either as a text property or as a key
3409binding:
3409 3410
3410@table @asis 3411@table @asis
3411@item @code{follow-link} property 3412@item @code{follow-link} property
3412If the clickable text has a non-@code{nil} @code{follow-link} text or overlay 3413If the clickable text has a non-@code{nil} @code{follow-link} text or overlay
3413property, the value of that property determines what to do. 3414property, that specifies the condition.
3414 3415
3415@item @code{follow-link} event 3416@item @code{follow-link} event
3416If there is a binding for the @code{follow-link} event, either on 3417If there is a binding for the @code{follow-link} event, either on the
3417the clickable text or in the local keymap, the binding of that event 3418clickable text or in the local keymap, the binding is the condition.
3418determines whether the mouse click position is inside a link.
3419@end table 3419@end table
3420 3420
3421 Regardless of where the @code{follow-link} value comes from, that 3421 Regardless of how you set the @code{follow-link} condition, its
3422value is used according to the following table to determine whether 3422value is used as follows to determine whether the given position is
3423the given position is inside a link, and (if so) to compute an 3423inside a link, and (if so) to compute an @dfn{action code} saying how
3424@dfn{action code} saying how @key{Mouse-1} should handle the link. 3424@key{Mouse-1} should handle the link.
3425 3425
3426@table @asis 3426@table @asis
3427@item @code{mouse-face} 3427@item @code{mouse-face}
3428If the value is @code{mouse-face}, a position is inside a link if 3428If the condition is @code{mouse-face}, a position is inside a link if
3429there is a non-@code{nil} @code{mouse-face} property at that position. 3429there is a non-@code{nil} @code{mouse-face} property at that position.
3430The action code is always @code{t}. 3430The action code is always @code{t}.
3431 3431
@@ -3436,10 +3436,10 @@ For example, here is how Info mode handles @key{Mouse-1}:
3436@end example 3436@end example
3437 3437
3438@item a function 3438@item a function
3439If the value is a function, @var{func}, then a position @var{pos} is 3439If the condition is a valid function, @var{func}, then a position
3440inside a link if @code{(@var{func} @var{pos})} evaluates to 3440@var{pos} is inside a link if @code{(@var{func} @var{pos})} evaluates
3441non-@code{nil}. The value returned by @var{func} serves as the action 3441to non-@code{nil}. The value returned by @var{func} serves as the
3442code. 3442action code.
3443 3443
3444For example, here is how pcvs enables @key{Mouse-1} to follow links on 3444For example, here is how pcvs enables @key{Mouse-1} to follow links on
3445file names only: 3445file names only:
@@ -3451,26 +3451,23 @@ file names only:
3451@end example 3451@end example
3452 3452
3453@item anything else 3453@item anything else
3454If the value is anything else, it is the action code. 3454If the condition value is anything else, then the position is inside a
3455link and the condition itself is the action code. Clearly you should
3456only specify this kind of condition on the text that constitutes a
3457link.
3455@end table 3458@end table
3456 3459
3457@noindent 3460@noindent
3458Here's how the action code determines what @key{Mouse-1} should do: 3461The action code tells @key{Mouse-1} how to follow the link:
3459 3462
3460@table @asis 3463@table @asis
3461@item a string 3464@item a string
3462If the action code is a string, the @key{Mouse-1} event is translated 3465If the action code is a string or vector, the @key{Mouse-1} event is
3463into the first character of the string, i.e., the action of the 3466translated into the first element of the string or vector; i.e., the
3464@key{Mouse-1} click is the local or global binding of that character. 3467action of the @key{Mouse-1} click is the local or global binding of
3465Thus, if the action code is @code{"foo"}, @key{Mouse-1} translates 3468that character. Thus, if the action code is @code{"foo"},
3466into @kbd{f}. 3469@key{Mouse-1} translates into @kbd{f}. If it is @code{[foo]},
3467 3470@key{Mouse-1} translates into @key{foo}.
3468@item a vector
3469If the action code is is a vector, the @key{Mouse-1} event is
3470translated into the first element of that vector, i.e,. the action of
3471the @key{Mouse-1} click is the local or global binding of that event.
3472Thus, if the action code is @code{[?f ?o ?o]}, @key{Mouse-1}
3473translates into @kbd{f}.
3474 3471
3475@item anything else 3472@item anything else
3476For any other non-@code{nil} action code, the @code{mouse-1} event is 3473For any other non-@code{nil} action code, the @code{mouse-1} event is