[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Python Mode, managing and converting TABS
From: |
Dan.Espen |
Subject: |
Re: Python Mode, managing and converting TABS |
Date: |
Wed, 28 May 2014 17:17:11 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Tim Johnson <tim@akwebsoft.com> 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
- Re: Python Mode, managing and converting TABS,
Dan.Espen <=