unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Brendan Halpin <brendan.halpin@ul.ie>
To: help-gnu-emacs@gnu.org
Subject: Re: Adding tab characters
Date: Thu, 13 Mar 2008 17:26:22 +0000	[thread overview]
Message-ID: <871w6eilhd.fsf@wivenhoe.staff8.ul.ie> (raw)
In-Reply-To: 7937ec17-984e-4698-bbf1-8feaef2841bc@s37g2000prg.googlegroups.com

Kerry.Thurber@gmail.com writes:

> Hello everyone,
>
> I'm missing something obvious I think.  I want to create a tab
> delimited file using emacs.  I can do it fine with a keyboard macro,
> but I need to make something permanent that others can use.
>
> (defun CreateTabDelimitedFile()
>   "Convert JED logs into something Scott can use"
>   (interactive)
>   (beginning-of-buffer)
>   (replace-string ";" "\009")  ;tried many other variants
> )
>
> In place of "\009" I tried ^I, ^Tab, an actual tab, "[tab]" and
> everything else I could imagine.  Nothing seems to work.  Is there a
> way to replace a string with a tab character?  Is there a way to
> replace a string with another string *plus* a tab character?

An actual tab should work, but you need to enter it as C-Q TAB as Emacs
may enter spaces instead (or indent). However try:

 (replace-string ";" "\t")

\t stands for a literal tab. 

Brendan
-- 
Brendan Halpin,  Department of Sociology,  University of Limerick,  Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F2-025 x 3147
mailto:brendan.halpin@ul.ie  http://www.ul.ie/sociology/brendan.halpin.html


  reply	other threads:[~2008-03-13 17:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 17:08 Adding tab characters Kerry.Thurber
2008-03-13 17:26 ` Brendan Halpin [this message]
2008-03-13 17:52   ` Kerry.Thurber
2008-03-13 19:30 ` Joel J. Adamson
2008-03-15  6:53 ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871w6eilhd.fsf@wivenhoe.staff8.ul.ie \
    --to=brendan.halpin@ul.ie \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).