[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: Unable to write a custom function

From: Dieter Wilhelm
Subject: Re: Newbie: Unable to write a custom function
Date: Sun, 03 Dec 2006 01:06:39 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

Andre Kuehne <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]