From: Michael Heerdegen <michael_heerdegen@web.de>
To: Emacs Development <emacs-devel@gnu.org>
Subject: face vs. mouse-face text property
Date: Wed, 18 Jan 2012 22:34:32 +0100 [thread overview]
Message-ID: <87pqegeluf.fsf@web.de> (raw)
Hello,
I recognized that the area highlighted when using a mouse-face is
different from that when using the face text property when the
propertized string includes newlines. For example, try that:
(with-current-buffer (generate-new-buffer "test")
(pop-to-buffer (current-buffer))
(let ((o1 (make-overlay (point) (progn (insert "\n\n") (point)))))
(overlay-put o1 'face 'highlight))
(insert "\n--\n")
(let ((o2 (make-overlay (point) (progn (insert "\n\n") (point)))))
(overlay-put o2 'mouse-face 'highlight)))
While the first overlay is visible, you see nothing at all when you move
the mouse over the second overlay. If you try this:
(with-current-buffer (generate-new-buffer "test")
(pop-to-buffer (current-buffer))
(let ((o1 (make-overlay (point) (progn (insert "\ntext\n") (point)))))
(overlay-put o1 'face 'highlight))
(insert "\n--\n")
(let ((o2 (make-overlay (point) (progn (insert "\ntext\n") (point)))))
(overlay-put o2 'mouse-face 'highlight)))
the first newline in the second overlay gets highlighted when you move
the mouse over it, but not the second newline char.
My question is: is this a bug, or intended behavior? If it is intended,
why, and is there a way to get the mouse highlighting nevertheless work
or to override the default behavior? In my scenario, it is important
that the mouse-face works also for strings consisting of newlines, to
indicate that it's clickable text.
Thanks,
Michael.
next reply other threads:[~2012-01-18 21:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-18 21:34 Michael Heerdegen [this message]
2012-01-19 7:20 ` face vs. mouse-face text property Chong Yidong
2012-01-19 12:19 ` Eli Zaretskii
2012-01-20 20:18 ` Michael Heerdegen
2012-01-21 10:09 ` Eli Zaretskii
2012-01-22 22:21 ` Michael Heerdegen
2012-01-23 6:48 ` Eli Zaretskii
2012-01-23 14:27 ` Stefan Monnier
2012-01-23 14:43 ` Lennart Borgman
2012-01-23 15:34 ` Stefan Monnier
2012-01-23 15:40 ` Lennart Borgman
2012-01-23 18:47 ` chad
2012-01-23 20:44 ` Eli Zaretskii
2012-01-23 21:09 ` chad
2012-01-24 3:48 ` Eli Zaretskii
2012-01-24 5:55 ` Eli Zaretskii
2012-01-24 7:04 ` chad
2012-01-24 9:11 ` Eli Zaretskii
2012-01-24 11:14 ` chad
2012-01-24 15:01 ` Stefan Monnier
2012-01-24 16:49 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pqegeluf.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).