all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: darthandrus@gmail.com, 11068@debbugs.gnu.org
Subject: bug#11068: 24.0.94; Face-remapped background does not extend to end of window
Date: Fri, 30 Mar 2012 09:35:20 +0200	[thread overview]
Message-ID: <4F756238.1080004@gmx.at> (raw)
In-Reply-To: <E1SCbJe-0003vP-7I@fencepost.gnu.org>

 > ... By putting the
 > integer property on the string itself, you allow the
 > cursor-positioning code to find out how many buffer positions are
 > covered by the overlay string, without knowing what overlay is that.
 >
 >>       "this way,
 >>       Emacs will display the cursor on the character with that property
 >>       regardless of whether the current buffer position is actually
 >>       covered by the overlay."
 >>
 >> doesn't make it clearer for me because what is "the character with that
 >> property" and what is "the current buffer position" here?
 >
 > "the character" is the one from the overlay string on which you put
 > the `cursor' property; "current buffer position" is point (which
 > normally determines where to display the cursor).

I still don't get it.  Suppose I have the following code in a buffer, no
spaces before the first visible character, one newline after the last:


(defvar my-overlay nil)
(defvar my-string nil)

(progn
   (when (overlayp my-overlay)
     (delete-overlay my-overlay))
   (setq my-overlay (make-overlay 0 0))
   (setq my-string
	(propertize "      " 'face 'lazy-highlight 'cursor 1))
   (overlay-put my-overlay 'display my-string)
   (move-overlay my-overlay (- (point-max) 1) (point-max)))


Evaluating this and moving `point' between buffer positions 336 and 337
oscillates the cursor around the overlay.  If I instead use the line

	(propertize "      " 'face 'lazy-highlight 'cursor 2))

in the above and reevaluate, moving `point' doesn't oscillate the cursor
any more.  But if I additionally replace the last line as

   (move-overlay my-overlay (- (point-max) 2) (point-max)))

the cursor oscillates again (but now between positions 335 and 337).

I find the behavior good but am too silly to understand what's going on.
What do I really specify when I write a form like

	(propertize "      " 'face 'lazy-highlight 'cursor 1))

Apparently the "1" doesn't refer to a position within the "      " but
to some position within the buffer from (- (point-max) 1) (point-max))
where that string is eventually placed by the overlay movement.

So apparently that specification neither serves to

(1) move the cursor visually to some position within the string (it
always remains before or after it), nor to

(2) move `point' to some position within the buffer (it's always at the
start and end positions of the overlay).

But what does it do?

 > You can see
 > this feature in action in cua-rectangle; after you play with it,
 > perhaps you could suggest how to improve the documentation.

IIUC in the Emacs sources the 'cursor property is never used in
connection with overlays.

martin





  reply	other threads:[~2012-03-30  7:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 20:49 bug#11068: 24.0.94; Face-remapped background does not extend to end of window Ivan Andrus
     [not found] ` <handler.11068.B.13324512277363.ack@debbugs.gnu.org>
2012-03-22 21:18   ` bug#11068: Acknowledgement (24.0.94; Face-remapped background does not extend to end of window) Ivan Andrus
2012-03-22 21:33     ` Glenn Morris
2012-03-22 21:31 ` bug#11069: 24.0.94; Face-remapped background does not extend to end of window Glenn Morris
2012-03-23 10:36 ` bug#11068: " Eli Zaretskii
2012-03-23 10:48   ` Ivan Andrus
2012-03-24 12:37   ` Eli Zaretskii
2012-03-24 13:42     ` martin rudalics
2012-03-24 14:12       ` Eli Zaretskii
2012-03-24 19:48         ` martin rudalics
2012-03-24 20:47           ` Eli Zaretskii
2012-03-25 12:54             ` martin rudalics
2012-03-25 17:22               ` Eli Zaretskii
2012-03-25 19:19                 ` martin rudalics
2012-03-25 19:53                   ` Stefan Monnier
2012-03-25 20:44                     ` martin rudalics
2012-03-25 21:49                   ` Eli Zaretskii
2012-03-25 21:53                     ` Eli Zaretskii
2012-03-26  7:05                     ` martin rudalics
2012-03-26 19:32                       ` Eli Zaretskii
2012-03-27  9:23                         ` martin rudalics
2012-03-27 18:40                           ` Eli Zaretskii
2012-03-30  7:35                             ` martin rudalics [this message]
2012-03-30  8:18                               ` Eli Zaretskii
2012-03-30 10:14                                 ` martin rudalics
2012-03-30 11:42                                   ` Eli Zaretskii
2012-03-31 10:29                                     ` Eli Zaretskii
2012-03-30 10:47                                 ` martin rudalics
2012-03-24 18:04       ` Stefan Monnier
2012-03-24 19:48         ` martin rudalics
2012-03-24 14:17     ` Chong Yidong
2012-03-24 14:40       ` Eli Zaretskii
2012-03-25  3:01         ` Chong Yidong
2012-03-25  4:02           ` Eli Zaretskii
2012-03-25  6:20             ` Chong Yidong
2012-03-25 12:55               ` martin rudalics
2012-03-25 17:26                 ` Eli Zaretskii
2012-03-25 19:20                   ` martin rudalics
2012-03-25 17:51               ` Eli Zaretskii
2012-03-26  4:16                 ` Chong Yidong
2012-03-26 19:35                   ` Eli Zaretskii
2012-03-30  8:49                   ` Eli Zaretskii
2012-03-25 12:54             ` martin rudalics
2012-03-25 17:25               ` Eli Zaretskii
2012-03-25 19:19                 ` martin rudalics
2012-03-25 21:50                   ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F756238.1080004@gmx.at \
    --to=rudalics@gmx.at \
    --cc=11068@debbugs.gnu.org \
    --cc=darthandrus@gmail.com \
    --cc=eliz@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 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.