[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Please why ORDER of .emacs lines here matters.....
From: |
Kevin Rodgers |
Subject: |
Re: Please why ORDER of .emacs lines here matters..... |
Date: |
Thu, 31 Jul 2003 15:53:30 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Christian Seberino wrote:
Notice the py-indent-offset line (2nd one) below. If I move this
line further down then I don't
get 8 space idents anymore. The order matters!!!! But why???
py-indent-offset is probably a buffer local variable whose value is set
in the python-mode function to the global default. setq-default only
affects the global value, so if you set that after calling python-mode
the buffer local binding is already set to the original value. (If that
is true, then your claim the it doesn't work isn't quite true: the first
Python mode buffer will have the old global default, but subsequent
Python mode buffers should have the new global default.)
(defun cs-python-mode()
(setq-default py-indent-offset 8 )
(python-mode)
(turn-on-font-lock)
(setq-default auto-fill-function 'do-auto-fill)
(setq-default py-python-command "python2.2" )
(setq-default py-continuation-offset 8 )
(setq-default py-smart-indentation nil )
(setq-default py-block-comment-prefix "#" ))
Either move those setq-defaults to the top level (outside your function),
or just use python mode:
(add-hook 'python-mode-hook 'cs-python-mode-hook)
(defun cs-python-mode-hook ()
(turn-on-font-lock)
(setq auto-fill-function 'do-auto-fill
py-python-command "python2.2"
py-indent-offset 8
py-continuation-offset 8
py-smart-indentation nil
py-block-comment-prefix "#"))
--
Kevin Rodgers