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

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

Re: I don't want Ctrl-Backspace to span different lines...


From: Jon
Subject: Re: I don't want Ctrl-Backspace to span different lines...
Date: 16 May 2003 01:19:14 -0700

address@hidden (Kai Großjohann) wrote in message news:<address@hidden>...
> address@hidden (Jon) writes:
> 
> > Is there any way to prevent Ctrl-Backspace & Ctrl-Delete from spanning
> > lines?
> 
> You have to write Lisp code.  For example,
> 
> (defun jon-kill-word (n)
>   "Kill N words or to end of line, whichever comes first."
>   (interactive "p")
>   (let ((eol (point-at-eol))
>         (nwords (save-excursion (forward-word n) (point))))
>     (kill-region (point) (min eol nwords))))
> 
> (defun jon-backward-kill-word (n)
>   "Kill N words backward or to beginning of line, whichever comes first."
>   (interactive "p")
>   (let ((bol (point-at-bol))
>         (nwords (save-excursion (backward-word n) (point))))
>     (kill-region (point) (max (bol nwords)))))
> 
> If these commands do what you want, you can bind them to keys you like.


Well, I don't have a clue about writing Lisp, but fortunately your
samples worked perfectly.

Thanks for the help,
Jon


reply via email to

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