Commit graph

310 commits

Author SHA1 Message Date
É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
Henrik Lissner
3471828f9e
Merge pull request #1592 from shanavas786/pipenv-bindings
lang/python: add pipenv keybinds
2019-10-03 15:02:48 -04:00
Maximiliano
c0bd0c71c2 Add lang/python/README.org (#1844) 2019-10-03 12:40:46 -04:00
Henrik Lissner
4d910accc9
lang/python: revise comments in conda config 2019-09-22 14:05:03 -04:00
Henrik Lissner
b1f9965fe7
lang/python: install lspyls in doom-etc-dir #1776 2019-09-11 23:41:08 -04:00
uelei
2b0cb80138
sort python imports 2019-08-09 20:09:18 -03:00
Henrik Lissner
3423974234
Minor refactors & tweaks across the board 2019-08-06 14:50:42 -04:00
Henrik Lissner
1e7df8046c
lang/python: disable electric indentation #1593
Electric indentation is only as good as the underlying indenter.
2019-07-28 16:10:54 +02:00
Henrik Lissner
26f9e2cdeb
lang/python: load anaconda-mode a little sooner
So its hooks take effect in the first buffer.
2019-07-28 02:38:27 +02:00
Henrik Lissner
059030be49
lang/python: ensure anaconda-mode in first python buffer 2019-07-28 02:32:25 +02:00
Henrik Lissner
afc22e4265
lang/python: fix dont-auto-install-server advice
The function being overriden takes no arguments.
2019-07-28 02:32:25 +02:00
Henrik Lissner
19dd4e8db8
Correct more inline hook defuns 2019-07-28 02:32:25 +02:00
Henrik Lissner
0a05fd09c3
Merge pull request #1603 from nelson-liu/patch-1
Update list of lang/python considered conda homes
2019-07-27 23:43:32 +02:00
Nelson Liu
fa0f876076
Add new homebrew cask anaconda install path 2019-07-27 11:11:47 -07:00
Henrik Lissner
94d5b73b45
lang/python: lazy load lsp-python-ms
And comment on the hack.
2019-07-27 13:53:38 +02:00
Nelson Liu
bf151916cb
Update list of lang/python considered conda homes
For several years, the default location for a miniconda install has been `~/miniconda3` (`~/miniconda2` if using the python 2 version). This PR adds this path to the list considered by the conda package.
2019-07-26 22:29:33 -07:00
Julian DeMille
850c0bbb61
Adding lsp-python-ms with patch so it doesn't force itself to be installed. 2019-07-26 22:32:17 -04:00
Henrik Lissner
a3e262c7ac
💥 Refactor add-hook! macro & change arg order
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:

  (add-hook! :append 'some-mode-hook #'do-something)

Thsoe properties must now follow the hooks, e.g.

  (add-hook! 'some-mode-hook :append #'do-something)

Other changes:
- Various add-hook calls have been renamed to add-hook! because I
  incorrectly assumed `defun` always returned its definition's symbol,
  when in fact, its return value is "undefined" (so sayeth the
  documentation). This should fix #1597.
- This update adds the ability to add multiple functions to hooks
  without a list:

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

- The indentation logic has been changed so that consecutive function
  symbols at indented at the same level as the first argument, but forms
  are indent like a defun.

    (add-hook! 'some-mode-hook
               #'do-something
               #'do-something-else)

    (add-hook! 'some-mode-hook
      (message "Hello"))
2019-07-26 20:17:29 +02:00
Shanavas M
2a92cb1c7f Add pipenv keybindings for python module 2019-07-25 10:48:31 +05:30
Henrik Lissner
76cacb5bfe
💥 Rename def-package! -> use-package!
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.

Also changes def-package-hook! -> use-package-hook!

The old macros are now marked obsolete and will be removed when straight
integration is merged.
2019-07-23 12:50:45 +02:00
Henrik Lissner
c24567a545
:minor-mode -> :minor 2019-07-22 04:30:04 +02:00
Henrik Lissner
13ac086606
lang/python: default to python3 2019-07-22 02:37:47 +02:00
Henrik Lissner
13f7f70242
lang/python: python-indent-guess-indent-offset-verbose = nil 2019-07-22 02:37:47 +02:00
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
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
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
fbf4f78e8e
Fix +python-executable-find with absolute paths 2019-05-21 17:24:23 -04: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
c399c07694
Add :tools lsp checks for +lsp flag
Also:
- Reorganizes some :lang modules' packages.el file.
- Adds setuptools check in lang/python
- Adds javac check in lang/java
- Removes the depends-on! macro
2019-04-24 18:16:05 -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
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
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