[Top][All Lists]

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

Re: How to delete until the first displayable character in a line?

From: Robert Thorpe
Subject: Re: How to delete until the first displayable character in a line?
Date: 13 Dec 2006 03:19:42 -0800
User-agent: G2/1.0

Ronald wrote:
> > A prefix argument determines how many, so ..
> > C-u 2 C-k kills the next two, C-u -1 C-k text from point back to the
> > start of the line.
> > C-u C-k kills the next 4 lines.
> It's hard to count how many spaces there are, even harder with tabs.
> What's easy is that do that in one line is enough for me.

But why do you want to count spaces and tabs?

> >> On the hand, to delete characters until the first undisplayable
> >> character.
> > Don't know how to do that.  Possibly you could use zap-to-char.
> > Why on earth do you want to do that anyway?
> Because if the previous deleting can be done, I think it is a good
> companion. :-)

Right, I think I'm still not seeing what you're trying to do.  (By the
way, most Emacs people consider "undisplayable" characters to be ones
in international characters sets that can't be displayed with their
current font.)

To delete stuff that is not whitespace can also be done using regexp.

M-x replace-regexp RET \w RET RET will remove all words leaving only
punctuation and space.  M-x replace-regexp \S SPC RET RET will remove
all words and punctuation leaving only space.  If you use
query-replace-regexp for the commands above then Emacs will ask you
about each occurance, meaning you can do it only once, then escape by
pressing C-g.

reply via email to

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