gregsexton / origami.el

A folding minor mode for Emacs
516 stars 41 forks source link

modified python-parser code for building multi level fold tree. #64

Closed Csomnia closed 4 years ago

Csomnia commented 6 years ago

55

sawan commented 6 years ago

Thank you, this works for second level nodes -- tested via patching latest from ELPA.

But not for anything indented beyond that for, examples nested loops, try-catch, etc. Is it possible to have these? As they are clearly indentation dependent.

wbolster commented 6 years ago

@sawan you could try removing the python specific parser from origami-parser-alist. i think the fallback is purely indentation based.

sawan commented 6 years ago

Ah... how do I do that please?

wbolster commented 6 years ago

many ways to do it. easiest is via the customize interface:

M-x customize-variable RET origami-parser-alist RET
wbolster commented 6 years ago

alternatively, with imenu parsing from #69 python looks like this:

image

VelikiiNehochuha commented 4 years ago

Done python parser for any block of codes (if try for, etc.. ) https://github.com/gregsexton/origami.el/pull/91

gregsexton commented 4 years ago

This is great.

conao3 commented 4 years ago

This change pollutes the user's python- namespace because it defines a python-subparser globally. I recommend revert it.

wbolster commented 4 years ago

hey @conao3 maybe don't pop out of nowhere to shout negative things. it's rude behaviour.

instead, you could have written something this:

'it seems this change introduced a function that looks like it's on the global python namespace (python-subparser), and it doesn't belong there. i suggest renaming it to origami-python-subparser. let me know if i should open a pull request for this.'

see the difference? no bitching, no mention of blindly reverting (counterproductive suggestion) but an actionable improvement with an offer to help.

in fact, opening a pull request to improve the situation would probably have taken you less time than writing your negative comment.

you're welcome.

conao3 commented 4 years ago

In fact, I think it's better to use lambda or cl-flet than to use origami-python- prefixes. It seems a bit odd to dynamically declare a global function in some function...

gregsexton commented 4 years ago

I'll merge a PR

alphapapa commented 4 years ago

hey @conao3 maybe don't pop out of nowhere to shout negative things. it's rude behaviour.

instead, you could have written something this:

'it seems this change introduced a function that looks like it's on the global python namespace (python-subparser), and it doesn't belong there. i suggest renaming it to origami-python-subparser. let me know if i should open a pull request for this.'

see the difference? no bitching, no mention of blindly reverting (counterproductive suggestion) but an actionable improvement with an offer to help.

in fact, opening a pull request to improve the situation would probably have taken you less time than writing your negative comment.

you're welcome.

@wbolster Naoya and I have our differences sometimes, but I'll stand up for him here. He simply observed a problem. He was not rude.

In contrast, your comment was very rude and completely uncalled for. What you accuse him of doing is actually what you have done.

There are real people on the other end of these screens. What we're talking about is just code. There's no need to be hostile.

conao3 commented 4 years ago

While we may get confused about saying thank you, I simply want to say. Thank you, @alphapapa.

Anyway, it's been over a week without any corrections since I reported. @gregsexton needs to fulfill its responsibilities as the owner of this project.

This package has many users and 56,000 over DLs from MELPA. If @gregsexton are tired and do not want to manage this package in the future, you may want to transfer it to emacsorphanage and let someone else manage it.

FYI: @jcs090218

wbolster commented 4 years ago

Anyway, it's been over a week without any corrections since I reported.

@gregsexton made it clear that he would merge a pr and since you have a clear idea on what the best fix would look like, a pull request is the way to get this issue to move forward.

in any case, let's keep the right perspective: this seems a cosmetic issue only, and there is really no need to talk about

@gregsexton needs to fulfill its responsibilities as the owner of this project

when a cosmetic issue isn't addressed within a few days.