From: Ender <oldcode@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How can I be notified whenever point of a buffer changed?
Date: 17 Apr 2007 00:39:17 -0700 [thread overview]
Message-ID: <1176795557.162257.304090@y80g2000hsf.googlegroups.com> (raw)
In-Reply-To: <mailman.2027.1176460480.7795.help-gnu-emacs@gnu.org>
On Apr 13, 6:25 pm, Kai Grossjohann <k...@emptydomain.de> wrote:
> Perhaps you have to go for post-command-hook (or pre-command-hook).
> The function would record the last seen value of point, look whether
> point has changed, and do its thing if so. (Obviously, you would also
> have to update the last seen value of point.)
>
> (defvar kai-last-point nil)
> (make-variable-buffer-local 'kai-last-point)
>
> (defun kai-motion-hook ()
> (unless (equal (point) kai-last-point)
> (setq kai-last-point (point))
> ... do stuff here ...))
>
> (add-hook 'post-command-hook 'kai-motion-hook)
>
> This is untested.
>
> Kai
Thank you very much, It works! And thanks for your patience to replay
newbie's question although the question is stupid sometimes :)
prev parent reply other threads:[~2007-04-17 7:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-12 4:00 How can I be notified whenever point of a buffer changed? Ender
2007-04-12 8:09 ` Kai Grossjohann
[not found] ` <mailman.1978.1176365678.7795.help-gnu-emacs@gnu.org>
2007-04-13 2:21 ` Ender
2007-04-13 10:22 ` Kai Grossjohann
2007-04-13 10:25 ` Kai Grossjohann
[not found] ` <mailman.2027.1176460480.7795.help-gnu-emacs@gnu.org>
2007-04-17 7:39 ` Ender [this message]
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=1176795557.162257.304090@y80g2000hsf.googlegroups.com \
--to=oldcode@gmail.com \
--cc=help-gnu-emacs@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.