Loading ...
Sorry, an error occurred while loading the content.

RE: [jasspa] python hilight 2

Expand Messages
  • Phillips, Steven
    Jiri, Thank you for your help on this topic. For the next version of MicroEmacs I have added a new hilight feature that could mean that the need for the #
    Message 1 of 7 , Apr 4, 2006
    • 0 Attachment
      Jiri,

      Thank you for your help on this topic. For the next version of
      MicroEmacs I have added a new hilight feature that could mean that the
      need for the #""" comment is no longer required. However, not being a
      python developer I have no real examples of this to check the changes
      will fix the problem.

      So can you, or anyone else, please send me some python files that
      demonstrate this problem? Any files send directly to me will be kept
      private,

      Steve

      > -----Original Message-----
      > From: jasspa@yahoogroups.com [mailto:jasspa@yahoogroups.com]
      > On Behalf Of Jiri Vit
      > Sent: 04 April 2006 12:29
      > To: jasspa@yahoogroups.com
      > Subject: [jasspa] python hilight 2
      >
      > Hi list,
      >
      > I am new here and I have found an old message without answer:
      >
      > I solved the python string highlight problem with:
      >
      > 1.
      > Edit hkpython.emf and change hi-light look-back. For example:
      >
      > 0 hilight .hilight.python 2 50 $global-scheme
      >
      > 2.
      > Then add a little comment after string definition in python
      > source file:
      >
      > source.py:
      > --------------file -------------------
      > """
      > very
      > long
      > python
      > string
      > """
      > #""" - add this comment
      > ------------- EOF ---------------------
      >
      > I know that's not the cleanest way, but it works for me well ;-)
      >
      > Jiri
      >
      > > From: "Bosko Markovic" <bosko.m@...>Date: Sat Oct 8, 2005 11:32 am
      > > Subject: python hilight 2 bosko.m@...Send Email
      >
      > > There is another issue with highlighting. Single quotes or triple
      > > quotes that are first from the top of screen are considered as
      > > starting quotes, and code below them is highlighted as
      > string. This is
      > > not case with C/C++ files, only with Python.
      >
      > > Any suggestions?
      >
      >
      > ______________________________________________________________
      > ____________
      >
      > This is an unmoderated list. JASSPA is not responsible for
      > the content of any material posted to this list.
      >
      > To unsubscribe, send a mail message to
      >
      > mailto:jasspa-unsubscribe@yahoogroups.com
      >
      > or visit http://groups.yahoo.com/group/jasspa and modify your
      > account settings manually.
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
    • Steven Phillips
      I found the original email (missed it first time around), the example suggests the python format is: ... I have utilized the attached to the so
      Message 2 of 7 , Apr 4, 2006
      • 0 Attachment
        I found the original email (missed it first time around), the example suggests
        the python format is:

        """<...

        >"""

        I have utilized the '<' and '>' attached to the """ so please let me know if
        this is unwise (with examples!). Given this I propose the following:

        0 hilight .hilight.python 2 50 $global-scheme
        hilight .hilight.python 2 "#" .scheme.comment
        hilight .hilight.python 4 "\"\"\"<" ">\"\"\"" "\\" .scheme.string
        hilight .hilight.python 0 ">\"\"\"" .scheme.string
        hilight .hilight.python 0x804 "\"" "\"" "\\" .scheme.string
        hilight .hilight.python 0 "\\[" .scheme.string
        hilight .hilight.python 0 "\\]" .scheme.string
        ; Quote
        hilight .hilight.python 0x804 "'" "['\n]" "\\" .scheme.quote
        ; Variables

        This should work with ME0505 although I have only tested with the latest
        version.

        Steve

        > Subject: [jasspa] python hilight 2
        > From: Jiri Vit <jirivit@...>
        > Date: Tuesday, April 4, 2006, 12:28:46 PM
        > To: jasspa@yahoogroups.com
        > Hi list,

        > I am new here and I have found an old message without answer:

        > I solved the python string highlight problem with:

        > 1.
        > Edit hkpython.emf and change hi-light look-back. For example:

        > 0 hilight .hilight.python 2 50 $global-scheme

        > 2.
        > Then add a little comment after string definition in python source file:

        > source.py:
        > --------------file -------------------
        > """
        > very
        > long
        > python
        > string
        > """
        > #""" - add this comment
        > ------------- EOF ---------------------

        > I know that's not the cleanest way, but it works for me well ;-)

        > Jiri

        >> From: "Bosko Markovic" <bosko.m@...>Date: Sat Oct 8, 2005 11:32 am
        >> Subject: python hilight 2 bosko.m@...Send Email

        >> There is another issue with highlighting. Single quotes or triple quotes
        >> that
        >> are first from the top of screen are considered as starting quotes, and
        >> code
        >> below them is highlighted as string. This is not case with C/C++ files,
        >> only
        >> with Python.

        >> Any suggestions?


        > __________________________________________________________________________

        > This is an unmoderated list. JASSPA is not responsible for the content of
        > any material posted to this list.

        > To unsubscribe, send a mail message to

        > mailto:jasspa-unsubscribe@yahoogroups.com

        > or visit http://groups.yahoo.com/group/jasspa and
        > modify your account settings manually.


        >
        > Yahoo! Groups Links



        >
      • Jiri Vit
        Unfortunately long python string begins and ends only with . All strings between the triple-quotes are part of string data. For details look at this:
        Message 3 of 7 , Apr 5, 2006
        • 0 Attachment
          Unfortunately long python string begins and ends only with '"""'. All
          strings between the triple-quotes are
          part of string data.

          For details look at this:
          http://docs.python.org/ref/strings.html

          From the python tutorial:
          ---------------------------
          Strings can be surrounded in a pair of matching triple-quotes: """ or '''.
          End of lines do not need to be escaped when using triple-quotes, but they
          will be included in the string.

          Examples:

          print """
          Usage: thingy [OPTIONS]
          -h Display this usage message
          -H hostname Hostname to connect to
          """

          produces the following output:


          Usage: thingy [OPTIONS]
          -h Display this usage message
          -H hostname Hostname to connect to



          On Tue, 04 Apr 2006 23:52:54 +0200, Steven Phillips <bill@...>
          wrote:

          > I found the original email (missed it first time around), the example
          > suggests
          > the python format is:
          >
          > """<...
          >
          >> """
          >
          > I have utilized the '<' and '>' attached to the """ so please let me
          > know if
          > this is unwise (with examples!). Given this I propose the following:
          >
          > 0 hilight .hilight.python 2 50 $global-scheme
          > hilight .hilight.python 2 "#" .scheme.comment
          > hilight .hilight.python 4 "\"\"\"<" ">\"\"\"" "\\" .scheme.string
          > hilight .hilight.python 0 ">\"\"\"" .scheme.string
          > hilight .hilight.python 0x804 "\"" "\"" "\\" .scheme.string
          > hilight .hilight.python 0 "\\[" .scheme.string
          > hilight .hilight.python 0 "\\]" .scheme.string
          > ; Quote
          > hilight .hilight.python 0x804 "'" "['\n]" "\\" .scheme.quote
          > ; Variables
          >
          > This should work with ME0505 although I have only tested with the latest
          > version.
          >
          > Steve
          >
          >> Subject: [jasspa] python hilight 2
          >> From: Jiri Vit <jirivit@...>
          >> Date: Tuesday, April 4, 2006, 12:28:46 PM
          >> To: jasspa@yahoogroups.com
          >> Hi list,
          >
          >> I am new here and I have found an old message without answer:
          >
          >> I solved the python string highlight problem with:
          >
          >> 1.
          >> Edit hkpython.emf and change hi-light look-back. For example:
          >
          >> 0 hilight .hilight.python 2 50 $global-scheme
          >
          >> 2.
          >> Then add a little comment after string definition in python source file:
          >
          >> source.py:
          >> --------------file -------------------
          >> """
          >> very
          >> long
          >> python
          >> string
          >> """
          >> #""" - add this comment
          >> ------------- EOF ---------------------
          >
          >> I know that's not the cleanest way, but it works for me well ;-)
          >
          >> Jiri
          >
          >>> From: "Bosko Markovic" <bosko.m@...>Date: Sat Oct 8, 2005 11:32 am
          >>> Subject: python hilight 2 bosko.m@...Send Email
          >
          >>> There is another issue with highlighting. Single quotes or triple
          >>> quotes
          >>> that
          >>> are first from the top of screen are considered as starting quotes, and
          >>> code
          >>> below them is highlighted as string. This is not case with C/C++ files,
          >>> only
          >>> with Python.
          >
          >>> Any suggestions?
          >
          >
          >> __________________________________________________________________________
          >
          >> This is an unmoderated list. JASSPA is not responsible for the content
          >> of
          >> any material posted to this list.
          >
          >> To unsubscribe, send a mail message to
          >
          >> mailto:jasspa-unsubscribe@yahoogroups.com
          >
          >> or visit http://groups.yahoo.com/group/jasspa and
          >> modify your account settings manually.
          >
          >
          >>
          >> Yahoo! Groups Links
          >
          >
          >
          >>
          >
          >
          >
          >
          > __________________________________________________________________________
          >
          > This is an unmoderated list. JASSPA is not responsible for the content of
          > any material posted to this list.
          >
          > To unsubscribe, send a mail message to
          >
          > mailto:jasspa-unsubscribe@yahoogroups.com
          >
          > or visit http://groups.yahoo.com/group/jasspa and
          > modify your account settings manually.
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
        • Steven Phillips
          Hmmm... That makes it a lot more tricky, fundamentally this breaks the hilighting as you cannot determine whether a is the start or end of the string
          Message 4 of 7 , Apr 6, 2006
          • 0 Attachment
            Hmmm... That makes it a lot more tricky, fundamentally this breaks the
            hilighting as you cannot determine whether a """ is the start or end of the
            string without starting at the very top of the file and working down to it.

            Will need to find some way of constraining it...

            Steve

            > Subject: [jasspa] python hilight 2
            > From: Jiri Vit <jirivit@...>
            > Date: Wednesday, April 5, 2006, 8:57:07 AM
            > To: jasspa@yahoogroups.com
            > Unfortunately long python string begins and ends only with '"""'. All
            > strings between the triple-quotes are
            > part of string data.

            > For details look at this:
            > http://docs.python.org/ref/strings.html

            > From the python tutorial:
            > ---------------------------
            > Strings can be surrounded in a pair of matching triple-quotes: """ or '''.
            > End of lines do not need to be escaped when using triple-quotes, but they
            > will be included in the string.

            > Examples:

            > print """
            > Usage: thingy [OPTIONS]
            > -h Display this usage message
            > -H hostname Hostname to connect to
            > """

            > produces the following output:


            > Usage: thingy [OPTIONS]
            > -h Display this usage message
            > -H hostname Hostname to connect to



            > On Tue, 04 Apr 2006 23:52:54 +0200, Steven Phillips <bill@...>
            > wrote:

            >> I found the original email (missed it first time around), the example
            >> suggests
            >> the python format is:
            >>
            >> """<...
            >>
            >>> """
            >>
            >> I have utilized the '<' and '>' attached to the """ so please let me
            >> know if
            >> this is unwise (with examples!). Given this I propose the following:
            >>
            >> 0 hilight .hilight.python 2 50 $global-scheme
            >> hilight .hilight.python 2 "#" .scheme.comment
            >> hilight .hilight.python 4 "\"\"\"<" ">\"\"\"" "\\" .scheme.string
            >> hilight .hilight.python 0 ">\"\"\"" .scheme.string
            >> hilight .hilight.python 0x804 "\"" "\"" "\\" .scheme.string
            >> hilight .hilight.python 0 "\\[" .scheme.string
            >> hilight .hilight.python 0 "\\]" .scheme.string
            >> ; Quote
            >> hilight .hilight.python 0x804 "'" "['\n]" "\\" .scheme.quote
            >> ; Variables
            >>
            >> This should work with ME0505 although I have only tested with the latest
            >> version.
            >>
            >> Steve
            >>
            >>> Subject: [jasspa] python hilight 2
            >>> From: Jiri Vit <jirivit@...>
            >>> Date: Tuesday, April 4, 2006, 12:28:46 PM
            >>> To: jasspa@yahoogroups.com
            >>> Hi list,
            >>
            >>> I am new here and I have found an old message without answer:
            >>
            >>> I solved the python string highlight problem with:
            >>
            >>> 1.
            >>> Edit hkpython.emf and change hi-light look-back. For example:
            >>
            >>> 0 hilight .hilight.python 2 50 $global-scheme
            >>
            >>> 2.
            >>> Then add a little comment after string definition in python source file:
            >>
            >>> source.py:
            >>> --------------file -------------------
            >>> """
            >>> very
            >>> long
            >>> python
            >>> string
            >>> """
            >>> #""" - add this comment
            >>> ------------- EOF ---------------------
            >>
            >>> I know that's not the cleanest way, but it works for me well ;-)
            >>
            >>> Jiri
            >>
            >>>> From: "Bosko Markovic" <bosko.m@...>Date: Sat Oct 8, 2005 11:32 am
            >>>> Subject: python hilight 2 bosko.m@...Send Email
            >>
            >>>> There is another issue with highlighting. Single quotes or triple
            >>>> quotes
            >>>> that
            >>>> are first from the top of screen are considered as starting quotes, and
            >>>> code
            >>>> below them is highlighted as string. This is not case with C/C++ files,
            >>>> only
            >>>> with Python.
            >>
            >>>> Any suggestions?
            >>
            >>
            >>> __________________________________________________________________________
            >>
            >>> This is an unmoderated list. JASSPA is not responsible for the content
            >>> of
            >>> any material posted to this list.
            >>
            >>> To unsubscribe, send a mail message to
            >>
            >>> mailto:jasspa-unsubscribe@yahoogroups.com
            >>
            >>> or visit http://groups.yahoo.com/group/jasspa and
            >>> modify your account settings manually.
            >>
            >>
            >>>
            >>> Yahoo! Groups Links
            >>
            >>
            >>
            >>>
            >>
            >>
            >>
            >>
            >> __________________________________________________________________________
            >>
            >> This is an unmoderated list. JASSPA is not responsible for the content of
            >> any material posted to this list.
            >>
            >> To unsubscribe, send a mail message to
            >>
            >> mailto:jasspa-unsubscribe@yahoogroups.com
            >>
            >> or visit http://groups.yahoo.com/group/jasspa and
            >> modify your account settings manually.
            >>
            >>
            >> Yahoo! Groups Links
            >>
            >>
            >>
            >>
            >>
            >>




            > __________________________________________________________________________

            > This is an unmoderated list. JASSPA is not responsible for the content of
            > any material posted to this list.

            > To unsubscribe, send a mail message to

            > mailto:jasspa-unsubscribe@yahoogroups.com

            > or visit http://groups.yahoo.com/group/jasspa and
            > modify your account settings manually.


            >
            > Yahoo! Groups Links



            >
          Your message has been successfully submitted and would be delivered to recipients shortly.