unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: daniel@bigwalter.net (Daniel Jensen)
To: help-gnu-emacs@gnu.org
Subject: Re: hook into change of position?
Date: Mon, 11 Jun 2007 15:38:57 +0200	[thread overview]
Message-ID: <87fy4ya9vy.fsf@orme.bigwalter.net> (raw)
In-Reply-To: 1181518000.482785.323720@q75g2000hsh.googlegroups.com

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?

      reply	other threads:[~2007-06-11 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-09 15:47 hook into change of position? troelskn
2007-06-10 12:35 ` Daniel Jensen
2007-06-10 23:26   ` troelskn
2007-06-11 13:38     ` Daniel Jensen [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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87fy4ya9vy.fsf@orme.bigwalter.net \
    --to=daniel@bigwalter.net \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).