* Python Mode, managing and converting TABS
@ 2014-05-28 19:13 Tim Johnson
2014-05-28 23:37 ` Stefan Monnier
0 siblings, 1 reply; 11+ messages in thread
From: Tim Johnson @ 2014-05-28 19:13 UTC (permalink / raw)
To: Emacs
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.
thanks
--
Tim
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com
^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <mailman.2339.1401307161.1147.help-gnu-emacs@gnu.org>]
* Re: Python Mode, managing and converting TABS
[not found] <mailman.2339.1401307161.1147.help-gnu-emacs@gnu.org>
@ 2014-05-28 21:17 ` Dan.Espen
2014-05-28 21:44 ` Tim Johnson
2014-06-02 19:33 ` Damien Wyart
1 sibling, 1 reply; 11+ messages in thread
From: Dan.Espen @ 2014-05-28 21:17 UTC (permalink / raw)
To: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Python Mode, managing and converting TABS
2014-05-28 21:17 ` Dan.Espen
@ 2014-05-28 21:44 ` Tim Johnson
0 siblings, 0 replies; 11+ messages in thread
From: Tim Johnson @ 2014-05-28 21:44 UTC (permalink / raw)
To: help-gnu-emacs
* 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Python Mode, managing and converting TABS
[not found] <mailman.2339.1401307161.1147.help-gnu-emacs@gnu.org>
2014-05-28 21:17 ` Dan.Espen
@ 2014-06-02 19:33 ` Damien Wyart
2014-06-03 15:20 ` Tim Johnson
[not found] ` <mailman.2841.1401808858.1147.help-gnu-emacs@gnu.org>
1 sibling, 2 replies; 11+ messages in thread
From: Damien Wyart @ 2014-06-02 19:33 UTC (permalink / raw)
To: help-gnu-emacs
* Tim Johnson <tim@akwebsoft.com> in gnu.emacs.help:
> 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)))
>
You might also want: (setq indent-tabs-mode nil)
--
DW
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-06-04 23:49 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-28 19:13 Python Mode, managing and converting TABS Tim Johnson
2014-05-28 23:37 ` Stefan Monnier
2014-05-29 15:57 ` Tim Johnson
2014-05-29 16:49 ` Stefan Monnier
2014-05-29 17:51 ` Tim Johnson
[not found] <mailman.2339.1401307161.1147.help-gnu-emacs@gnu.org>
2014-05-28 21:17 ` Dan.Espen
2014-05-28 21:44 ` Tim Johnson
2014-06-02 19:33 ` Damien Wyart
2014-06-03 15:20 ` Tim Johnson
[not found] ` <mailman.2841.1401808858.1147.help-gnu-emacs@gnu.org>
2014-06-03 17:53 ` Damien Wyart
2014-06-04 23:49 ` Tim Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).