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

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

Re: remove \t after a yank


From: Harald Hanche-Olsen
Subject: Re: remove \t after a yank
Date: Fri, 12 May 2006 22:27:52 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (berkeley-unix)

+ Gary Wessle <phddas@yahoo.com>:

| sometimes I copy and yank to a buffer a text with tab inform of lines
| where I then would like to remove one tab from the biggining of each
| line, query-replace-regex <RET>\T<RET><RET> will not do, first it want
| to replace the char t and second it want to replace all tabs if a line
| happen to start with multi tabs.

Hmm.  I don't understand how both of the above can be true at the same
time.  Anyway, \T is not a correct regexp for a tab.  Typing a plain
tab character should do the trick.  Adding a ^ in front of it should
limit the replacement to tabs at the beginning of a line:

M-x query-replace-regex <RET> ^ <TAB> <RET> <RET>

But easier is C-x C-x C-u -8 C-x <TAB>.  I.e., mark the just yanked
region, then indent it by -8 spaces.  (The C-x C-x may not be needed
if you're not using transient-mark-mode.  It's been so long I no
longer remember what life was without it.)

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
  when there is no ground whatsoever for supposing it is true.
  -- Bertrand Russell


reply via email to

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