From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Johnson Newsgroups: gmane.emacs.help Subject: Re: Python Mode, managing and converting TABS Date: Wed, 28 May 2014 13:44:39 -0800 Organization: AkWebsoft Message-ID: <20140528214439.GD25191@mail.akwebsoft.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1401313511 13221 80.91.229.3 (28 May 2014 21:45:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 May 2014 21:45:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 23:45:05 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wplef-000529-Ar for geh-help-gnu-emacs@m.gmane.org; Wed, 28 May 2014 23:45:01 +0200 Original-Received: from localhost ([::1]:45115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wplee-0006qt-Nr for geh-help-gnu-emacs@m.gmane.org; Wed, 28 May 2014 17:45:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpleP-0006qX-Fh for help-gnu-emacs@gnu.org; Wed, 28 May 2014 17:44:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WpleK-0002PB-Ro for help-gnu-emacs@gnu.org; Wed, 28 May 2014 17:44:45 -0400 Original-Received: from 191-232-4-64.mtaonline.net ([64.4.232.191]:54667 helo=tj49.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpleK-0002OS-J6 for help-gnu-emacs@gnu.org; Wed, 28 May 2014 17:44:40 -0400 Original-Received: by tj49.com (Postfix, from userid 1000) id 206291231E6; Wed, 28 May 2014 13:44:39 -0800 (AKDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.4.232.191 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97918 Archived-At: * Dan.Espen [140528 13:28]: > Tim Johnson writes: > > > I'm currently using > > GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10 on > > Ubuntu 12.04, but expect to have to also use --no-window-system > > ("console mode") on occassion. > > > > I have used emacs extensively in the distant past (up 'til 2008), so > > am re-acquainting myself with the system. > > > > I have much legacy python code that has "hard tabs" and to meet > > the python style guides, will have to be converted to "soft tabs". > > I.E. TAB => " " > > > > I also need to configure emacs so that TAB (or Ctrl-i) inserts four > > spaces instead of the TAB character. > > > > I currently have this in my .emacs [code] > > (add-hook 'python-mode-hook > > '(lambda () > > (turn-on-font-lock) > > (setq default-tab-width 4) > > (setq tab-width 4) > > (imenu-add-menubar-index) > > (setq imenu-sort-function 'imenu--sort-by-name))) > > > > [/code] > > > > I'd welcome any and all advice, pointers to previous discussion > > would are solicited. > > To remove tabs, make the whole buffer the region: > > C-x h > > then run untabify: > > M-x untabify Thank you. That was very simple. I note from 'help that 'default-tab-width is obsolete. cheers -- Tim tim at tee jay forty nine dot com or akwebsoft dot com http://www.akwebsoft.com, http://www.tj49.com