Commit graph

107 commits

Author SHA1 Message Date
Henrik Lissner
77da28f06a
lang/python: use correct executables for flycheck 2019-07-22 02:37:47 +02:00
Henrik Lissner
0a84d2f0a9
core-lib: add auto-minor-mode, revise def-project-mode!
- Adds the auto-minor-mode package to replace our in-house
  implementation.
- Merges associate! into the def-project-mode! macro because associate!
  on its own is less useful than auto-minor-mode-alist,
  auto-minor-mode-magic-alist or hooks.
- Changes the semantics of :modes and :add-hooks properties of
  def-project-mode!. Its arguments are evaluated as is; lists will need
  to be quoted.

squash! core-lib: remove associate! macro
2019-07-22 02:30:39 +02:00
Henrik Lissner
149b2617b0
💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
Henrik Lissner
447af38051
Merge pull request #1416 from Mambu38/feature-pyimport
Added pyimport support
2019-05-28 17:02:33 -04:00
Henrik Lissner
7a252b6a47
Refactor pyimport def-package! block 2019-05-28 17:02:10 -04:00
uelei
936545877a add option to run one function only 2019-05-25 21:01:31 -03:00
Henrik Lissner
f8b359516f
lang/python: set docsets 2019-05-17 21:02:25 -04:00
Mambu38
5e66914fa2 Added pyimport support 2019-05-15 13:17:17 +02:00
Henrik Lissner
c79cf3c820
lang/python: use anaconda-mode for non-project files 2019-04-25 22:20:31 -04:00
Henrik Lissner
2dc52bc9be
💥 Replace exec-path-from-shell w/ 'bin/doom env'
IMPORTANT: This is a breaking update for Mac users, as your shell
environment will no longer be inherited correctly (with the removal of
exec-path-from-shell). The quick fix is: 'bin/doom env refresh'. Also,
the set-env! autodef now does nothing (and is deprecated), be sure to
remove calls to it in your config.

Smaller changes:
+ This update also adds --no-* switches to doom quickstart
+ Includes general improvements to the documentation of several bin/doom
  commands.
+ Moves doom/reload* commands to core/autoload/config.el
+ doom/reload-project has been removed (it didn't actually do anything)

The breaking change:
This update adds an "envvar file" to Doom Emacs. This file is generated
by `doom env refresh`, populated with variables scraped from your shell
environment (from both non-interactive and interactive sessions). This
file is then (inexpensively) loaded at startup, if it exists.

+ The file is manually generated with `doom env refresh`.
+ It can be regenerated automatically whenever `doom refresh` is run by
  running `doom env enable` (`doom env clear` will reverse this and
  delete the env file).
+ `doom quickstart` will ask if you want to auto-generate this envvar
  file. You won't need it if you're confident Emacs will always be
  started from the correct environment, however.
+ Your env file can be reloaded from a running Emacs session with `M-x
  doom/reload-env`. Note: this won't work if the Emacs session you're
  running it in doesn't have a correct SHELL set. i.e. don't use this to
  create your first env file!

The idea isn't mine -- it's borrowed from Spacemacs -- and was
introduced to me in #1053 by @yurimx. I was impressed with it. Prior to
this, I was unhappy with exec-path-from-shell (no hate to the dev, I
understand its necessity), and 'doom patch-macos' wasn't ideal for mac
users (needed to be reapplied every time you update Emacs). What's more,
many users (even Linux users) had to install exec-path-from-shell
anyway.

This solution suffers from none of their shortcomings. More reliable
than patch-macos, more performant and complete than
exec-path-from-shell, and easily handled by bin/doom.
2019-03-28 01:56:09 -04:00
Henrik Lissner
e116003162
lang/python: start lsp later
Allows file/dir local variables to affect lsp.
2019-03-13 20:15:23 -04:00
Henrik Lissner
c0c4b897ea
lang/python: refactor python mode-line indication 2019-03-08 02:37:32 -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
5bae67e299
lang/python: remove +pyvenv flag
The pyvenv package isn't going anywhere, it's just needed by
pipenv.el (which surprisingly doesn't declare it as a dependency).
2019-03-04 20:47:26 -05:00
Henrik Lissner
eb3c569e1d
Replace +lsp|init with lsp! autodef 2019-03-02 01:34:19 -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
f5a18d3751
+python|adjust-mode-line -> +python|init-mode-line
To be consistent with other initializer hooks.
2019-02-24 21:00:46 -05:00
Henrik Lissner
cb923eadcc
Add basic LSP support
Still needs to be documented, but includes support for the following
languages:

+ C/C++/ObjC
+ Go
+ Java
+ Javascript
+ OCaml
+ PHP
+ Python
+ Ruby
+ Scala
+ Swift
+ HTML/CSS

Relevant to #460, #716, #1186
2019-02-21 19:13: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
3f195614d9
Normalize :leader/:localleader keybinds
Evil states no longer apply to them. Also removes x-alt-keysym.
2018-12-23 23:54:27 -05:00
Henrik Lissner
408eecad8e lang/python: lazyload python-pytest #1026 2018-12-05 22:11:54 -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
30fbb0d62f
Lazy-load python-pytest 2018-12-03 23:15:40 -05:00
Edmund Miller
52f805ba62
Add some extra keybindings 2018-11-23 11:14:25 -06:00
Edmund Miller
2c0b0fac77
Keybindings are added to python-mode-map 2018-11-23 11:06:03 -06:00
Edmund Miller
ba49765358
Initial pytest 2018-11-22 12:53:08 -06:00
Ting Zhou
7e02cbb17d lang/python: add miniconda3 path 2018-11-14 22:33:18 -08:00
Henrik Lissner
80e53eee5d
lang/python: add homebrew miniconda3 path
For `brew cask install miniconda`
2018-11-15 00:55:54 -05:00
Henrik Lissner
d21887149f
Minor refactor/reformatting 2018-10-06 20:44:25 -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
7f1b526f64
Set python-shell-* vars early
To make it easier for users to overwrite them in thir config.el (without
an after! block).
2018-10-03 00:05:45 -04:00
Henrik Lissner
431ea613b0
lang/python: set PIPENV_MAX_DEPTH in eval handler
Instead of changing the cwd, which chould have other reprecussions for
the code about to be executed.
2018-09-26 20:38:02 -04:00
Henrik Lissner
68699c3d5b
lang/python: make repl/eval handlers respect pipenv 2018-09-26 12:28:32 -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
5145e7e822
lang/python: tab-width = python-indent-offset #882
This fixes evil-shift-width too (which is set to tab-width by
evil-collection-python).
2018-09-13 19:15:15 -04:00
Henrik Lissner
c58077810d
General refactor of modules
General code and comment improvements.

Also, removed the :desc's for csv-mode because map! is currently unable
to set which-key descriptions mode-locally, and should be avoided for
anything but global keybinds. This will be fixed when General is
introduced into Doom.
2018-09-09 09:58:20 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Allen Shaw
45e22c7e23 add anaconda3 home path '/usr/local/anaconda3' 2018-09-09 17:18:39 +08:00
Henrik Lissner
69e992e54a
lang/python: minor reformatting 2018-08-12 02:46:55 +02:00
Henrik Lissner
69eb2cd40d
lang/python: improve pipenv support 2018-08-11 21:18:21 +02:00
Henrik Lissner
7ffa3c8d8d
lang/python: register ANACONDA_HOME envvar 2018-08-01 22:30:30 +02:00
Henrik Lissner
e053234992
lang/python: fix anaconda ignoring conda envs 2018-08-01 22:29:51 +02:00
Henrik Lissner
ad68f26477
Fix python mode-line persisting into other modes
And more polish for the python mode-line indicator.
2018-08-01 15:17:57 +02:00
Henrik Lissner
65f0dcef54
lang/python: remove references to removed variable 2018-08-01 01:31:12 +02:00
Henrik Lissner
90d0f334f8
lang/python: rewrite mode-line indicator (again) 2018-08-01 01:13:49 +02:00
Henrik Lissner
9cf5907c48
lang/python: update modeline on version change 2018-07-31 23:21:13 +02:00
Henrik Lissner
991199ee78
Fix PYENV -> PYENV_ROOT envvar typo 2018-07-31 23:16:18 +02:00
Henrik Lissner
b4c8584f64
lang/python: rewrite version mode-line segment 2018-07-31 23:07:22 +02:00
Henrik Lissner
d9a52e1094
Fix company/lookup settings in anaconda-mode
Applying them to python-mode means it would happen too late.
2018-07-31 19:20:58 +02:00