unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* remove \t after a yank
@ 2006-05-12 19:15 Gary Wessle
  2006-05-12 20:27 ` Harald Hanche-Olsen
  0 siblings, 1 reply; 2+ messages in thread
From: Gary Wessle @ 2006-05-12 19:15 UTC (permalink / raw)


Hi

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.

thanks

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

* Re: remove \t after a yank
  2006-05-12 19:15 remove \t after a yank Gary Wessle
@ 2006-05-12 20:27 ` Harald Hanche-Olsen
  0 siblings, 0 replies; 2+ messages in thread
From: Harald Hanche-Olsen @ 2006-05-12 20:27 UTC (permalink / raw)


+ 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

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

end of thread, other threads:[~2006-05-12 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-12 19:15 remove \t after a yank Gary Wessle
2006-05-12 20:27 ` Harald Hanche-Olsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).