all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pascal Bourguignon <spam@mouse-potato.com>
Subject: Re: Substiotution of tabs with spaces...
Date: 16 Apr 2005 01:38:46 +0200	[thread overview]
Message-ID: <87acnz8vax.fsf@thalassa.informatimago.com> (raw)
In-Reply-To: mailman.1690.1113606252.2895.help-gnu-emacs@gnu.org

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 15.04.2005 um 15:15 schrieb Pascal Bourguignon:
> 
> > Also, with my emacs configuration,
> > M-x replace-string RET TAB
> > tries to substitute a string of four spaces, not one tabulation.
> >
> > Try:
> >
> >  M-x replace-regexp RET C-q TAB + RET SPC SPC SPC RET
> >  M-x replace-string RET C-q TAB RET SPC SPC SPC RET
> >
> 
> Yes, that's something I've seen here too. I remember that I failed a
> few times to remove, i.e. replace-regexp with nothing, [SPC TAB]+$
> --  there could be a better regexp too. Do have an idea why TAB is
> sometimes \t and sometimes a few spaces?

TAB is TAB, and SPC is SPC.

What happens, is that TAB is a CONTROL character that was used to
CONTROL a mecanical teletype device, to make it move mecanically the
carriage to the next tabulation stop.

Since its meaning depends highly on the device (the width of the
tabulation changes, on some devices there's no tabulation, so it
doesn't show at all or is replaced by one space), and you cannot SEE
whether there is one TAB or several SPC, it should not be used in
normal files.  Use instead only SPC and sequences of SPC.

That's why in emacs, we usually bind the TAB key to more interesting
functions, such as lisp-indent-line or c-ident-command, and these
command indent the current line according to the syntax (using
normaly only spaces).

This has the added benefit that when you visualise the file in a
different environment, it always display correctly indented.


You should have: 
    (setq tab-always-indent t)
in  your ~/.emacs !

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Nobody can fix the economy.  Nobody can be trusted with their finger
on the button.  Nobody's perfect.  VOTE FOR NOBODY.

  parent reply	other threads:[~2005-04-15 23:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-15  9:06 Substiotution of tabs with spaces luca.spinacci
2005-04-15 11:10 ` Peter Dyballa
     [not found] ` <mailman.1631.1113563465.2895.help-gnu-emacs@gnu.org>
2005-04-15 13:15   ` Pascal Bourguignon
2005-04-15 22:49     ` Peter Dyballa
     [not found]     ` <mailman.1690.1113606252.2895.help-gnu-emacs@gnu.org>
2005-04-15 23:38       ` Pascal Bourguignon [this message]
2005-04-17 21:42         ` Peter Dyballa
2005-04-16  4:16       ` Stefan Monnier
2005-04-17 20:05         ` Steinar Børmer
2005-04-17 21:18           ` Peter Dyballa
2005-04-17 21:50           ` Peter Dyballa
     [not found]           ` <mailman.1796.1113775705.2895.help-gnu-emacs@gnu.org>
2005-04-18  6:39             ` Steinar Børmer
2005-04-18  0:03   ` Quokka
     [not found] <mailman.1624.1113556776.2895.help-gnu-emacs@gnu.org>
2005-04-15 10:52 ` Pascal Bourguignon
2005-04-15 19:55 ` Alan Mackenzie

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=87acnz8vax.fsf@thalassa.informatimago.com \
    --to=spam@mouse-potato.com \
    /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.
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.