jed-users mailing list

[2011 Date Index] [2011 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [Jed-users-l] Delete to end of line


FWIW, the elisp function I use is:

(global-set-key "\C-k"
  (lambda()
    "kill-line. kill newline only if at end of line"
    (interactive)
    (let ((start (point)))
      (end-of-line)
      (if (= start (point)) (forward-char))
      (delete-region start (point)))))


On Thu, May 5, 2011 at 4:25 PM, Doug Kramer <doog@xxxxxxxxxx> wrote:

> I have tried *del_eol*, which will not delete the newline character
> and *del_through_eol*, which always deletes the newline character but
> don't like this.
>
> I want this function I use in emacs:
>    If the cursor is not at the end of the line, delete to end of line
> (keeping newline),
>    but if the cursor is at the end of the line, delete the newline
> character.
>
> That way, continuing to hit Ctrl-K will alternately delete to eol and then
> delete newline, so I can use it to delete multiple lines.
> This function doesn't suffer from the problem that del_through_eol has of
> always deleting the newline.
>
> Is this possible in jed?
>
> thanks in advance
> -Doug
>
>
>
_______________________________________________
Jed-users-l mailing list
Jed-users-l@xxxxxxxx
http://mailman.jtan.com/mailman/listinfo/jed-users-l


[2011 date index] [2011 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]