[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Deleting chunks of whitespace
From: |
Richard V. Molen |
Subject: |
Re: Deleting chunks of whitespace |
Date: |
15 Nov 2002 13:08:48 -0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Benjamin Lewis <bclewis@cs.sfu.ca> writes:
> On 15 Nov 2002, Richard V. Molen wrote:
>
> > Benjamin Lewis <bclewis@cs.sfu.ca> writes:
> >
> >> Not quite what you want, but you could check out
> >> `delete-horizontal-space' and 'just-one-space', bound by default to
> >> `M-\' and 'M-<SPC>' respectively.
> >
> > These key bindings are nice since they mesh well with M-d.
> >
> > On another editor there was a function like that I miss...
> >
> > if the cursor is at the end of line, pull up the next line (like C-k)
> > else
> > if the cursor is on non-whitespace, delete all characters to end of line
> > that are non-whitespace.
> > else
> > if the cursor is on whitespace, delete all characters to the end of line
> > that are whitespace.
> >
> > Does anyone have such a function?
>
> Not sure I understand. Where would you use this that C-k doesn't do what
> you want?
Though I tried, in review, what I said wasn't quite accurate.
Here's an example of what I'm looking for. Given this text and
calling this function repeatedly...
... cursor ...
... v ...
This is some-text on_the_first/line
Second line
... cursor ...
... v ...
This is some-text on_the_first/line
Second line
... cursor ...
... v ...
This is on_the_first/line
Second line
... cursor ...
... v ...
This is
Second line
... cursor ...
... v ...
This is Second line
>
> Is the function `delete-trailing-whitespace' helpful?
assuming the Second line had whitespace (shown as '@')
... cursor ...
... v ...
This is Second line@@@@@@@@
... cursor ...
... v ...
This is
This is behavior is similar to alternating between M-SPC & M-d
and then doing a C-k if at there's no more on the current line.
Two exceptions being the: 1. the cursor doesn't move (not a big
deal) 2. M-d would not cut all non-whitespace characters, but
only alphanumeric strings.
--
Richard V. Molen
Warning!!
Signature under construction, safety glasses required.
- Deleting chunks of whitespace, Moore, Mathew L, 2002/11/15
- Re: Deleting chunks of whitespace, Richard V. Molen, 2002/11/15
- Re: Deleting chunks of whitespace, Benjamin Rutt, 2002/11/15
- RE: Deleting chunks of whitespace, Moore, Mathew L, 2002/11/15
- Re: Deleting chunks of whitespace, Benjamin Lewis, 2002/11/15
- Re: Deleting chunks of whitespace, Richard V. Molen, 2002/11/15
- Re: Deleting chunks of whitespace, Benjamin Lewis, 2002/11/15
- Re: Deleting chunks of whitespace,
Richard V. Molen <=
- Re: Deleting chunks of whitespace, Ehud Karni, 2002/11/16
- Message not available
- Re: Deleting chunks of whitespace, Richard V. Molen, 2002/11/18
- Re: Deleting chunks of whitespace, Ehud Karni, 2002/11/18
- Message not available
- Re: Deleting chunks of whitespace, Richard V. Molen, 2002/11/18
Re: Deleting chunks of whitespace, Kai Großjohann, 2002/11/16