unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* commends in Python mode
@ 2006-12-25 22:30 Paul Pogonyshev
  2006-12-27 12:16 ` Steven Huwig
  2007-01-05  4:57 ` commends " Stefan Monnier
  0 siblings, 2 replies; 13+ messages in thread
From: Paul Pogonyshev @ 2006-12-25 22:30 UTC (permalink / raw)


Try inputting the following in a Python mode buffer:

test = (1,
        # Apostrophe: '
        2)

You can see that the apostrophe breaks sexp scanning (the closing
paren is not paired with the opening) and probably more.  This
doesn't happen in e.g. C-mode, so it is a problem of Python mode.

Paul

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: commends in Python mode
  2006-12-25 22:30 commends in Python mode Paul Pogonyshev
@ 2006-12-27 12:16 ` Steven Huwig
  2006-12-27 17:07   ` comments " Paul Pogonyshev
  2007-01-05  4:57 ` commends " Stefan Monnier
  1 sibling, 1 reply; 13+ messages in thread
From: Steven Huwig @ 2006-12-27 12:16 UTC (permalink / raw)
  Cc: emacs-devel


On Dec 25, 2006, at 5:30 PM, Paul Pogonyshev wrote:

> Try inputting the following in a Python mode buffer:
>
> test = (1,
>         # Apostrophe: '
>         2)
>
> You can see that the apostrophe breaks sexp scanning (the closing
> paren is not paired with the opening) and probably more.  This
> doesn't happen in e.g. C-mode, so it is a problem of Python mode.
>
> Paul

This example works for me in a recent build from CVS. Are you
using python.el from Emacs 22, or the old python-mode.el?


-- Steve

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: comments in Python mode
  2006-12-27 12:16 ` Steven Huwig
@ 2006-12-27 17:07   ` Paul Pogonyshev
  2006-12-27 19:21     ` Steven Huwig
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Pogonyshev @ 2006-12-27 17:07 UTC (permalink / raw)
  Cc: Steven Huwig

Steven Huwig wrote:
> 
> On Dec 25, 2006, at 5:30 PM, Paul Pogonyshev wrote:
> 
> > Try inputting the following in a Python mode buffer:
> >
> > test = (1,
> >         # Apostrophe: '
> >         2)
> >
> > You can see that the apostrophe breaks sexp scanning (the closing
> > paren is not paired with the opening) and probably more.  This
> > doesn't happen in e.g. C-mode, so it is a problem of Python mode.
> >
> > Paul
> 
> This example works for me in a recent build from CVS. Are you
> using python.el from Emacs 22, or the old python-mode.el?

Weird, because I just tested and sexp scanning is still broken.  I
updated from CVS, opened `python.el' and invoked `eval-buffer'.  No
change.

Paul

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: comments in Python mode
  2006-12-27 17:07   ` comments " Paul Pogonyshev
@ 2006-12-27 19:21     ` Steven Huwig
  2007-01-04  0:08       ` Chris Moore
  0 siblings, 1 reply; 13+ messages in thread
From: Steven Huwig @ 2006-12-27 19:21 UTC (permalink / raw)
  Cc: Steven Huwig, emacs-devel


On Dec 27, 2006, at 12:07 PM, Paul Pogonyshev wrote:

> Steven Huwig wrote:
>>
>> On Dec 25, 2006, at 5:30 PM, Paul Pogonyshev wrote:
>>
>>> Try inputting the following in a Python mode buffer:
>>>
>>> test = (1,
>>>         # Apostrophe: '
>>>         2)
>>>
>>> You can see that the apostrophe breaks sexp scanning (the closing
>>> paren is not paired with the opening) and probably more.  This
>>> doesn't happen in e.g. C-mode, so it is a problem of Python mode.
>>>
>>> Paul
>>
>> This example works for me in a recent build from CVS. Are you
>> using python.el from Emacs 22, or the old python-mode.el?
>
> Weird, because I just tested and sexp scanning is still broken.  I
> updated from CVS, opened `python.el' and invoked `eval-buffer'.  No
> change.


Maybe we are looking at different behavior.  I checked that
show-paren-mode and forward- and backward-sexp worked.  Is that what
you are doing?

I will update my Emacs to the current CVS version; my working build is
a few weeks old.  Maybe it is a regression...

-- Steve

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: comments in Python mode
  2006-12-27 19:21     ` Steven Huwig
@ 2007-01-04  0:08       ` Chris Moore
  2007-01-04 23:59         ` Steven Huwig
  0 siblings, 1 reply; 13+ messages in thread
From: Chris Moore @ 2007-01-04  0:08 UTC (permalink / raw)
  Cc: emacs-devel, Paul Pogonyshev

Steven Huwig <steven.huwig@gmail.com> writes:

> Maybe we are looking at different behavior.  I checked that
> show-paren-mode and forward- and backward-sexp worked.  Is that what
> you are doing?

It's what I'm doing, and it fails for me, using python.el revision
1.52, which hasn't been changed for a month or so.

I've tried lots of older versions of python.el, but they all (1.1,
1.10, 1.20, 1.30, 1.40, 1.49 - 1.52) exhibit the same problem.  I
guess the problem is in some other source file.

Here are the backtraces I get:

Debugger entered--Lisp error: (scan-error "Unbalanced parentheses" 8 47)
  scan-sexps(8 1)
  forward-sexp(1)
  call-interactively(forward-sexp)

Debugger entered--Lisp error: (scan-error "Unbalanced parentheses" 45 1)
  scan-sexps(46 -1)
  forward-sexp(-1)
  backward-sexp(1)
  call-interactively(backward-sexp)

Chris.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: comments in Python mode
  2007-01-04  0:08       ` Chris Moore
@ 2007-01-04 23:59         ` Steven Huwig
  2007-01-05  0:11           ` Paul Pogonyshev
  0 siblings, 1 reply; 13+ messages in thread
From: Steven Huwig @ 2007-01-04 23:59 UTC (permalink / raw)
  Cc: Steven Huwig, emacs-devel, Paul Pogonyshev


On Jan 3, 2007, at 7:08 PM, Chris Moore wrote:

> Steven Huwig <steven.huwig@gmail.com> writes:
>
>> Maybe we are looking at different behavior.  I checked that
>> show-paren-mode and forward- and backward-sexp worked.  Is that what
>> you are doing?
>
> It's what I'm doing, and it fails for me, using python.el revision
> 1.52, which hasn't been changed for a month or so.
>
> I've tried lots of older versions of python.el, but they all (1.1,
> 1.10, 1.20, 1.30, 1.40, 1.49 - 1.52) exhibit the same problem.  I
> guess the problem is in some other source file.

Well, I rebuilt my emacs from CVS on Jan 1, and it still works fine
for me.  This is quite strange.

Is there anyone else *besides* me that can input

test = (1,
         # Apostrophe: '
         2)

into a Python buffer and have the sexp-based commands work correctly?

-- Steve

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: comments in Python mode
  2007-01-04 23:59         ` Steven Huwig
@ 2007-01-05  0:11           ` Paul Pogonyshev
  2007-01-05  0:45             ` Steven Huwig
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Pogonyshev @ 2007-01-05  0:11 UTC (permalink / raw)
  Cc: Chris Moore, Steven Huwig

Steven Huwig wrote:
> Well, I rebuilt my emacs from CVS on Jan 1, and it still works fine
> for me.  This is quite strange.
> 
> Is there anyone else *besides* me that can input
> 
> test = (1,
>          # Apostrophe: '
>          2)
> 
> into a Python buffer and have the sexp-based commands work correctly?

Maybe you have customized something.  Try running `emacs -Q' (gives
the same incorrect behavior here with sources of today CVS.)

Paul

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: comments in Python mode
  2007-01-05  0:11           ` Paul Pogonyshev
@ 2007-01-05  0:45             ` Steven Huwig
  0 siblings, 0 replies; 13+ messages in thread
From: Steven Huwig @ 2007-01-05  0:45 UTC (permalink / raw)
  Cc: Chris Moore, Steven Huwig, emacs-devel


On Jan 4, 2007, at 7:11 PM, Paul Pogonyshev wrote:

> Steven Huwig wrote:
>> Well, I rebuilt my emacs from CVS on Jan 1, and it still works fine
>> for me.  This is quite strange.
>>
>> Is there anyone else *besides* me that can input
>>
>> test = (1,
>>          # Apostrophe: '
>>          2)
>>
>> into a Python buffer and have the sexp-based commands work correctly?
>
> Maybe you have customized something.  Try running `emacs -Q' (gives
> the same incorrect behavior here with sources of today CVS.)
>
> Paul

Of course that was the problem.  Sorry for the confusion.  I load CEDET
and it probably handles the case better.

Too much holiday food befuddled my brain, maybe. :-)

-- Steve

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: commends in Python mode
  2006-12-25 22:30 commends in Python mode Paul Pogonyshev
  2006-12-27 12:16 ` Steven Huwig
@ 2007-01-05  4:57 ` Stefan Monnier
  2007-01-05 12:05   ` Chris Moore
  2007-01-06  2:54   ` Richard Stallman
  1 sibling, 2 replies; 13+ messages in thread
From: Stefan Monnier @ 2007-01-05  4:57 UTC (permalink / raw)
  Cc: emacs-devel

> Try inputting the following in a Python mode buffer:
> test = (1,
>         # Apostrophe: '
>         2)

> You can see that the apostrophe breaks sexp scanning (the closing
> paren is not paired with the opening) and probably more.  This
> doesn't happen in e.g. C-mode, so it is a problem of Python mode.

I believe you're just suffering the consequences of having
parse-sexp-ignore-comments set to nil.  IMO it should always be set to t,
but for some reason it defaults to nil.


        Stefan

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: commends in Python mode
  2007-01-05  4:57 ` commends " Stefan Monnier
@ 2007-01-05 12:05   ` Chris Moore
  2007-01-05 19:59     ` Paul Pogonyshev
  2007-01-06  2:54   ` Richard Stallman
  1 sibling, 1 reply; 13+ messages in thread
From: Chris Moore @ 2007-01-05 12:05 UTC (permalink / raw)
  Cc: emacs-devel, Paul Pogonyshev

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> I believe you're just suffering the consequences of having
> parse-sexp-ignore-comments set to nil.  IMO it should always be set to t,
> but for some reason it defaults to nil.

Setting parse-sexp-ignore-comments to t fixes the bug for me.

Is there a good reason why it defaults to nil, or is this another of
the things we're not allowed to talk about?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: commends in Python mode
  2007-01-05 12:05   ` Chris Moore
@ 2007-01-05 19:59     ` Paul Pogonyshev
  2007-01-06 18:07       ` Richard Stallman
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Pogonyshev @ 2007-01-05 19:59 UTC (permalink / raw)
  Cc: Chris Moore, Stefan Monnier

Chris Moore wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> > I believe you're just suffering the consequences of having
> > parse-sexp-ignore-comments set to nil.  IMO it should always be set to t,
> > but for some reason it defaults to nil.
> 
> Setting parse-sexp-ignore-comments to t fixes the bug for me.
> 
> Is there a good reason why it defaults to nil, or is this another of
> the things we're not allowed to talk about?

Glad the source of the problem is clear now.  It makes to set default
to t to me too, but if it is not done, let's make Python mode at least
set it in its buffers.

Paul

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: commends in Python mode
  2007-01-05  4:57 ` commends " Stefan Monnier
  2007-01-05 12:05   ` Chris Moore
@ 2007-01-06  2:54   ` Richard Stallman
  1 sibling, 0 replies; 13+ messages in thread
From: Richard Stallman @ 2007-01-06  2:54 UTC (permalink / raw)
  Cc: emacs-devel, pogonyshev

    I believe you're just suffering the consequences of having
    parse-sexp-ignore-comments set to nil.  IMO it should always be set to t,
    but for some reason it defaults to nil.

After the release, we could try changing the default to t.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: commends in Python mode
  2007-01-05 19:59     ` Paul Pogonyshev
@ 2007-01-06 18:07       ` Richard Stallman
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Stallman @ 2007-01-06 18:07 UTC (permalink / raw)
  Cc: dooglus, monnier, emacs-devel

    Glad the source of the problem is clear now.  It makes to set default
    to t to me too, but if it is not done, let's make Python mode at least
    set it in its buffers.

If people are sure this gives good results in Python mode, I am not
against it.  To change the default is too big for right now, but a
change limited to Python mode is small enough to be ok if Python
users find it good.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-01-06 18:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-25 22:30 commends in Python mode Paul Pogonyshev
2006-12-27 12:16 ` Steven Huwig
2006-12-27 17:07   ` comments " Paul Pogonyshev
2006-12-27 19:21     ` Steven Huwig
2007-01-04  0:08       ` Chris Moore
2007-01-04 23:59         ` Steven Huwig
2007-01-05  0:11           ` Paul Pogonyshev
2007-01-05  0:45             ` Steven Huwig
2007-01-05  4:57 ` commends " Stefan Monnier
2007-01-05 12:05   ` Chris Moore
2007-01-05 19:59     ` Paul Pogonyshev
2007-01-06 18:07       ` Richard Stallman
2007-01-06  2:54   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).