all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* point-[left|entered] not called when supposed to
@ 2008-05-21 10:16 Jonas Bernoulli
  2008-05-21 14:28 ` Miles Bader
  0 siblings, 1 reply; 2+ messages in thread
From: Jonas Bernoulli @ 2008-05-21 10:16 UTC (permalink / raw)
  To: emacs-devel

In the elisp manual I found this:

     The special properties `point-entered' and `point-left' record
     hook functions that report motion of point.  Each time point
     moves, Emacs compares these two property values:

        * the `point-left' property of the character after the old
          location, and

        * the `point-entered' property of the character after the new
          location.

However it seams that the `point-left' properties of the two points
are being compared not `point-left' to `point-entered'.

Here is some code that demonstrates this:

(defun left-entered-demo ()
  (interactive)
  (switch-to-buffer-other-window "*left-entered-demo*")
  (insert (propertize "12345"
		      'point-entered (lambda (old new)
				       (message "entered %s" new))
		      'point-left (lambda (old new)
				    (message "left %s" old)))))

Moving forward one character at the time all the way to the beginning
of the buffer I get this:

left 6
entered 5 [2 times]
left 2 [2 times]
entered 1

But from the description above I expect both functions to be called
twice every time the cursor moves.

I very much hope you fix the code not the documentation because I the
current behavior complicates things a lot for me.

Thx

-- Jonas




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

end of thread, other threads:[~2008-05-21 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21 10:16 point-[left|entered] not called when supposed to Jonas Bernoulli
2008-05-21 14:28 ` Miles Bader

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.