wavexx / python-x.el Goto Github PK
View Code? Open in Web Editor NEWpython.el extras for interactive evaluation
Home Page: https://melpa.org/#/python-x
License: GNU General Public License v3.0
python.el extras for interactive evaluation
Home Page: https://melpa.org/#/python-x
License: GNU General Public License v3.0
I would guess one of the first thing people would like to know is how to set the section delimiter. Many IDEs use "# %%". While everything is documented very well, a comment in the readme would be helpful:
(setq python-section-delimiter "# %%")
Hi. I love this new project. Thanks!
Currently all evaluation commands don't show output. As an ESS user, that's extremely annoying. I don't even know if the command finished or not.
Looking at the difference between standard evaluation commands and python-shell-print-region-or-symbol
I see it's all about python-shell-buffer-substring
wrapper. I haven't investigated this further. Is there a way to make python print last value automatically?
For some reason , I had to install this file https://raw.githubusercontent.com/jaalto/project-emacs--folding-mode/master/folding.el.
I am probably one of the few who uses Python like R. Since you mentionned ESS, would it be possible to simply have the equivalent of the following in python :
ess-eval-region-or-function-or-paragraph = C-M x
ess-eval-region-or-function-or-paragraph-and-step = C-c C-c
i.e. use paragraph instead of folding
delimiters.
While familiarizing myself with the code base I noticed that hijacking the prefix from python.el makes the code comprehension and navigation a bit difficult. It's hard to mentally separate the projects.
Before the package is too big, would you consider switching to a package prefix? Maybe pythonx
or pyx
?
I think the whole evaluation system could be effectively narrowed to 4 versatile functions:
send-region-fold-or-section-or-defun-or-paragraph
(no output by default)send-region-fold-or-section-or-defun-or-paragraph-and-step
(no output by default)send-region-or-line
(with output)send-region-or-line-and-step
(with output)send-buffer
The current python-shell-print-region-or-symbol
should be deprecated by an inspector as proposed in #3.
I think dwim
name is opaque. Longer and explicit names like above are more suggestive IMO. Currently send-dwim
is most closely related to 2 but is not as flexible.
Alternatively there could be send-dwim
and send-dwim-and-step
and a configuration variable with a list of expansions '(fold region section defun paragraph)
that users can customize. Something like (er/try-expansions)
.
The above system would fit nicely into ESS aswell without breaking anything. 1 would be hooked on C-M-x
and 2 on C-c C-c
.
What do you think? Would it make sense to strive for uniform and clean UI as above?
#---
send
functions to skip with # --- #
In ess (R dialect) you get C-c C-d C-e (with last C-e cycling). It cycles through concise representation of objects defined in:
ess-R-describe-object-at-point-commands is a variable defined in ‘ess-custom.el’.
Its value is (("str(%s)")
("htsummary(%s, hlength = 20, tlength = 20)")
("summary(%s, maxsum = 20)"))
I am using it hundreds of times a day and feel like stupid in python without it. Do you think it would be difficult to device something like that for python-x?
Is there a generic function that that would work on all python objects by constructing hierarchical representation with a short summary for each field (like str
in R)?
Just made the switch, but I noticed that several behaviors changed in python-mode. Most of the send-buffer machinery works, but process tracking doesn't anymore.
There are also some new behaviors that I don't like (such as defaulting to shared processes by default). This might actually be a good argument for forking the mode and starting clean :/
I'll be moving my source repositories to GitLab (https://gitlab.com/wavexx/) during the next few days.
I've been waiting to do this for a long time (at least since 2015) but I never switched because of network effects. I'll now use the acquisition news as an excuse to jump the shark!
This repository will be turned into a read-only archive after the migration and effectively become stale.
Since all issues and PR will be mirrored on gitlab, I'll also close all of them in github and reference this issue to make sure this is not going to be ignored.
See you on the other side!
The current implementation of python-shell-switch-to-buffer
is not very practical. It stores the buffer from where the process was started. After some time that buffer need not even exists.
I think the most meaningful would be to return to either the most recent python buffer or the last buffer from where the evaluation or switch to inferiror happened. This is how ESS and Elpy, for what matter, does.
Shall I propose a pull?
python.el's management of processes is too simplistic: You can either have a single global process, or a dedicated process per-buffer. Since you cannot select/associate buffers to processes, I always end up creating dedicated processes, but then have to resort to manual yanking into the process's buffer to evaluate code that I'm debugging in a library.
The simplest behavior I can think of to fix this is:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.