From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: despen@verizon.net (Dan.Espen) Newsgroups: gmane.emacs.help Subject: Re: Python Mode, managing and converting TABS Date: Wed, 28 May 2014 17:17:11 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1401312030 27984 80.91.229.3 (28 May 2014 21:20:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 May 2014 21:20:30 +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:20:24 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 1WplGl-0001hn-DA for geh-help-gnu-emacs@m.gmane.org; Wed, 28 May 2014 23:20:19 +0200 Original-Received: from localhost ([::1]:45006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WplGk-0005nQ-TV for geh-help-gnu-emacs@m.gmane.org; Wed, 28 May 2014 17:20:18 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Injection-Info: mx05.eternal-september.org; posting-host="aabc59b8ce9cdce0c2995912677c9e55"; logging-data="6493"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+EpBNakoJkTvZLBaWPWGtb44DICnopOOg=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:nOb5yanR45PE7n5+1pn0WUNFPRI= sha1:Hv8viMkNSZotLodRALlpQ/CZE/U= Original-Xref: usenet.stanford.edu gnu.emacs.help:205647 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:97917 Archived-At: 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 -- Dan Espen