Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Hot answers tagged

10

If you don't want to get a 25.2 rc, you can apply the bug fix by adding this to your init.el file: (with-eval-after-load 'python (defun python-shell-completion-native-try () "Return non-nil if can trigger native completion." (let ((python-shell-completion-native-enable t) (python-shell-completion-native-output-timeout python-...


9

You are correct that ein at tkf's repository on github only works with versions of IPython prior to 2.x. With that said, however, if you use this version you will find that it works with IPython 2.x and Jupyter (i.e. IPython 3.0). Installing ein from MELPA or el-get will install the latest ein which works with the latest versions of IPython.


8

When you run a process inside Emacs, that process is "inferior" (i.e. a subprocess). IELM M-x ielm is the builtin Inferior Emacs Lisp Mode. It's relatively featureless, but can definitely come in handy. (Esp. for learning Elisp) SLIME, the Superior Lisp Interaction Mode for Emacs, is mostly a joke on the whole "inferior" process name. SLIME is used ...


5

There is a way! The problem with using term is that term doesn't understand some of the escape sequences Julia sends, which causes term to put a bunch of extra prompts on the screen that make it unusable. This method should also work for more or less any REPL or terminal application you could want to run. There is a ridiculously useful terminal application ...


5

I think geiser-mode may provide what you are looking for at least for guile and racket, but apparently not MIT Scheme. I know that provides M-. to jump to symbol definition in environment, completion, and inline documentation help. Take a look at the introduction, and cheat sheet for a quick overveiw of features. Alternative, it does appear mit-scheme has ...


4

I think EIN's main value was to be able to connect arbitrary buffers to the ipython kernel that corresponds to the notebook, therefore enabling cooperation of multiple Emacs "objects". But since EIN's README only mentions ipython 0.12 and there hasn't been any activity for a while, it's highly likely that API changes make it currently unusable.


4

At a guess, your path to the Scheme implementation may be incorrect. Why do you think you need a backslash there? What do you want to quote/escape with it? Now, go to *scratch* buffer and evaluate your path. You will see that it may be a bit surprising: "C:/Program Files\ (x86)/Chicken Scheme/bin/csi.exe" ⇒ "C:/Program Files(x86)/Chicken Scheme/bin/csi....


4

On my system (Fedora 20) the default cabal version that comes with the haskell-platform package is 1.16.0.2. After installing the latest cabal-install (cabal install cabal-install), I have a new cabal binary in ~/.cabal/bin/cabal. If I don't do any particular configuration in Emacs, haskell-interactive-bring will fail with the same error you report. When ...


4

Every major mode that supports font-lock does so via font-lock-defaults. If you check python-mode, you'll see the following: (set (make-local-variable 'font-lock-defaults) '(python-font-lock-keywords nil nil nil nil)) If you're in a different major mode, you should be able to set font-lock-defaults to (python-font-lock-keywords nil nil nil nil) either ...


4

What you are looking for is called comint-mode - the system which underlies most (all?) emacs interaction modes (lisp, scheme, shell, python, &c). Here are some starting points: Comint: Writing your own Command Interpreter Comint Mode


4

Modes that communicate with external shells should inherit from comint mode. eshell is an exception w.r.t this principle since it emulates almost all commands on elisp-base. First, setting output read-only is described for eshell afterwards for comint-based modes. eshell The following lisp snippet demonstrates the usage of eshell-output-filter-functions ...


4

Is it correct to assume that you're new to Emacs? If yes, are you aware of how Emacs manages windows and that the term 'window' does not refer to what you think it does? The concepts 'windows' and 'frames' are described on https://www.gnu.org/software/emacs/manual/html_node/elisp/Windows-and-Frames.html and (more from the user's perspective) on https://www....


3

I had this disturbing warning in Emacs 25.1 too. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24401 has proper solution to enable colored-stats only for Bash: $ cat ~/.inputrc $if Bash set colored-stats on $endif


3

Do you have clojure mode installed? Try M-x install-package clojure-mode if not and then run cider-jack-in.


2

You can achieve this by adjusting the value of display-buffer-alist: (setq display-buffer-alist (quote (("\\*inferior-lisp\\*" display-buffer-pop-up-frame (nil))))) This setting tells Emacs that a buffer with the name matching the regular expression "\*inferior-lisp\*" should be displayed in a new (pop-up) frame. (You can also customize ...


2

The layer for idris in Spacemacs use this https://github.com/idris-hackers/idris-mode. So for my part, using spacemacs and helm, I succesfully load a file using contrib using the following shortcut: SP+: idris-set-idris-load-packages + RET contrib + RET CTR + RET


2

By holy mode, do you mean the normal emacs mode? If so, you can easily switch between the two with C-z. EDIT. To automate this for a specific mode, try using evil-set-initial-state. I'm not familiar with REPLs, but maybe this can help. I use the following to switch to emacs bindings when using org-brain. Replace 'org-brain-visualize with the mode you use ...


2

The native completion mechanism depends on the gnureadline python module. You can check if it's present by executing import readline print(readline.__doc__) at a python shell. The message ImportError: No module named readline indicates it's missing. It can be installed with pip install gnureadline. When it's correctly installed, the above code should ...


2

The REPL interaction mode you are looking for is probably met by ielm (Inferior Emacs Lisp mode). Here's the start of a solution†: Open ielm-mode with M-x ielm. Advise ielm-eval-input to wrap the expressions with edebug-eval-expression: (defun my/ielm-edebug-eval-input (orig-func input-string &rest args) "Wrapper function for evaluating expressions ...


2

Yes. C-u C-x C-e eval-last-sexp-and-insert , evaluates the last sexp and inserts it at point. or: in the cider-eval menu : eval-last-sexp-and-pretty-print-comment insert the output as a comment in the following line like so: (def xx {:a "a" :b "b"}) ;; => #'ns-name.playground/xx (:a xx) ;; => "a" (:c xx "nothing") ;; => "nothing"


1

Absolutely. Turn on shell-script-mode/sh-mode in the scriptfile buffer, perhaps switch to zsh with C-c : for sh-set-shell (could change the first line of your script), and maybe mark some lines and press C-c C-n for sh-send-line-or-region-and-step - this did not switch to a re-used shell-buffer in the other window in my experiments. I can't figure out how to ...


1

After trying @luc-duzan's answer, Spacemacs prompted me for whether to persist the setting. When I selected yes, the following was added to my buffer: -- Local Variables: -- idris-load-packages: ("contrib") -- End: Sure enough, this caused it to work after closing and re-opening Spacemacs, without going back through the steps. It's a bit of noise added to ...


1

TL;DR Sample configuration: (setq-default py-shell-name "python" ; \ Default value under Unices py-python-command "python" ; / py-python-command-args '("-i" "/absolute/path/to/manage.py" "shell_plus")) Elaboration Being the package's maintainer, Andreas Röhler's answer is of course entirely correct and based on the project's README. I ...


1

Install eval-in-repl from MELPA and configure it as described in the readme at https://github.com/kaz-yos/eval-in-repl/blob/master/README.md Current instructions from the readme suggest ;;; Python support ;; (require 'python) ; if not done elsewhere (require 'eval-in-repl-python) (add-hook 'python-mode-hook '(lambda () (local-set-key (kbd "<C-...


1

Elpy can do that https://github.com/jorgenschaefer/elpy The command you are looking for would be elpy-shell-send-current-statement. You can also try elpy-shell-send-region-or-buffer Send the active region or the buffer to the Python shell. If there is an active region, send that. Otherwise, send the whole buffer.


1

A combination of changes in ielm and comint from Emacs 23 to 24 introduced what looks like a bug in determining the position of the start of a comint-derived line, which in turn affects whether indentation is attempted in ielm. This bug seems to have been fixed in Emacs 25. Compare the definition of ielm-indent-line in Emacs 23 and 24: (defun ielm-indent-...


1

For a REPL, it was simple: (comint-send-input)


1

Hm... Let me make this an answer. TAB in a Python REPL triggers yas-expand in your case. This in turn calls python-shell-completion-complete-or-indent, which calls indent-for-tab-command. This is controlled by the regular Emacs indentation variables, which are buffer local. To fix this, you can do the following: (add-hook 'inferior-python-mode-hook (...


1

Looking at the code, I didn't see an obvious hook that is run. However, the problem can still be solved using advice. I would suggest using "after" advice on python-shell-send-string. You could have it flash the current window (see whatever visible-bell does), or play a whooshing sound, or whatever you like.


1

If you use the slime version that matches swank-js then everything just works. Specifically, I checked out the 2012-02-12 slime branch and made sure that slime-js.el was in that slime/contrib directory and everything just worked!


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