all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* face vs. mouse-face text property
@ 2012-01-18 21:34 Michael Heerdegen
  2012-01-19  7:20 ` Chong Yidong
  2012-01-19 12:19 ` Eli Zaretskii
  0 siblings, 2 replies; 21+ messages in thread
From: Michael Heerdegen @ 2012-01-18 21:34 UTC (permalink / raw)
  To: Emacs Development

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.



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

end of thread, other threads:[~2012-01-24 16:49 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-18 21:34 face vs. mouse-face text property Michael Heerdegen
2012-01-19  7:20 ` 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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.