Commit graph

306 commits

Author SHA1 Message Date
emacspace 8b3a30f240 documentation formatting: Sat Dec 22 11:04:49 UTC 2018 2018-12-22 11:12:10 +00:00
cormacc c375bc428f Flattened some cquery/ccls configuration
c-c++-lsp-initialization-options:
-> ccls-initialization-options
-> cquery-extra-init-params (cacheFormat set to "msgpack" by default)

c-c++-lsp-args:
-> ccls-args
-> cquery-extra-args

c-c++-lsp-cache-dir:
-> ccls: Appended to initialization-options
-> cquery-cache-dir

<<Amendment 1 21/12/18>>
Removing 'clangd' from list of lsp clients to squash per-file prompt for
language client.
Updated lsp/packages.el to reflect upstream lsp-mode function name changes.
Python layer -- added if guards to prevent anaconda package loading / keyboard
shortcut config when lsp backend selected.
2018-12-22 12:51:17 +02:00
Ivan Yonchovski f346ae0683 Fix java/python/javascript/rust lsp backends 2018-12-22 12:51:05 +02:00
emacspace 45276bd96f documentation formatting: Wed Dec 5 03:03:03 UTC 2018 2018-12-04 22:06:14 -05:00
duianto ee811f7b13 Unify packages list parentheses style
problem:
some layer packages lists have the open and closing parentheses on the same line
as the first and last listed package, but most seem to have them on a separate
lines.

solution:
put the open and close parentheses on separate lines, except for lists with only
a single package, they are written on the same line as the variable name and
parentheses.

fix the lists indentation
2018-11-21 21:35:38 +00:00
emacspace 901f35849a documentation fixes: Tue Oct 23 14:18:21 UTC 2018 2018-10-23 23:38:16 +03:00
Boris Buliga a0db651fc5
mention new python debugging option in readme 2018-10-23 07:18:24 +03:00
boris 554b3d9622
python3.7 comes with a builtin breakpoint() function (PEP 553) 2018-10-23 07:16:38 +03:00
JimmyG bf2bf86269 anaconda-mode-go-back is replaced with xref-pop-marker-stack 2018-10-20 09:38:32 +03:00
JAremko cd39f80c24 Reformat documentation 2018-10-11 00:13:43 +03:00
Alexander Eberspächer 77afc63da8 Fix pyenv using system Python
Check the case of "pyenv which" returning "system". In this case, find the
Python executable using default "executable-find".
2018-09-03 20:21:05 +01:00
Benno Fünfstück 03b8f71997 fix typos 2018-08-28 22:37:08 +01:00
Benno Fünfstück f31bed7f52 python-mode: fix indent offset guessing for tab indentation 2018-08-28 22:37:08 +01:00
Riley Levy 9af8e1564d Fix #1109: Escape argument for shell spacemacs/python-execute-file
Escape the filename before calling python on the filename in the shell in the
function `spacemacs/python-execute-file` by calling `shell-quote-argument`.
2018-08-04 10:51:49 -04:00
EMayej 6f9097e6f0 fix(python): index out of bound 2018-08-04 10:32:31 -04:00
Miciah 6d8be7b381 python: Initialize inferior-python-mode variables
Fix SPC m c c (spacemacs/python-execute-file) and SPC m c C
(spacemacs/python-execute-file-focus), which were causing
the following errors:

    save-current-buffer: Symbol’s value as variable is void: python-shell--interpreter
    error in process filter: python-shell-comint-end-of-output-p: Wrong type argument: arrayp, nil
    error in process filter: Wrong type argument: arrayp, nil

This commit also fixes issue #9070: spacemacs/python-execute-file-focus
does not change focus.

The problem is that spacemacs/python-execute-file-focus invokes
spacemacs/python-execute-file, spacemacs/python-execute-file invokes
inferior-python-mode, and inferior-python-mode uses the variables
python-shell--interpreter and python-shell--interpreter-args, which
the python package declares but does not initialize.

To resolve this problem, this commit initializes both variables to nil.

* layers/+lang/python/config.el: Initialize python-shell--interpreter and
python-shell--interpreter-args to nil.
2018-08-03 06:53:02 +03:00
Guan Xipeng 0c878ae453 fix: spacemacs/pyenv-executable-find support multi pyenv versions 2018-08-01 17:42:44 -04:00
Ting Zhou e362b17868 polish lsp-python and anaconda-mode 2018-08-01 17:22:36 -04:00
JAremko 6946e255e6 Reformat docs 2018-07-20 02:45:21 +03:00
syl20bnr adf10d652b Lazy load importmagic 2018-06-11 01:45:48 -04:00
syl20bnr d48ecea6e6 Lazy load anaconda-mode 2018-06-11 01:41:22 -04:00
syl20bnr 49b1659a18 Lazy load lsp-mode 2018-06-11 00:28:11 -04:00
bmag 50621c93af python: conditionally remove binding to obsolete keymap
Using a conditional instead of removing entirely since anaconda-mode code has
been in some flux recently. If the keymap stays obsolete when the dust settles
we can remove this block.
2018-06-03 20:19:19 +03:00
Miciah Dashiel Butler Masters 78297be625 Fix various typos
* Fix various isolated typos

"apppend" -> "append"

"availabe" -> "available"

"Descripti using ternon" -> "Description"

"you have not them" -> "you don't have them"

"new on" -> "new one"

"plained" -> "curved"

"repel" -> "REPL"

"vairable" -> "variable"

* Fix a few errors in the CoffeeScript layer readme

Add a missing "the".

Correct a reference to the layer as "javascript" to "coffeescript".

Fix the syntax on the link to CoffeeLint.

* Fix typos: "dofile" -> "dotfile"

* Fix typos: "formated" and "formating"

"formated" -> "formatted"

"formating" -> "formatting"

* hy: Fix docstrings in funcs.el

Fix copy-and-pasted docstring text for
spacemacs/hy-shell-eval-current-form-and-go and
spacemacs/hy-shell-eval-region-and-go.

* Fix typos: "indendation" -> "indentation"

* Fix typos: "the the", "a a"

Fix duplicated (or misplaced) articles.

* Fix typos: "wether" -> "whether"

* Fix typos: "intialize" -> "initialize"
2018-05-23 22:12:30 -04:00
syl20bnr 7d19ba1711 python: fix missing t with :call-hooks keyword 2018-05-23 22:11:10 -04:00
Brandon T. Willard f069f9992d Fix pyvenv pre-init defun and package names; adjust hy-mode prefixes. 2018-05-21 01:18:37 -04:00
syl20bnr ea8991ac90 New layer Hy extracted from Python layer 2018-05-20 03:06:25 -04:00
syl20bnr 9f6b45223f python: put smartparens advice in a post-config use-package hook 2018-05-20 00:24:29 -04:00
Nikita Leshenko b3743701db python: smartparens: Fix bytecomp warning (#10582)
The byte compiler doesn't know about `smartparens-strict-mode' because
smartparens is lazy loaded, so wrap the variable reference in `bound-and-true-p'
to silence a warning that appears on Spacemacs startup.

To reproduce:
1. Install a fresh Spacemacs from develop branch
2. Use spacemacs-base distribution
3. Select only these configuration layers: spacemacs-editing python
4. Restart Emacs to install packages
5. Restart Emacs again and observe warning:
   Warning (bytecomp): reference to free variable 'smartparens-strict-mode'
2018-05-20 00:22:44 -04:00
syl20bnr 996cc91b5d python: fix company when opening a buffer for the 1st time
fixes #https://github.com/syl20bnr/spacemacs/issues/10638
2018-05-13 12:39:52 -04:00
Codruț Constantin Gușoi 775fb50f9f Fixes TOC formatting for python layer 2018-05-09 01:19:21 +03:00
JAremko d4017b1ca7 Make sure that docs pass formatting cheques. 2018-04-15 22:16:17 +03:00
syl20bnr ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00
syl20bnr 29c78ce841 Defer packages by default using use-package-always-defer
Warning now `:defer t` is implied, to force a package to load `:demand t` is
now necessary.
2018-02-27 23:32:52 -05:00
syl20bnr 1e6a0a66c0 python: group backend packages 2018-02-27 23:32:52 -05:00
Dan Girshovich a141c9adff Add support for breakpoints for the trepan3k python debugger 2018-02-24 19:49:39 -05:00
syl20bnr 920a6f6075 python: sort key bindings 2018-02-24 19:49:39 -05:00
Jack Kamm 8f79abc7f3 python: add pipenv. unified prefix for pyenv, pyvenv, pipenv 2018-02-24 19:49:39 -05:00
syl20bnr e99ca55e13 python: add doc for SPC m t l 2018-02-24 19:49:39 -05:00
Benoit Coste 262c8ee7b0 Add defun spacemacs/python-test-last
It is a wrapper around the nosetests-again defun.
It will call the latest called nosetest function.
2018-02-24 19:49:39 -05:00
syl20bnr 81a931f48b python: add support for Language Server Protocol 2018-02-19 00:08:27 -05:00
JAremko d2c3b847d8 doc fmt 2018-01-27 16:57:39 +02:00
Shitikanth Kashyap 6e0d38f3ea pylookup: Clear self.tag on endtag 2018-01-17 23:23:59 -05:00
Shitikanth Kashyap 480c8531b3 pylookup: Add "/genindex/" to potential_urls
Used in online documentation of libraries Flask and Requests.

http://flask.pocoo.org/docs/0.12/genindex/
docs.python-requests.org/en/master/genindex/
2018-01-17 23:23:47 -05:00
Shitikanth Kashyap 23e582d121 pylookup: Switch to using urllib2 on Python 2
Fixes bug: pylookup fails silently on 404. For instance, on
`./pylookup -u https://matplotlib.org/` it first looks up
'https://matplotlib.org/genindex-all.html', gets a 404 response,
but instead of moving to the next candidate url, it builds an empty
index.

Cause of bug: urllib.urlopen doesn't give an error on 404.
2018-01-17 23:23:25 -05:00
Shitikanth Kashyap 48032ca787 pylookup: Use generic tags to detect list levels.
This fixes bug #9866.

Tested to work with documentation of Python 2.6, Python 2.7, Python 3.4,
Python 3.5, Python 3.6, and latest stable releases for SciPy, NumPy,
Matplotlib, and Flask.
2018-01-17 23:23:14 -05:00
Shitikanth Kashyap a3d8df9244 pylookup: Set one_entry to false after each element
Fix for bug: extraneous links registered for last entry
in index. For instance, for python documentation index,
all links in footer would get attached to `zlib`.
2018-01-17 23:23:04 -05:00
Shitikanth Kashyap 01e588c5f0 pylookup: Remove unused field do_entry 2018-01-17 23:22:52 -05:00
Shitikanth Kashyap 86f7213b65 pylookup: Handle end tag logic in handle_endtag
Doing it handle_data was a bug because `self.tag`
would contain the most recent opened tag, not the tag
currently being closed. This meant, for instance, that
the elements were not being generated correctly and
"./pylook.py --cache" was broken.
2018-01-17 23:22:39 -05:00
Shitikanth Kashyap dbe5bb4893 pylookup: Use HTMLParser instead of htmllib
htmllib has been deprecated since PEP 3108.
2018-01-17 23:22:19 -05:00
syl20bnr 2c16d19ab7 semantic: make it possible to exclude stickyfunc 2018-01-17 23:03:33 -05:00
Hans Jang d35268a1d6 Fix the broken python repl invocation through SPC a '
Without this chage, it ends up with the following error:
  'Wrong type argument: commandp, python-start-or-switch-repl'
2018-01-06 00:59:29 -05:00
syl20bnr eee2b4b89c python: document pippel and set key binding to SPC m P 2018-01-05 22:15:50 -05:00
James Wang 0a4f257da0 Add pippel for python package management 2018-01-05 21:54:41 -05:00
Christoph Paulik 17d350b585 Python: Fix pyenv-executable-find in presence of pyenv-which-ext. 2018-01-05 21:48:04 -05:00
Shane Pearlman 2f2ed06b0e Use python-mode for SCons script files 2018-01-05 21:46:52 -05:00
syl20bnr 302d272ae3 python: sort key bindings in doc and package config 2018-01-05 21:45:57 -05:00
Volodymyr Vitvitskyi b63039a6a4 Support importmagic in the Python layer
Problem
-------
If the symbol is not resolved due to a missing import there is no automatic way
in the Python layer to import it.

Solution
--------
Use 'importmagic' package.

Pressing `SPC m r f` at point that requires an import will suggest a list of
possible options.
2018-01-05 21:44:11 -05:00
syl20bnr 6a345b86a0 python: document python-save-before-test 2018-01-05 21:41:26 -05:00
Benoit Coste 3f01fd5fed Add defvar python-save-before-test
If true, buffer is automatically saved when calling
python-test-* functions
2018-01-05 21:38:28 -05:00
lostmarble 572820e618 Update funcs.el
fix python/:init: Invalid version syntax: '5.1.0^M' bug, for "ipython --version" will return '5.1.0\r\n' on windows with Anaconda3
2018-01-05 21:37:08 -05:00
Muneeb Shaikh ef36bdfb06 python: update anaconda-mode view mode variable names
Fix #10047
2018-01-05 21:37:03 -05:00
Muneeb Shaikh 3289e0d114 python: update invalid cython mode keybindings 2018-01-05 21:35:58 -05:00
syl20bnr 326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
Robbert van der Helm c61ae1a1c1 Add ivy support to the gtags layer
It would be much better to have a single function for each layer that
initializes ggtags, helm-gtags and counsel-gtags for a mode.
2017-12-17 22:03:01 -05:00
wizmer 2531012319 Make nose fail compilation when tests fail
Using nose.main instead of nose.run returns the result of the tests
so the status of the *compilation* buffer can be modified accordingly
2017-10-15 11:08:01 -04:00
CeleritasCelery e32acfbf3b Fixed feature header 2017-08-29 20:00:44 +03:00
syl20bnr 2e8412323c python: move functions to funcs.el 2017-08-28 10:44:58 -04:00
JAremko 06301b2212 Improve exporting/testing 2017-08-18 20:50:21 +03:00
Eivind Fonn f4b53d2a4f Rename :depends to :requires 2017-07-03 09:54:53 +02:00
syl20bnr e2e532bb49 core: change <function>p to <function>-p suffixes for consistency
Also defined aliases for backward compatibility with `usedp` functions.
2017-07-02 10:09:39 -04:00
Eivind Fonn 08561d8631 core: implement :depends for package declarations
This replaces the older pattern
:toggle (configuration-layer/package-usedp ..)

This implementation ensures that :disabled-for honors dependent packages, i.e.
if package a depends on package b, which is owned by layer c, and layer c is
disabled for layer d, then neither package a nor b will be configured for layer
d. Previously, this was only true for package a, but not b.

This commit also fixes:

- configuration-layer/describe-package now shows which post-init and pre-init
  functions are disabled, if any
- Does not recreate all layer objects unconditionally when calling
  configuration-layer/discover-layers. Previously, this led to all layers being
  recreated after e.g. `SPC h SPC`, without any of the dotfile information.
  Since this information is now necessary for
  configuration-layer/describe-package, it’s important that we don’t clear the
  indexed layers when invoking this function.
2017-06-22 11:53:05 +02:00
Eivind Fonn bcb597a329 python doc: Reformulate jedi warning 2017-06-12 12:38:27 +02:00
davidpham87 f6b2c90260 Autocompletion debug
Autcompletion does not handle request properly with jedi 1.0. Until the bug is corrected, one should keep the 0.9 version.
2017-06-12 12:37:04 +02:00
Danny Freeman 6bf310f572 Updated hy-mode lisp eval keys to match spacemacs conventions
Updated to match the conventions listed here:
https://github.com/syl20bnr/spacemacs/blob/develop/doc/CONVENTIONS.org#evaluation

Now functions related to lisp evaluation start with 'SPC m e' and functions
related to the hy repl start with 'SPC m e'.
2017-06-08 09:14:02 +02:00
Eivind Fonn 55ceef53a5 bugfix: arguments to python-setup-hy 2017-06-07 16:28:03 +02:00
Eivind Fonn ed90f2b4ff Bugfixes
- Set hy-mode-inferior-lisp-command globally
- Function names
2017-06-07 12:43:58 +02:00
Eivind Fonn 16f25488a9 Clean up python/hy pyenv/pyvenv integration
- Move find-hy-executable to funcs.el and rename
- Don’t set hy-executable (not needed by anything)
- Setup hy only once at startup (allow user to override settings, see #5988)
- Use setup-hy in advice instead of post-activate-hook (works with many more
  commands)
- Setup checkers pyenv change, too
- Guard checker setup function for possibly missing flycheck
- Combine all setup functions into one
2017-06-07 12:40:30 +02:00
Danny Freeman 5a7019427e Fixed bug so hy command work when hy is installed on a virtualenv
Hy is typically installed on a python virtual environment, not globally. When
that is the case, init-hy-mode doesn't set any leader keys for hy since it
can't find the hy executable on the path. When a virtual environment is
activated, init-hy-mode is run again to see if it can find a hy executable
and setup the leader keys for hy.
2017-06-07 12:28:48 +02:00
Swaroop C H a2f1bfa8a4 [python] Prefer virtualenv python to compile file 2017-05-29 10:12:20 -07:00
Eivind Fonn 97862af26c Trim output from pyenv command
Trailing newlines will cause errors
2017-05-28 14:59:34 +02:00
Muneeb Shaikh 47cb3e01e0 python: fixes for anaconda-mode-view-mode
* layers/+lang/python/funcs.el (spacemacs/anaconda-view-forward-and-push):
  Added helper function to go forward and hit RET
* layers/+lang/python/packages.el (python/init-anaconda-mode):
   - use new evilification macro
   - use helper function to go ahead and push button when hitting `RET`
   - Add `C-j`, `C-k` for easy navigation in anaconda-view-mode when multiple
   references are displayed. Doesn't conflict with normal `hjkl` navigation in
   other views of `anaconda-view-mode`

Fix #7538
Fix #5737
2017-05-24 13:58:23 +02:00
Swaroop C H ea54e6863e Make python-execute-file use python-shell-interpreter
So that we can customize to use `python3` instead of `python`
2017-05-24 13:41:12 +02:00
Alexey Kotlyarov f27568d8f9 Python: Highlight wdb breakpoints as well as pdb/ipdb/pudb 2017-05-24 12:44:57 +02:00
Alexey Kotlyarov dc3f16b840 Python: search for Pylint and Flake8 in the virtualenvs 2017-05-24 12:44:19 +02:00
Kristoffer Haugsbakk 79ed1a6b4b Use proper markup for code in readmes
By convention, code markup (`~`) is reserved for keybindings in Org-based
documentation in Spacemacs.  Verbatim markup (`=`) is reserved for code and
other code-like things.  So change several readmes to reflect this convention.

Use verbatim markup for things like (non-exhaustive list):

- Emacs Lisp functions, modes, buffers, etc.
- Environment variables
- Directory paths
- Code in general
2017-05-24 11:57:17 +02:00
Rand01ph c71d482012 fix python layers anaconda-mode requirements 404
the anaconda-mode requirements has change to wiki
2017-05-24 10:04:33 +02:00
JAremko 6c5a0b2b14 update docs to the new toc-org format 2017-05-22 18:35:37 +03:00
Wieland Hoffmann 4c009f4721 Use verbatim markup for the flake8 package name 2017-05-14 22:07:21 -04:00
JAremko f805d0ebd9 Fix spacefmt test on deleted files
Also fix some links
[ci skip]
2017-04-28 23:29:43 -04:00
Pedro Algarvio 9c226d8201 .python-version can contain more than one version specified.
https://github.com/yyuu/pyenv/blob/master/COMMANDS.md#pyenv-local-advanced
2017-04-17 22:31:50 -04:00
syl20bnr 184a530596 python: hide YAPF lighter in modeline
Circled lighters in modeline are reserved for toggles under SPC t and SPC T
2017-04-12 23:18:42 -04:00
Robbert van der Helm 7af8321587 Diminish the YAPF minor mode indicator 2017-04-12 23:17:01 -04:00
ishestakov 86394d4af0 Fix IndexProcessor for compatibility with python3.
Replaced version check with try-except block.
Reformatted pylookup.py due to PEP8.
2017-04-09 22:51:36 -04:00
Robert O'Connor e9ff9f09c6 Remove trailing whitespace from all files 2017-03-26 13:06:43 -04:00
magia 281410de11 Fix python-enable-yapf-format-on-save 2017-03-23 13:57:47 +02:00
syl20bnr f45ce1a88e syntax-checking: rename function add-flycheck-hook to enable-flycheck
spacemacs/add-flycheck-hook was not really hooking anything, change the name
to better reflect what it does.
Also changed the push for a add-to-list to avoid duplicates.
2017-03-19 12:40:36 -04:00
syl20bnr fb27ede558 Bump year in copyright headers
Happy New Year 2017!
2017-01-05 23:08:17 -05:00
zilongshanren c22991d587
remove un-intended quote in company-anaconda 2017-01-05 08:58:01 +02:00
Brent Taylor 1ff7c10f19
Fix python path with virtualenv on Windows in Python nose package 2017-01-04 22:38:25 +02:00
syl20bnr 74fdbb6795 Refactor and simplify company backends declaration
Enabling a company backend for a specific mode was a tedious tasks with code
scattered at different locations, one for local variable definitions, one for
company hook function definitions and another where the backends were pushed to
the local variables (which was problematic, since we ended up pushing the same
backends over and over again with `SPC f e R`, pushes have been replaced by
add-to-list calls in the new macro).

All these steps are now put together at one place with the new macro
spacemacs|add-company-backends, check its docstring for more info on its
arguments.

This macro also allows to define arbitrary buffer local variables to tune
company for specific modes (similar to layer variables via a keyword :variables)

The code related to company backends management has been moved to the
auto-completion layer in the funcs.el file. A nice side effect of this move is
that it enforces correct encapsulation of company backends related code. We can
now easily detect if there is some configuration leakage when the
auto-completion layer is not used. But we loose macro expansion at file loading
time (not sue it is a big concern though).

The function spacemacs|enable-auto-complete was never used so it has been
deleted which led to the deletion of the now empty file core-auto-completion.el.

The example in LAYERS.org regarding auto-completion is now out of date and has
been deleted. An example to setup auto-completion is provided in the README.org
file of the auto-completion layer.
2017-01-02 00:39:04 -05:00
Koray Al aaefaa3573
Added auto load virtualenv support via .venv file
The `pyvenv-mode` doesn't provide a list of available virtual
environments. So it's not currently possible to check if the
provided virtualenv name is available
2016-12-27 09:55:28 +02:00
ksjogo 12284e16b0 Removed deprecated insert-string and replace by insert 2016-11-11 15:23:49 +02:00
yangguang760 67ac25c80a fix debug string for python3
fix debug string for python3:
ipdb  ->  ipdb3
pudb  -> pudb3
2016-10-23 19:44:35 +02:00
Eivind Fonn 9c966a8d8f Simplify python test runner setup 2016-10-23 19:44:35 +02:00
bmag 699e78f38a python: really start REPL also in emacs 25.1
Make `python-start-or-switch-repl` start a REPL when necessery also in
Emacs 25.1. Previously in Emacs 25.1 it wouldn't do anything if the REPL
wasn't started already.
2016-10-17 14:12:46 +02:00
bmag bbd812991a Refactor spacemacs/python-execute-file 2016-10-17 13:26:40 +02:00
bmag 6e896d3796 Restore fix for #2569 2016-10-17 13:19:46 +02:00
Alexey Kotlyarov a7d8a4f3db Support wdb for debugging Python
wdb (https://github.com/Kozea/wdb) is a Web-based debugger
for Python. Use it if installed for python-toggle-breakpoint.
2016-10-17 13:15:54 +02:00
syl20bnr d15050b512 python: update anaconda dependencies and reorganised the deps section 2016-10-16 23:05:56 -04:00
Eivind Fonn 200fb764aa Make python tab-width configurable 2016-10-11 20:01:24 +02:00
syl20bnr 9066d073b2 Fix (void-variable spacemacs-jump-handlers-....)
Move the variable definitions to config.el and eval-after-load the
key binding on SPC m g g.
2016-09-04 22:31:47 -04:00
syl20bnr c6a6c41d92 Replace hooks by regular list for jump lists
Hook semantic is to be used with run-hooks API and run all hooks
sequentially, jump list semantic is different since the running
functions are not guaranteed to be executed so we prefer using regular
list API to manage jump-lists.
2016-09-04 12:28:40 -04:00
Christoph Paulik 4029679584 Fix Python jumping with async anaconda mode function.
Without this dumb-jump-go is often used if anaconda-mode-find-defintions
takes a little to return a result.

fix #6985
2016-09-03 12:04:31 +02:00
Christoph Paulik 28b8572eb0 Python: Fix link in layer Readme. 2016-08-30 16:11:57 +02:00
Eivind Fonn 5a869764dd Further improve gtags layer
- Add option to disable by default
- Use local-vars hook to allow per-project enable/disable
- Don’t enable helm-gtags-mode (no need)
- Move emacs bindings from helm-gtags-mode-map to ggtags-mode-map
2016-08-22 15:11:25 +02:00
Eivind Fonn 928983da47 Refactor jump to definition
This commit defines:

- spacemacs-default-jump-handlers: a list of functions that can jump to
  definition in ALL modes.

- spacemacs-jump-handlers-MODE: a list of functions that can jump to
  definition in MODE.

- spacemacs-jump-handlers: a buffer-local list of functions that can
  jump to definition. This is made up of the values of the two previous
  variables whenever a given major mode is activated.

- spacemacs/jump-to-definition: a function that tries each function in
  spacemacs-jump-handlers in order, and stops when one of them takes us
  somewhere new.

- spacemacs|define-jump-handlers: a macro that
  * defines spacemacs-jump-handlers-MODE, possibly filled with initial
    functions
  * defines a function that is added to the hook of the given MODE
  * binds “SPC m g g” of that MODE to spacemacs/jump-to-definition

This is an attempt to harmonize all the different approaches to jumping.
Specifically,

- Existing intelligent jump packages that work for only a single mode
  should go to the beginning of spacemacs-jump-handlers-MODE. E.g.
  anaconda for python, ensime for scala, etc.

- Packages like gtags that work for several modes (but potentially not
  all) and which is dumber than the intelligent jumpers should go the
  the END of spacemacs-jump-handlers-MODE.

- Packages like dumb-jump that work for all modes should go to
  spacemacs-default-jump-handlers.

In all cases the order of the jump handlers in each list should be from
most to least intelligent.

Fixes #6619
2016-08-22 15:08:25 +02:00
Eivind Fonn d94d0d9f71 Some improvements to py-isort config
- Rename variable
- Wrap the save function to check condition variable at runtime
- Add keybinding
2016-08-21 17:49:20 +02:00
Swaroop C H a2d7461bb1 [python] Add py-isort package
py-isort sorts the imports to keep it tidy.

Disabled by default.
2016-08-21 17:41:43 +02:00
Christoph Paulik 83ec3afc7e Fix Python layer loading on emacs master branch.
The member function works slightly different on the master branch of
emacs than in emacs 24.5 or emacs 25 release candidates. This might be a
bug in emacs but for now we can add a check if python-test-runner is a
list to work around that.

Fix #6246.
2016-08-21 15:16:56 +02:00
Christoph Paulik 6b41426d8d Python: Set breakpoints correctly when pyenv is used.
pyenv shims fool executable-find into thinking that ipdb is always
installed if it is installed in one environment.
2016-08-18 21:06:56 +02:00
Antonis Kalou 9bafae3f9c Added mention of PEP-8 syntax checkers to README 2016-08-16 21:06:45 +03:00
Eivind Fonn 3c18a4a6bb Tweak yapfify config
- No need to use :commands
- Remove SPC m y binding
2016-08-07 16:33:12 +02:00
Joris Engbers e0aac5c170 Replace py-yapf with yapfify.
Yapfify uses project settings applicable to the file that yapf is called
on. Also it shows an error if yapf fails.
2016-08-07 16:31:50 +02:00
Christoph Paulik ebbfbaf2d1 Use --simple-prompt for IPython 5 and set correctly on env switch.
IPython 5 does no longer use readline and so the emacs integration is
broken. See also
http://ipython.readthedocs.io/en/stable/whatsnew/version5.html#id1

Fix #6622 and related to #6580

This also works if different environments have different IPython
versions since the shell parameters are setup on every environment
switch.
2016-08-06 18:18:25 +02:00
Christian E. Hopps b22702bc9e Expand gtags use to many more languages 2016-07-17 17:31:59 +02:00
syl20bnr b093598e45 python: avoid code duplication with hy-mode 2016-07-05 00:23:16 -04:00
Danny Freeman fa28afb02f Add keybindings for hy-mode in python layer
These changes will allow users to evaluate hy code in a repl using an
inferior-lisp process. It requires that users have hy installed via pip
in their local python enviornment.

Add smartparens-mode and documentation

I moved the add-hook for smartparens call to
python/post-init-smartparens. Keybindings were also updated to match
the ones for the Inferior REPL process for Python. Also added some
documentation for required hy pacakge, and the keybindings to
README.org.
2016-07-05 00:23:16 -04:00
km d7820aafd6 Remove even more 24.3 related configuration
Helm-flx, which is included as a core package, requires a minimum Emacs
version of 24.4. As it stands attempting to install Spacemacs on Emacs
24.3 or below will break on helm-flx.
2016-06-20 22:26:53 -04:00
Wieland Hoffmann 78bfe65e62 Python: Don't remove ':' from electric-indent-chars in emacs >= 24.5
According to the conversation in [0] ':' is removed from
electric-indent-chars in python-mode because typing ':' in

> for i in range(10):
>    print(i)
> for i in range(10)_

with the point at _ indents the third line. This is not happening in
Emacs 24.5 anymore.

[0] aed0fc8ef8
2016-06-12 21:42:40 -04:00
syl20bnr 56ee037cd7 python: prefix functions with spacemacs 2016-06-05 21:53:14 -04:00
Christoph Paulik 9f28409b0c Allow multiple python test runners by using dispatch functions.
This allows python-test-runner to also be a list of either '(nose
pytest) or '(pytest nose) which then calls the correct test runner in
the dispatch functions.
2016-06-05 21:41:23 -04:00
syl20bnr a2de9a63af Use :toggle keyword instead of when forms 2016-05-29 22:39:21 -04:00
sooheon 15e6290151 Make check for company-mode explicit, not implicit
People may have company-mode installed without necessarily using the
auto-completion layer.
2016-05-27 00:32:05 -04:00
syl20bnr 1f993bddf6 Rename spacemacs-helm and spacemacs-ivy layers to helm and ivy
For ivy users: be sure to update your dotfile by replacing spacemacs-ivy
by ivy
2016-05-15 22:24:27 -04:00
bmag 6edef36b17 Call python-setup-shell only once, not from hook 2016-05-06 12:59:51 +02:00
Xiao Hanyu c93e47028c Set comment-inline-offset to 2 for python-mode.
Since python's PEP8 recommends two spaces for inline spaces.

Ref:
- https://www.python.org/dev/peps/pep-0008/#inline-comments
2016-04-21 22:26:18 -04:00
Christoph Paulik 643553a0fe Only disable semantic-idle-summary in python if anaconda-mode is used.
Some people have problems with anaconda mode and exclude it. This
enables them to at least have the semantic summary in their modeline.
2016-04-21 21:13:53 -04:00
Junhui 9d1b574554 Make pylookup.py compatible with Python 2 and 3 2016-04-21 21:08:31 -04:00
Eivind Fonn 7f95d250db python: Move smartparens config to correct place 2016-04-18 15:56:16 +02:00
syl20bnr 47776e8999 python: move semantic config and fix error with semantic-idle-summary-mode
Move all semantic related config to semantic post-init and correctly
fix the error with void function semantic-idle-summary-mode when
opening a python without the semantic layer enabled.
2016-04-17 00:37:47 -04:00
Neal D. Becker 4ca8b55819 set semantic-idle-summary-mode on hook 2016-04-17 00:37:47 -04:00
Christoph Paulik a175de5b7a Use py-yapf from MELPA. 2016-04-12 22:58:41 -04:00
syl20bnr 6c2665e0f7 python: move disable semantic hook to anaconda init function 2016-04-12 22:38:48 -04:00
Junhui 95be4bce44 Fix 'makefile' for pylookup 2016-04-11 20:40:42 +02:00
Fabien Dubosson ddc831e061 [python] Correct whitespaces in packages.el 2016-04-11 20:38:01 +02:00
Christoph Paulik d38ce800bd Disable semantic-idle-summary in Python mode.
Anaconda provides more useful information but can not do it properly
when this mode is enabled since the minibuffer is cleared all the time.

Fix #5564
2016-04-11 20:35:40 +02:00
Joe Hillenbrand d3922095e2 python: register python language for org-babel 2016-04-07 23:02:55 -04:00
Muneeb Shaikh c9ef2f6f3c python: explicitly autoload py-yapf-buffer
Since it's a local package, there's no autoloads file. Adding it to
:commands to let use-package add autoload for it.
2016-04-04 21:46:23 -04:00
syl20bnr e511a1211c python: lazy load py-yapf 2016-04-03 00:36:06 -04:00