Commit graph

35 commits

Author SHA1 Message Date
Dan
c8030df9ee
fix(python): repl: respect python-shell-dedicated 2023-02-23 00:34:37 -05:00
Henrik Lissner
a18ea683d2
refactor(python): autoload syntax highlighter fix for 28.1
A summary of the issue:
- emacs-mirror/emacs@c44908c059 broke syntax highlighting for
  python-mode.
- emacs-mirror/emacs@a8acb9516e fixes the issue shortly after, but the
  fix did not make it into the 28.1 release (but made it into 28.2).
- This fix was deployed in #6414 (773122f1ec).
- This commit ensures the fix is only effective for 28.1 users, and
  documents it for posterity.

Ref: #6414
Ref: emacs-mirror/emacs@c44908c059
Ref: emacs-mirror/emacs@a8acb9516e
Amend: 773122f1ec
Co-authored-by: dani84bs <dani84bs@users.noreply.github.com>
2022-09-16 01:14:20 +02:00
Henrik Lissner
ad6a3d0f33
refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
Henrik Lissner
1c99aed0c0
Add +python-{ipython,jupyter}-command vars for REPLs 2020-08-25 21:22:56 -04:00
Henrik Lissner
f2c9e40d44
Load python on REPL commands
To fix 'void-variable python-shell-interpreter' and similar errors.
2020-05-14 01:53:41 -04:00
Rakan Alhneiti
304af70000
Update optimize import to use py-isort 2019-12-15 16:50:31 +01:00
Henrik Lissner
7a34c56e52
lang/python: don't update buffer-dedicated REPLs 2019-12-05 16:21:08 -05:00
Étienne BERSAC
16ea03df4d
Set python version from .python-version file
This allow Doom Emacs to behave like shims, and respect Pyenv version
chosen by .python-version file.

Stolen from b252d252b0/layers/+lang/python/funcs.el (198).
2019-10-04 08:56:25 +02:00
uelei
2b0cb80138
sort python imports 2019-08-09 20:09:18 -03:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Henrik Lissner
c705ceeb4c
lang/python: fix conda+repl integration #1494 2019-06-15 00:38:13 +02:00
Henrik Lissner
fbf4f78e8e
Fix +python-executable-find with absolute paths 2019-05-21 17:24:23 -04:00
Henrik Lissner
35321e8b42
Fix conda python version detection in first buffer
Reported by @ztlevi
2019-03-05 02:30:14 -05:00
Henrik Lissner
f515bf5931
lang/python: fix conda/virtualenv modeline segment
Reported by @ztlevi
2019-03-04 20:48:52 -05:00
Henrik Lissner
8832737671
Adopt seagle0128/doom-modeline for :ui modeline
And remove obsolete :ui doom-modeline module.

Relevant to: #136, #921
2019-03-02 01:34:14 -05:00
Henrik Lissner
812c834970
lang/python: fix ipython repl & change args type
+python-ipython-repl-args and +python-jupyter-repl-args are now lists,
rather than strings.
2019-02-28 04:10:35 -05:00
Henrik Lissner
94b16cba6c
Standardize REPL commands & improve SPC o r
- SPC o r now prompts for a REPL to open when none was found for the
  current buffer.
- REPL handlers must now follow the naming convention "*/open*-repl".
  e.g. +python/open-ipython-repl, +emacs-lisp/open-repl, etc.
- +eval/open-repl has been split in two:
  - +eval/open-repl-other-window
  - +eval/open-repl-same-window
2019-02-18 01:59:56 -05:00
Henrik Lissner
4455dc8baa
Extract ipython/jupyter arglist to variables
Also fixes #1022 by removing default --pylab arg from
+python/open-ipython-repl.
2018-12-05 14:31:02 -05:00
Henrik Lissner
ba93402dcc
lang/python: fix typo in +python-version
Thanks to @ztlevi
2018-10-07 00:46:50 -04:00
Henrik Lissner
9185da824c
lang/python: remove +ipython flag
+ Replace +ipython functionality with +python/open-ipython-repl command.
+ Use python-shell-interpreter for eval handlers, repl and python
  version detection.
+ Removed various python-shell-* variables for ipython; they are already
  supported upstream.
2018-10-06 20:44:25 -04:00
Henrik Lissner
7c6e2e705f
lang/python: add Ipython/Jupyter REPL commands 2018-10-06 20:44:25 -04:00
Henrik Lissner
63b195b133
lang/python: fix stringp errors when opening REPL
Caused my misuse of if-let* to let-bind dynamic variables. The expanded
code doesn't quite work out the way I expected, causing
python-shell-interpreter to be nil regardless of which side of the
if-else statement ran.
2018-10-02 23:52:29 -04:00
Henrik Lissner
53fe7a1f04 Refactor Project API to reflect changes upstream
projectile-project-root no longer returns `default-directory` if not in
a project (it returns nil). As such, doom-project-* functions (and their
uses) have been refactored.

+ doom-project-p & doom-project-root are aliases for
  projectile-project-p & projectile-project-root.
+ doom-project-{p,root,name,expand} now has a DIR argument (for
  consistency, since projectile-project-name and
  projectile-project-expand do not).
+ The nocache parameter is no longer necessary, as projectile's caching
  behavior is now more sane.
+ Removed some projectile advice/hacks that are no longer necessary.
+ Updated unit tests
2018-09-28 21:13:27 -04:00
Henrik Lissner
da55ee2af2
lang/python: fix pipenv support for +python/repl 2018-09-26 20:37:35 -04:00
Henrik Lissner
68699c3d5b
lang/python: make repl/eval handlers respect pipenv 2018-09-26 12:28:32 -04:00
Henrik Lissner
4e0a4e1b51
lang/{ruby,python}: Fix advice arguments errors 2018-09-26 09:57:10 -04:00
Henrik Lissner
b91a8f0d2f
lang/python: rewrite modeline version segment
+ Add $PYENV_ROOT/shims was added to exec-path, so pyenv python version
  is picked up on.
+ Fixes out-of-date python version in the modeline of other buffers
  after switching pyenv/pyvenv/conda envs.
+ The pipenv version and regular python display have been merged.
2018-09-25 22:17:41 -04:00
Henrik Lissner
ccaa642d98
lang/python: fix pipenv creating Pipfiles in pwd #888
`pipenv run ...` searches for a Pipfile itself, but doesn't search far
enough, creating a Pipfile in the current directory. Instead, we run the
command from the pipenv project root so it doesn't have to search.
2018-09-21 13:33:19 -04:00
Henrik Lissner
9b11f8e76d
lang/python: remove +python-conda-env (unused) 2018-08-01 22:32:29 +02:00
Henrik Lissner
e053234992
lang/python: fix anaconda ignoring conda envs 2018-08-01 22:29:51 +02:00
Henrik Lissner
560d16d651
lang/python: add support for more env managers
+ Rewritten +conda support
+ Adds +pyenv and +pyvenv flags with support.
+ New +ipython flag to enable ipython REPL support
+ Added pipenv support. This is the new default, instead of pyenv, and
  isn't hidden behind a module flag because it is officially endorsed by
  python.

Addresses #736
2018-07-31 15:51:25 +02:00
Henrik Lissner
e8d4b74c29
lang/python: refactor conda integration
Removes the +python-conda-home variable and guesses conda-anaconda-home
at startup.
2018-07-17 22:07:35 +02:00
Henrik Lissner
bb1171b64b
lang/python/autoload.el -> autoload/python.el 2018-07-17 20:57:32 +02:00
fuxialexander
732c2979c4 Naming convention and add docs; Avoid conflicting pyenv. 2018-06-07 01:08:49 +08:00
Edmund Miller
686d102ee7 Add conda 2018-06-04 18:42:15 -05:00