all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dieter Wilhelm <dieter@duenenhof-wilhelm.de>
Cc: deech <aditya.siram@gmail.com>, help-gnu-emacs@gnu.org
Subject: Re: Newbie: Unable to write a custom function
Date: Sun, 03 Dec 2006 01:06:39 +0100	[thread overview]
Message-ID: <87ac254zcg.fsf@hans.local.net> (raw)
In-Reply-To: <4571F5B5.8050306@gmx.net> (Andre Kuehne's message of "Sat\, 02 Dec 2006 22\:52\:53 +0100")

Andre Kuehne <andre.kuehne@gmx.net> writes:

> deech wrote:
>> Hi all,
>> I am new to Emacs. I have written a new search function into my .emacs
>> file but I am unable to invoke it with M-x when I restart Emacs. There
>> are no error messages when Emacs starts up. Here is the code:
>>
>> ;;Search backwards from a point for a string. If found delete
>> ;;all characters from that string to the point.
>> ;;Eg Given the argument 't', 'alligator' becomes 'alliga'
>> (defun isearch-backward-tophrase ()
>>   (set-mark-command ())
>>   (isearch-backward )
>>   (kill-region ()())
>> )
>>
>> Any idea what I am doing wrong?
>
> You have to use the (interactive) special form to make your
> funtion invokable with M-x:
>
> (defun isearch-backward-tophrase ()
>    (interactive)
>    ...

...

By the way, please try it without the mark, at least in interactive
mode isearch-backward sets the mark where it starts the search.


-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

  reply	other threads:[~2006-12-03  0:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-02 21:23 Newbie: Unable to write a custom function deech
2006-12-02 21:52 ` Andre Kuehne
2006-12-03  0:06   ` Dieter Wilhelm [this message]
2006-12-04  9:03 ` Mathias Dahl
2006-12-06 17:49   ` Uber_Micro

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=87ac254zcg.fsf@hans.local.net \
    --to=dieter@duenenhof-wilhelm.de \
    --cc=aditya.siram@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.