Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Nov 2001 21:33:48 +0000
From:      Giorgos Keramidas <charon@labs.gr>
To:        Michael Lucas <mwlucas@blackhelicopters.org>
Cc:        doc@FreeBSD.ORG
Subject:   Re: emacs, SGML, and spaces
Message-ID:  <20011101213348.A3548@hades.hell.gr>
In-Reply-To: <20011101132717.A74314@blackhelicopters.org>
References:  <20011101132717.A74314@blackhelicopters.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 01, 2001 at 01:27:17PM -0500, Michael Lucas wrote:
>
> Folks,
>
> Does anyone have an Emacs macro handy to change filler to spaces when
> you're working in SGML mode?  My last PR accumulated tabs somehow, and
> IIRC it used to leave spaces automatically when working with SGML.

After you have edited a file, and changed spaces to tabs, you can
select a region and use `M-x untabify' to convert tabs to spaces.

> Sometimes my tab key leaves spaces, sometimes it uses a hard tab.  I'm
> sure this is fixable under EmacsOS, somehow.

Emacs sgml-mode is based on text-mode.  On all text-mode derivatives
(actually in any Emacs mode) you can set `indent-tabs-mode' to `nil'
to inhibit the use of tabs, and force Emacs to use only spaces.

This variable is buffer-local, which means you can set it when a
buffer is active, and the changes will only affect that buffer.  If
you want indent-tabs-mode to be nil when in sgml-mode, you can add
code that sets it in either sgml-mode-hook or text-mode-hook (the
latter will affect *all* text modes).

An example sgml-mode-hook for your .emacs could be:

	(setq sgml-mode-hook
	  '(lambda ()
	      (setq fill-column 70
		    indent-tabs-mode nil	;; <-- no tabs
		    next-line-add-newlines nil
		    standard-indent 2)
	      (auto-fill-mode t)))

-giorgos


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011101213348.A3548>