[Python-Dev] Any Emacs tips for core developers?
Alexandre Vassalotti
alexandre at peadrop.com
Tue Feb 5 03:39:24 CET 2008
On Feb 4, 2008 7:47 PM, <skip at pobox.com> wrote:
>
> >> I should have asked this before, but what's so special about core
> >> (Python?) development that the tools should be different than for
> >> non-core development?
>
> Brett> Usually the core has keywords, built-ins, etc. that have not been
> Brett> pushed to the release versions for various editors.
>
> Ah, okay. Barry mentioned something about adjusting the python-mode syntax
> tables to include Python 3.x stuff, though patches are always
> welcome. <wink>
>
> Brett> Plus coding guidelines might be different from PEPs 7 and 8
> Brett> compared to what an editor is set to do by default.
>
> That might be a bit more challenging. I was thinking today that it would be
> kind of nice to have a set of predefined settings for Python's new C style
> (someone mentioned producing that). Should that go in the C/C++ mode or be
> delivered somehow else?
>
It's fairly trivial to adjust cc-mode to conform PEP 7 C coding convention:
(defmacro def-styled-c-mode (name style &rest body)
"Define styled C modes."
`(defun ,name ()
(interactive)
(c-mode)
(c-set-style ,style)
, at body))
(def-styled-c-mode python-c-mode "python"
(setq indent-tabs-mode t
tab-width 8
c-basic-offset 8))
(def-styled-c-mode py3k-c-mode "python"
(setq indent-tabs-mode nil
tab-width 4
c-basic-offset 4))
-- Alexandre
More information about the Python-Dev
mailing list