help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python Mode, managing and converting TABS


From: Tim Johnson
Subject: Re: Python Mode, managing and converting TABS
Date: Wed, 28 May 2014 13:44:39 -0800
User-agent: Mutt/1.5.21 (2010-09-15)

* Dan.Espen <despen@verizon.net> [140528 13:28]:
> 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
  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]