9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Russ Cox <rsc@swtch.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] Acme tabs to spaces
Date: Tue,  6 Dec 2005 13:54:13 -0500	[thread overview]
Message-ID: <ee9e417a0512061054va9eb44eg9afb18e29b2be668@mail.gmail.com> (raw)
In-Reply-To: <EB193199-F5CE-4E61-B68C-EFD5F05EF172@telus.net>

> So my new employer has a coding convention that tabs don't appear in
> source, and that indent levels are 4 spaces.  Ick.  But in the
> interest of global harmony, I'm willing to adapt.  I know I can
> trivially convert the tabs to spaces at any given time, and set
> $tabstops to 4 to get the right width, but I have to do the
> conversion with each file I save.  Ick.
> Is there some automatic tab conversion code somewhere in Acme?  Where
> would be the sane place to put such a thing?   (yes, I already know
> there is no sane place for such a thing...)

acme -a goes a long way to making typing four spaces an okay
thing to do by hand.

everyone has their own programs to convert.
mine is in /n/sources/contrib/rsc/cmd/tab.c

tab -n4 converts from spaces to tabs
tab -u -n4 converts from tabs to spaces

you could go a step further and create scripts T and U
for execution in acme windows that use $winid to
pick up the window contents, process it, and put it back.

russ


  parent reply	other threads:[~2005-12-06 18:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-06 18:43 Paul Lalonde
2005-12-06 18:46 ` andrey mirtchovski
2005-12-06 18:54 ` Russ Cox [this message]
2005-12-06 18:55 ` Rob Pike
2005-12-06 20:25   ` David Leimbach
2005-12-06 19:06 plan9
2005-12-06 20:37 ` Skip Tavakkolian

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

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

  git send-email \
    --in-reply-to=ee9e417a0512061054va9eb44eg9afb18e29b2be668@mail.gmail.com \
    --to=rsc@swtch.com \
    --cc=9fans@cse.psu.edu \
    /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 NNTP newsgroup(s).