mmm-mode, python-mode and doctest-mode?

Discussion in 'Python' started by John J Lee, Nov 30, 2005.

  1. John J Lee

    John J Lee Guest

    Is it possible to get doctest-mode to work with mmm-mode and python-mode
    nicely so that docstrings containing doctests are editable in
    doctest-mode?

    In my utter e-lisp ignorance, I tried this:

    (require 'mmm-auto)
    (setq mmm-global-mode 'maybe)
    (mmm-add-classes
    '(
    (doctest
    :submode doctest-mode
    :front "\"\"\""
    :back "\"\"\"")))
    (mmm-add-mode-ext-class nil "\\.py$" 'doctest)

    That has the following problems:

    - Fails to set the background colour of the doctest-mode regions to the
    default mmm-mode gray (as documented by mmm-mode - and observed for
    another mmm class I have). Maybe an interaction with python-mode?

    - Confuses python-mode: the face of docstrings sometimes fluctuates from
    second to second between the string face and the face of ordinary text
    (I assume the former face is python-mode's string face and the latter face
    is the doctest-mode English-text face)!


    Any tips appreciated!


    John
     
    John J Lee, Nov 30, 2005
    #1
    1. Advertising

  2. John J Lee wrote:
    > Is it possible to get doctest-mode to work with mmm-mode and python-mode
    > nicely so that docstrings containing doctests are editable in doctest-mode?


    I don't know.

    (snip)
    >
    > Any tips appreciated!
    >


    Seems like comp.emacs could be a good place for this question....

    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in ''.split('@')])"
     
    bruno at modulix, Dec 1, 2005
    #2
    1. Advertising

  3. John J Lee

    John J. Lee Guest

    bruno at modulix <> writes:

    > John J Lee wrote:
    > > Is it possible to get doctest-mode to work with mmm-mode and python-mode
    > > nicely so that docstrings containing doctests are editable in doctest-mode?

    >
    > I don't know.
    >
    > (snip)
    > >
    > > Any tips appreciated!
    > >

    >
    > Seems like comp.emacs could be a good place for this question....


    I've only posted to gnu.emacs.help previously (the message you reply
    to was cross-posted there), since the name seemed to suggest
    friendliness to people like me who use emacs a lot but are clueless
    with elisp :). But thinking again I guess comp.emacs is just the
    general emacs group, while gnu.emacs.help is the GNU-specific one?


    John
     
    John J. Lee, Dec 1, 2005
    #3
  4. Re: [OT] mmm-mode, python-mode and doctest-mode?

    John J. Lee wrote:
    > bruno at modulix <> writes:
    >
    >
    >>John J Lee wrote:
    >>
    >>>Is it possible to get doctest-mode to work with mmm-mode and python-mode
    >>>nicely so that docstrings containing doctests are editable in doctest-mode?

    >>

    (snip)
    >>
    >>Seems like comp.emacs could be a good place for this question....

    >
    >
    > I've only posted to gnu.emacs.help previously (the message you reply
    > to was cross-posted there),


    Sorry, did not see that. But then you should have set the follow-up there.

    > since the name seemed to suggest
    > friendliness to people like me who use emacs a lot but are clueless
    > with elisp :)


    You can script your emacs with Python too.

    >. But thinking again I guess comp.emacs is just the
    > general emacs group, while gnu.emacs.help is the GNU-specific one?


    Probably. I must say I don't spend that much time configuring my
    emacs... Changing mode manually when needed is ok for me.

    --
    bruno desthuilliers
    python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
    p in ''.split('@')])"
     
    bruno at modulix, Dec 1, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edward Loper
    Replies:
    0
    Views:
    527
    Edward Loper
    Aug 7, 2007
  2. John J Lee
    Replies:
    0
    Views:
    560
    John J Lee
    Aug 7, 2007
  3. Edward Loper

    mmm-mode, python-mode and doctest-mode?

    Edward Loper, Aug 9, 2007, in forum: Python
    Replies:
    0
    Views:
    475
    Edward Loper
    Aug 9, 2007
  4. Neal Becker
    Replies:
    0
    Views:
    412
    Neal Becker
    Aug 9, 2007
  5. Jeffrey Moss

    eruby mode emacs with mmm-mode

    Jeffrey Moss, Jul 6, 2005, in forum: Ruby
    Replies:
    1
    Views:
    188
    Alan Chen
    Jul 6, 2005
Loading...

Share This Page