* lispref/text.texi node "Clickable Text"
@ 2006-07-24 7:10 Thien-Thi Nguyen
2006-07-24 7:22 ` Thien-Thi Nguyen
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Thien-Thi Nguyen @ 2006-07-24 7:10 UTC (permalink / raw)
the examples from dired.el are out of date; dired.el has been
modified in the meantime to handle the `help-echo' text
property, and to handle events that move out of the selected
window.
apart from the examples, the documentation is mostly accurate
(see below). we can either (a) leave it alone; or (b) update
the examples and their associated blurbs (mention `help-echo',
etc).
if (b), i will propose a patch. is (b) ok?
wrt to "mostly accurate", i don't understand where the "two
ways" in the first sentence of the node is expanded. i see only
one way (that has two parts). what is the other way?
thi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lispref/text.texi node "Clickable Text"
2006-07-24 7:10 lispref/text.texi node "Clickable Text" Thien-Thi Nguyen
@ 2006-07-24 7:22 ` Thien-Thi Nguyen
2006-07-24 18:22 ` Richard Stallman
2006-07-25 3:09 ` Richard Stallman
2 siblings, 0 replies; 5+ messages in thread
From: Thien-Thi Nguyen @ 2006-07-24 7:22 UTC (permalink / raw)
Thien-Thi Nguyen <ttn@gnu.org> writes:
> wrt to "mostly accurate", i don't understand where the "two
> ways" in the first sentence of the node is expanded. i see only
> one way (that has two parts). what is the other way?
oops, spoke too soon. please ignore this question. i see now at
the end of the node the keybinding method for defining clickable
text.
thi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lispref/text.texi node "Clickable Text"
2006-07-24 7:10 lispref/text.texi node "Clickable Text" Thien-Thi Nguyen
2006-07-24 7:22 ` Thien-Thi Nguyen
@ 2006-07-24 18:22 ` Richard Stallman
2006-07-25 3:09 ` Richard Stallman
2 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2006-07-24 18:22 UTC (permalink / raw)
Cc: emacs-devel
apart from the examples, the documentation is mostly accurate
(see below). we can either (a) leave it alone; or (b) update
the examples and their associated blurbs (mention `help-echo',
etc).
if (b), i will propose a patch. is (b) ok?
Please do!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lispref/text.texi node "Clickable Text"
2006-07-24 7:10 lispref/text.texi node "Clickable Text" Thien-Thi Nguyen
2006-07-24 7:22 ` Thien-Thi Nguyen
2006-07-24 18:22 ` Richard Stallman
@ 2006-07-25 3:09 ` Richard Stallman
2006-07-30 19:44 ` Thien-Thi Nguyen
2 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2006-07-25 3:09 UTC (permalink / raw)
Cc: emacs-devel
wrt to "mostly accurate", i don't understand where the "two
ways" in the first sentence of the node is expanded. i see only
one way (that has two parts). what is the other way?
I clarified that text. Please do update the examples.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: lispref/text.texi node "Clickable Text"
2006-07-25 3:09 ` Richard Stallman
@ 2006-07-30 19:44 ` Thien-Thi Nguyen
0 siblings, 0 replies; 5+ messages in thread
From: Thien-Thi Nguyen @ 2006-07-30 19:44 UTC (permalink / raw)
Richard Stallman <rms@gnu.org> writes:
> I clarified that text. Please do update the examples.
following is a patch that updates the examples and their
associated explanations. i also enlarged the concept of the
first step in the first paragraph, which touches upon your
recent clarification, which is why i post it for review.
thi
________________________________________________________
*** text.texi 30 Jul 2006 12:34:23 -0000 1.127
--- text.texi 30 Jul 2006 19:39:44 -0000
***************
*** 3480,3505 ****
@cindex clickable text
There are two parts of setting up @dfn{clickable text} in a buffer:
! (1) to make that text highlight when the mouse moves over it, and (2)
to make a mouse button do something when you click on that text.
! For highlighting, use the @code{mouse-face} text property. Here is
! an example of how Dired does it:
@smallexample
(condition-case nil
(if (dired-move-to-filename)
! (put-text-property (point)
! (save-excursion
! (dired-move-to-end-of-filename)
! (point))
! 'mouse-face 'highlight))
(error nil))
@end smallexample
@noindent
! The first two arguments to @code{put-text-property} specify the
! beginning and end of the text.
The usual way to make the mouse do something when you click it
on this text is to define @code{mouse-2} in the major mode's
--- 3480,3511 ----
@cindex clickable text
There are two parts of setting up @dfn{clickable text} in a buffer:
! (1) to indicate clickability when the mouse moves over the text, and (2)
to make a mouse button do something when you click on that text.
! Indicating clickability usually involves highlighting the text, and
! often involves displaying helpful information about the action, such
! as which mouse button to press, or a short summary of the action.
! This can be done with the @code{mouse-face} and @code{help-echo}
! text properties. @xref{Special Properties}.
! Here is an example of how Dired does it:
@smallexample
(condition-case nil
(if (dired-move-to-filename)
! (add-text-properties
! (point)
! (save-excursion
! (dired-move-to-end-of-filename)
! (point))
! '(mouse-face highlight
! help-echo "mouse-2: visit this file in other window")))
(error nil))
@end smallexample
@noindent
! The first two arguments to @code{add-text-properties} specify the
! beginning and end of the text.
The usual way to make the mouse do something when you click it
on this text is to define @code{mouse-2} in the major mode's
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-07-30 19:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-24 7:10 lispref/text.texi node "Clickable Text" Thien-Thi Nguyen
2006-07-24 7:22 ` Thien-Thi Nguyen
2006-07-24 18:22 ` Richard Stallman
2006-07-25 3:09 ` Richard Stallman
2006-07-30 19:44 ` Thien-Thi Nguyen
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).