From barry at python.org Wed May 2 15:47:48 2007 From: barry at python.org (Barry Warsaw) Date: Wed, 2 May 2007 09:47:48 -0400 Subject: [Python-mode] Underscore syntax class In-Reply-To: <871wi6h43c.fsf@unicorn.ahiker.homeip.net> References: <871wi6h43c.fsf@unicorn.ahiker.homeip.net> Message-ID: <846FF76D-2054-4963-A79D-9C78AFBFD6AD@python.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Apr 26, 2007, at 11:46 PM, Ian Zimmerman wrote: > This has the feel of a faq. If there was a FAQ, it would be. ;) > Forgive, I am a python newbie, and this > issue, as strange as it may seem to you, could stop me from studying > python further. I hope it doesn't. Python is so much more than python-mode. A question, are you an FSF Emacs user or a XEmacs user? I ask because my understanding is that FSF Emacs has its own python-mode these days that's different than ours. I think most of the devs on this list use XEmacs, though of course we want it to be FSF Emacs compatible. FSF Emacs python-mode maintainer doesn't communicate with us, AFAIK. As for underscore in word class, the "historical" part is that Guido liked it that way, so that's the way it stayed. I understand what you're saying though. My suggestion would be to try rebinding it. It seems like you know enough about how to do that and what to look for in breakage, and probably also how to fix such breakage. Speaking solely for myself, I think we would accept patches that allowed python-mode to work either way, perhaps keyed off a new configuration variable (py- historical-underscore-behavior-p ?). If you can come up with such patches, and it works on both XEmacs and FSF Emacs, let us know and we'd consider applying them. - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iQCVAwUBRjiWhXEjvBPtnXfVAQLNYQP9ELl7MnjF6/8GQTmIAt9aZrW3hMWtRLD9 isCr33GkxK1XmiVJvodq1Eb4aKCM5ujS+B7FM6duHihC1Mg0fIVq8yD2Ki6JTQpc 41ox5q3nSnonTfvfOf0vjv14vsvnpZnhcHE/mxevLbxAJacf8t7IMWOE6FauVxYl YDZ4QdBYmr0= =ADUh -----END PGP SIGNATURE----- From tromey at redhat.com Wed May 2 18:36:06 2007 From: tromey at redhat.com (Tom Tromey) Date: Wed, 02 May 2007 10:36:06 -0600 Subject: [Python-mode] Underscore syntax class References: <871wi6h43c.fsf@unicorn.ahiker.homeip.net> Message-ID: >>>>> "Ian" == Ian Zimmerman writes: Ian> (re-search-backward "\") Ian> (with-syntax-table internal-python-syntax-table Ian> (re-search-backward "\)) FWIW in Emacs 22 you can use (re-search-backward "\\_"). >From NEWS: *** New regular expression operators, `\_<' and `\_>'. These match the beginning and end of a symbol. A symbol is a non-empty sequence of either word or symbol constituent characters, as specified by the syntax table. Tom From barry at python.org Wed May 2 23:25:28 2007 From: barry at python.org (Barry Warsaw) Date: Wed, 2 May 2007 17:25:28 -0400 Subject: [Python-mode] Underscore syntax class In-Reply-To: <874pmve0in.fsf@unicorn.ahiker.homeip.net> References: <871wi6h43c.fsf@unicorn.ahiker.homeip.net> <846FF76D-2054-4963-A79D-9C78AFBFD6AD@python.org> <874pmve0in.fsf@unicorn.ahiker.homeip.net> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Ian, On May 2, 2007, at 10:57 AM, Ian Zimmerman wrote: > Barry> A question, are you an FSF Emacs user or a XEmacs user? I ask > Barry> because my understanding is that FSF Emacs has its own > Barry> python-mode these days that's different than ours. I think > most > Barry> of the devs on this list use XEmacs, though of course we > want it > Barry> to be FSF Emacs compatible. FSF Emacs python-mode maintainer > Barry> doesn't communicate with us, AFAIK. Ah Supercite. A blast from the past. :) > I see. Indeed I am a GNU Emacs user. I decided not to use the > packaged > python mode because it seems to be inextricably twined with pymacs, > a huge beast of full IDE that I don't have a use for. I didn't > know the > module I picked up (on the Emacs wiki, I think) had an XEmacs flavour. I wouldn't say it has a XEmacs flavor so much as that /currently/ AFAIK, most of the developers are XEmacs users. I didn't know about the pymacs thing in the FSF version, but yeah I'm with you. IDEs are for kids. :) > Barry> My suggestion would be to try rebinding it. It seems like you > Barry> know enough about how to do that and what to look for in > Barry> breakage, and probably also how to fix such breakage. Speaking > Barry> solely for myself, I think we would accept patches that allowed > Barry> python-mode to work either way, perhaps keyed off a new > Barry> configuration variable (py- historical-underscore-behavior- > p ?). > > I have already done this and gone through the places where it is > necessary to locally reset the syntax table, there are a fair number > (about ~20). After changing those rebinding seems to have no ill > effects. > > Barry> If you can come up with such patches, and it works on both > XEmacs > Barry> and FSF Emacs, let us know and we'd consider applying them. > > I am not going to install XEmacs for this purpose, so I hope you can > provide these answers which will determine if this is worth trying: > > 1) Does XEmacs allow specifying syntax overrides in font-lock- > defaults, > like this: > > (setq font-lock-defaults '(python-font-lock-keywords nil nil ((?_ . > "w")))) Yes, it looks like it. > 2) Does XEmacs have the with-syntax-table macro? Yes. Feel free to post your changes to SF. Hopefully one of us can get around to trying your changes out in XEmacs and if it looks good, we can apply it to current svn. - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iQCVAwUBRjkByXEjvBPtnXfVAQJQMAP/WciuISL4vEAYU1Ezk4MwOg/w/yxfSKEG rmXZWtGLE339bDdgt8dyMHvqmSW8p2ZLvciFjLeXDTLU69drgXp73679v2MwBqXk /6m7K+Z9DTnkABhpJJEHZM6LPWlME4qnj+uf/+HRyxqHzC279H9K3YW0GkMKB38I disGeOKL5ks= =PbmS -----END PGP SIGNATURE----- From itz at madbat.mine.nu Wed May 2 16:57:36 2007 From: itz at madbat.mine.nu (Ian Zimmerman) Date: 02 May 2007 10:57:36 -0400 Subject: [Python-mode] Underscore syntax class In-Reply-To: <846FF76D-2054-4963-A79D-9C78AFBFD6AD@python.org> References: <871wi6h43c.fsf@unicorn.ahiker.homeip.net> <846FF76D-2054-4963-A79D-9C78AFBFD6AD@python.org> Message-ID: <874pmve0in.fsf@unicorn.ahiker.homeip.net> Barry> A question, are you an FSF Emacs user or a XEmacs user? I ask Barry> because my understanding is that FSF Emacs has its own Barry> python-mode these days that's different than ours. I think most Barry> of the devs on this list use XEmacs, though of course we want it Barry> to be FSF Emacs compatible. FSF Emacs python-mode maintainer Barry> doesn't communicate with us, AFAIK. I see. Indeed I am a GNU Emacs user. I decided not to use the packaged python mode because it seems to be inextricably twined with pymacs, a huge beast of full IDE that I don't have a use for. I didn't know the module I picked up (on the Emacs wiki, I think) had an XEmacs flavour. Barry> My suggestion would be to try rebinding it. It seems like you Barry> know enough about how to do that and what to look for in Barry> breakage, and probably also how to fix such breakage. Speaking Barry> solely for myself, I think we would accept patches that allowed Barry> python-mode to work either way, perhaps keyed off a new Barry> configuration variable (py- historical-underscore-behavior-p ?). I have already done this and gone through the places where it is necessary to locally reset the syntax table, there are a fair number (about ~20). After changing those rebinding seems to have no ill effects. Barry> If you can come up with such patches, and it works on both XEmacs Barry> and FSF Emacs, let us know and we'd consider applying them. I am not going to install XEmacs for this purpose, so I hope you can provide these answers which will determine if this is worth trying: 1) Does XEmacs allow specifying syntax overrides in font-lock-defaults, like this: (setq font-lock-defaults '(python-font-lock-keywords nil nil ((?_ . "w")))) 2) Does XEmacs have the with-syntax-table macro? Thanks, Ian. -- This line is completely ham. From itz at madbat.mine.nu Fri May 4 00:02:47 2007 From: itz at madbat.mine.nu (Ian Zimmerman) Date: 03 May 2007 18:02:47 -0400 Subject: [Python-mode] Underscore syntax class In-Reply-To: References: <871wi6h43c.fsf@unicorn.ahiker.homeip.net> <846FF76D-2054-4963-A79D-9C78AFBFD6AD@python.org> <874pmve0in.fsf@unicorn.ahiker.homeip.net> Message-ID: <871whxtvjs.fsf@unicorn.ahiker.homeip.net> A non-text attachment was scrubbed... Name: python-mode.el.diff Type: text/x-diff Size: 6305 bytes Desc: patch to enable (optionally) symbol syntax for underscores Url : http://mail.python.org/pipermail/python-mode/attachments/20070503/d12d69f3/attachment.bin From paul.rudin at ntlworld.com Fri May 18 20:56:33 2007 From: paul.rudin at ntlworld.com (Paul Rudin) Date: Fri, 18 May 2007 19:56:33 +0100 Subject: [Python-mode] fringe breakpoint with pdb Message-ID: <877ir6arku.fsf@rudin.co.uk> I'm running a recent verion emacs 22, and I'm trying to get the breakpoint indicators and setting in the fringe work with pdb. Should this work out of the box? If not can anyone suggest incantations to make it work please? From barry at python.org Fri May 18 21:22:53 2007 From: barry at python.org (Barry Warsaw) Date: Fri, 18 May 2007 15:22:53 -0400 Subject: [Python-mode] fringe breakpoint with pdb In-Reply-To: <877ir6arku.fsf@rudin.co.uk> References: <877ir6arku.fsf@rudin.co.uk> Message-ID: <2AD02EED-166D-4D53-86E8-3FEA30CA419C@python.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On May 18, 2007, at 2:56 PM, Paul Rudin wrote: > I'm running a recent verion emacs 22, and I'm trying to get the > breakpoint indicators and setting in the fringe work with pdb. Should > this work out of the box? If not can anyone suggest incantations to > make it work please? Paul, afaik you're the first person to try python-mode with emacs 22. I have no idea how or if it will work (I don't have emacs 22). Sorry to put you on your own, but let us know how it goes. - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iQCVAwUBRk39DnEjvBPtnXfVAQJrBQP/YWnHD8LlVIAkYHEFj7Kg9lRwDCPLSSE/ 52Rkec+uXxcTSEpoWcrhX4IWr83s4RV1VViM0Y2dKG/9vZIRARl39QmTFxuz0ENU W7l6u/S/hP1DDHaQG7rdad71FPkgDxVcFuxv2ohRfrK9hnw6OrDp5b61mLy1Y4iq oio23hV2uh8= =TXZu -----END PGP SIGNATURE-----