From owner-freebsd-doc Thu Nov 1 13:33:54 2001 Delivered-To: freebsd-doc@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 16C6637B408 for ; Thu, 1 Nov 2001 13:33:50 -0800 (PST) Received: from hades.hell.gr (patr530-b211.otenet.gr [212.205.244.219]) by mailsrv.otenet.gr (8.11.5/8.11.5) with ESMTP id fA1LXkt05766; Thu, 1 Nov 2001 23:33:46 +0200 (EET) Received: (from charon@localhost) by hades.hell.gr (8.11.6/8.11.6) id fA1LXnQ04065; Thu, 1 Nov 2001 21:33:49 GMT (envelope-from charon@labs.gr) Date: Thu, 1 Nov 2001 21:33:48 +0000 From: Giorgos Keramidas To: Michael Lucas Cc: doc@FreeBSD.ORG Subject: Re: emacs, SGML, and spaces Message-ID: <20011101213348.A3548@hades.hell.gr> References: <20011101132717.A74314@blackhelicopters.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011101132717.A74314@blackhelicopters.org> User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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