help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Deleting a word using keybinding


From: Harald Jörg
Subject: Re: Deleting a word using keybinding
Date: Thu, 15 Oct 2020 13:20:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1

On 10/15/20 12:26 PM, Christopher Dimech wrote:
>
> I am trying to delete a word using keybinding string "C-<tab>" but the
> Chord is still showing as undefined.
>
> I would like to delete a word even if I happen to be in the middle of
> it., so I move backward.
>
>     Here is the function
>
>     ( global-set-key (kbd "C-<tab>" )
>         ( lambda () (interactive)
>             ( (backward-word)
>               (kill-word 1)
>             )
>         )
>     )

If I get rid of one pair of parens, it works for me.

( global-set-key (kbd "C-<tab>" )
       ( lambda () (interactive)
           (backward-word)
           (kill-word 1)
       )
   )

With the extra parens in your code, I get 'Invalid function:
(backward-word)'.  Maybe this is why you don't see any effect?

Also note that if your point happens to be on the first character of a
word, this function deletes the _previous_ word.
--
Cheers,
haj



reply via email to

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