all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to delete until the first displayable character in a line?
@ 2006-12-12 15:35 Ronald
  2006-12-12 15:52 ` More general Ronald
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Ronald @ 2006-12-12 15:35 UTC (permalink / raw)


How to delete towards the right or the left until the first displayed 
character or the start/end of a line.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* More general
  2006-12-12 15:35 How to delete until the first displayable character in a line? Ronald
@ 2006-12-12 15:52 ` Ronald
  2006-12-12 18:55   ` Kevin Rodgers
       [not found]   ` <mailman.1798.1165949787.2155.help-gnu-emacs@gnu.org>
  2006-12-12 17:21 ` How to delete until the first displayable character in a line? Robert Thorpe
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Ronald @ 2006-12-12 15:52 UTC (permalink / raw)


Ronald wrote:
> How to delete towards the right or the left until the first displayed 
> character or the start/end of a line.

On the hand, to delete characters until the first undisplayable character.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to delete until the first displayable character in a line?
  2006-12-12 15:35 How to delete until the first displayable character in a line? Ronald
  2006-12-12 15:52 ` More general Ronald
@ 2006-12-12 17:21 ` Robert Thorpe
  2006-12-12 22:27   ` Ronald
  2006-12-13  0:12 ` Dieter Wilhelm
  2006-12-13 12:21 ` Mathias Dahl
  3 siblings, 1 reply; 10+ messages in thread
From: Robert Thorpe @ 2006-12-12 17:21 UTC (permalink / raw)


Ronald wrote:
> How to delete towards the right or the left until the first displayed
> character or the start/end of a line.

>From the left to the end of the line is C-k
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.

> 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?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: More general
  2006-12-12 15:52 ` More general Ronald
@ 2006-12-12 18:55   ` Kevin Rodgers
       [not found]   ` <mailman.1798.1165949787.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Kevin Rodgers @ 2006-12-12 18:55 UTC (permalink / raw)


Ronald wrote:
> Ronald wrote:
>> How to delete towards the right or the left until the first displayed 
>> character or the start/end of a line.
> 
> On the hand, to delete characters until the first undisplayable character.

What characters do you consider undisplayable?

-- 
Kevin

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: More general
       [not found]   ` <mailman.1798.1165949787.2155.help-gnu-emacs@gnu.org>
@ 2006-12-12 22:20     ` Ronald
  0 siblings, 0 replies; 10+ messages in thread
From: Ronald @ 2006-12-12 22:20 UTC (permalink / raw)


> What characters do you consider undisplayable?
space tab  ... 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to delete until the first displayable character in a line?
  2006-12-12 17:21 ` How to delete until the first displayable character in a line? Robert Thorpe
@ 2006-12-12 22:27   ` Ronald
  2006-12-13 11:19     ` Robert Thorpe
  0 siblings, 1 reply; 10+ messages in thread
From: Ronald @ 2006-12-12 22:27 UTC (permalink / raw)


> 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.

>> 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. :-) 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to delete until the first displayable character in a line?
  2006-12-12 15:35 How to delete until the first displayable character in a line? Ronald
  2006-12-12 15:52 ` More general Ronald
  2006-12-12 17:21 ` How to delete until the first displayable character in a line? Robert Thorpe
@ 2006-12-13  0:12 ` Dieter Wilhelm
  2006-12-23 12:47   ` Dieter Wilhelm
  2006-12-13 12:21 ` Mathias Dahl
  3 siblings, 1 reply; 10+ messages in thread
From: Dieter Wilhelm @ 2006-12-13  0:12 UTC (permalink / raw)
  Cc: help-gnu-emacs

Ronald <followait@163.com> writes:

> How to delete towards the right or the left until the first displayed
> character or the start/end of a line.

1. M-\: deletes white space to the right *and* the left.

2. M-- M-\: deletes white space only to the left. (There's a bug right now
   when calling delete-horizontal-space with M-\ but I'll report it.)

3. C-M-s SPC RET C-w: kills white space to the right.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to delete until the first displayable character in a line?
  2006-12-12 22:27   ` Ronald
@ 2006-12-13 11:19     ` Robert Thorpe
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Thorpe @ 2006-12-13 11:19 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to delete until the first displayable character in a line?
  2006-12-12 15:35 How to delete until the first displayable character in a line? Ronald
                   ` (2 preceding siblings ...)
  2006-12-13  0:12 ` Dieter Wilhelm
@ 2006-12-13 12:21 ` Mathias Dahl
  3 siblings, 0 replies; 10+ messages in thread
From: Mathias Dahl @ 2006-12-13 12:21 UTC (permalink / raw)


Ronald <followait@163.com> writes:

> How to delete towards the right or the left until the first
> displayed character or the start/end of a line.

Depending on what you need the above for, `just-one-space' (for me
M-SPC is bound to this command) might be useful to you.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to delete until the first displayable character in a line?
  2006-12-13  0:12 ` Dieter Wilhelm
@ 2006-12-23 12:47   ` Dieter Wilhelm
  0 siblings, 0 replies; 10+ messages in thread
From: Dieter Wilhelm @ 2006-12-23 12:47 UTC (permalink / raw)
  Cc: help-gnu-emacs

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

> Ronald <followait@163.com> writes:
>
>> How to delete towards the right or the left until the first displayed
>> character or the start/end of a line.
>
> 1. M-\: deletes white space to the right *and* the left.
>
> 2. M-- M-\: deletes white space only to the left. (There's a bug right now
>    when calling delete-horizontal-space with M-\ but I'll report it.)

2. works now with CVS Emacs.

>
> 3. C-M-s SPC RET C-w: kills white space to the right.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-12-23 12:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-12 15:35 How to delete until the first displayable character in a line? Ronald
2006-12-12 15:52 ` More general Ronald
2006-12-12 18:55   ` Kevin Rodgers
     [not found]   ` <mailman.1798.1165949787.2155.help-gnu-emacs@gnu.org>
2006-12-12 22:20     ` Ronald
2006-12-12 17:21 ` How to delete until the first displayable character in a line? Robert Thorpe
2006-12-12 22:27   ` Ronald
2006-12-13 11:19     ` Robert Thorpe
2006-12-13  0:12 ` Dieter Wilhelm
2006-12-23 12:47   ` Dieter Wilhelm
2006-12-13 12:21 ` Mathias Dahl

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.