17

Did you try Elpy? It binds elpy-goto-definition to the key M-.. If you have a recent Emacs, I think you can also jump back with xref-pop-marker-stack (M-,). Elpy has some other nice features as well. To install it, follow the instructions in the link.


12

I use Jedi mode for Python and I'm very happy with it. Not only does it do accurate look ups for function calls, it resolves functions to the correct definition even in complicated situations (like inheritance). Comes with auto complete to boot. http://tkf.github.io/emacs-jedi/latest/


9

The feature of PyCharm that you mention was one of my favourites, and one of the first things I looked for in trying to replace PyCharm completely with Emacs (which I am happy to say I have been able to do). As mentioned in another answer the elpy package has this feature (in addition to many other useful IDE features). However, if you use elpy-goto-...


7

The below code works fine from my brief testing in a c-mode buffer: After typing /*, hit M-j, the default binding for indent-new-comment-line (and the default binding for c-indent-new-comment-line in c-mode). If it is the first comment line the closing closing characters */ will be auto-inserted. Hitting M-j more times with insert more comment lines with ...


6

Here's a function that closes all unclosed parentheses and other matched pairs. It relies on Emacs's sexp parsing. It only supports single-character matched pairs, so something like {- will be closed with }, not -}. For Lisp, that doesn't matter. (defun close-all-parentheses () (interactive "*") (let ((closing nil)) (save-excursion (while (...


6

Hope this clears up the confusion .. Non-emacs software GNU Global (gtags + global executables) - A software for generating tags, like Universal ctags. I actually use gtags for binary database generation but have configured it to use ctags as backend because ctags supports tag parsing for many more languages. It is mandatory to install GNU Global if you ...


4

Ingest Named Code Blocks from other files using org-babel-lob-ingest Add org-babel-lob-ingest command using File Local Variables syntax to ingest named src blocks from an external file for use in current file. For example, to make the named blocks inside a file named named-blocks-file.org available to another org-mode file: Add the line below at the top ...


4

Here is a start. Add to your .emacs file: (global-set-key [f4] 'compile) You can also enter the "f4" and "compile" interactively. Starting out with M-x global-set-key Compile is a generic for running any command in a separate buffer. The default command runs "make", which may or not be what you want. You have an opportunity to change that and compile ...


3

I've found out that if you have slime installed, there is a command to do this, called slime-close-all-parens-in-sexp


3

There's swift-mode which is available on MELPA. This offers: Syntax highlighting Indentation Code navigation with imenu Syntax checking with flycheck There's another swift-mode here, but it looks less complete. To run code on the device, your best option is probably calling fruitstrap from Emacs (discussed here).


3

python-mode.el provides a command py-find-definition - see in menu Help.


2

Safe way to tweak an emacs uilt-in or 3rd party function You can always re-define a function defined in the source code. In the emacs SE question How do I disable ffap (find file at point) when the first two non-space characters in a line are '//'?, Sigma suggested in his answer to re-define the ffap-string-at-point function to solve the problem described ...


2

M-. works in anaconda-mode (which I switched to after having problems with elpy). Note that you need proper python environment, in my case I do the following: mkvirtualenv someenv python setup.py develop for all modules develop or use (or prefer to reach source instead of installed version) M-x venv-workon RET someenv to enable paths in Emacs. Then I ...


1

There are now instructions for configuration with emacs lsp-mode. The following is taken from what's currently there. You will need to start by putting the clojure-lsp executable on your path. (require 'lsp-mode) (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection '("bash" "-c" "clojure-lsp")) :major-modes '(...


1

It turns out that lsp-mode is currently being reworked. That means that the syntax for registering servers works different now: (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection "pyls") :major-modes '(python-mode) :server-id 'pyls)) So you might need to check out the latest README on github for ...


1

Calling org-lint against org-mode file from command-line Create an org-mode file For example, create a new file named org-lint-ex1.org * Using =org-lint= to Check org-mode Syntax ** Inside emacs 1. Open org-mode file in emacs. 2. Invoke =org-lint= command #+BEGIN_SRC M-x org-lint #+END_SRC #+BEGIN_SR shell M-x org-lint #+...


1

Just add (semantic-add-system-include "/usr/include/gtk-3.0/"). It is because you use include your header as #include <gtk/gtk.h>, so the file you included will be found when the two paths are combined. It is the same thing for other packages or editors out there.


1

Good question, that isn't available out of the box and is a handy feature of full blown IDEs. I do that with cscope, with a nice helm interface: http://wikemacs.org/wiki/Python#cscope It can answers questions like "where is this symbol defined ? Where is it used ?". ps: in evil-mode we can go to the definition of a symbol in the same file with gd.


1

A very primitive (and almost certainly wrong) way to do that would be (defun buffer-needs-parens-fixing () (save-excursion (condition-case nil (check-parens) (error (point))))) (defun buffer-fix-parens () (interactive) (while (buffer-needs-parens-fixing) (insert ")"))) Amongst other limitations, it assumes that all the ...


1

Ok, I ended up programming this myself. I bind it to C-c v. (defun java/find-or-define-variable () "Go to definition of variable at point. Define it if doesn't exist." (interactive) (push-mark) (unless (or (looking-at "[[:alnum:]_]") (looking-back "[[:alnum:]_]")) (search-forward-regexp "[[:alnum:]_]") (forward-char -1)) (let (name ...


Only top voted, non community-wiki answers of a minimum length are eligible