[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hook into change of position?
From: |
Daniel Jensen |
Subject: |
Re: hook into change of position? |
Date: |
Mon, 11 Jun 2007 15:38:57 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux) |
troelskn <troelskn@gmail.com> writes:
> Thanks. After some experiments, I ended up writing wrappers explicitly
> for the functions, which I need to extend. I can't help feeling, that
> there is some smarter way of accomplishing this, though.
It's not necessarily bad; many modes define their own movement commands.
You still haven't told exactly what you are doing, so I cannot tell.
> (defun my-end-of-line (&optional arg)
> ""
> (interactive "p")
> (setq mark-active nil)
> (end-of-line arg)
> (my-hook-function))
Maybe this was only example code, but I'll point out anyway that it's in
bad style. Use descriptive names and write a documentation string, so
that one can at least guess what the function does.
> I'm not even sure, that the (optional) argument `arg` will be passed
> on correctly to the wrapped function `end-of-line`
What makes you think that? Did you try it?