Hot answers tagged

14

FYI, some modes open only one inferior processs. For example, run-python will open an inferior process only if there isn't already an inferior process running. What you suggested with run-python actually does what you want. For other modes (Matlab?), you could use a function that unhooks itself, like so: (defun run-python-once () (remove-hook 'python-...


9

I achieved what I wanted by overriding some definitions from the original major mode. In /lisp/progmodes/octave.el (the file was zipped, I had to unzip it to view the source), I redefined octave-indent-comment which originally goes like this: (defun octave-indent-comment () "A function for `smie-indent-functions' (which see)." (save-excursion (back-...


7

Try using more than one % or # in a row: %% or %%% etc. By default, the number of consecutive comment chars determines the kind of comment and its behavior (e.g., with respect to indentation). See the Elisp manual, node Comment Tips.


6

I have so far discovered that spawning a new Emacs process is a solution. Here is what I have done. 1. Add a function to start an external emacs process. init.el (defvar my/async-emacs-repl-org-babel-init-file "~/.emacs.d/org-babel-async-init" "File to load on executing async babel evaluation.") (defun my/async-emacs-repl--start (process-name init-file) ...


5

For future references and out-of-box libraries. I will accept this one for the answer because these are more recent. ob-async Here's a library using async.el https://github.com/linktohack/ob-async org-babel-eval-in-repl My other solution (available in melpa): https://github.com/diadochos/org-babel-eval-in-repl


3

Unless some thing has changed with newer versions of MatLab, short answer is you cannot (MaTLaB 2011b here). Eric Ludlam, maintainer of matlab-emacs, does say so here in the matlab-emacs mailing list. MatLab lost an undocumented API which allowed it to show icons for breakpoints with select versions of GUD.


3

This issue is related to recent changes in org-mode (i.e. org 9.3). In the latest change log they mentioned that: :file header argument no longer assume "file" :results The "file" :results value is now mandatory for a code block returning a link to a file. The :file or :file-ext header arguments no longer imply a "file" result is expected. So, one ...


1

Here's a version that seems to work (discovered by trial-and-error; and BTW it is using octave, since I don't have matlab): #+NAME: vectsb #+begin_src octave :var a=[0] :var b=[0] :session a+b #+end_src #+RESULTS: vectsb : 0 #+CALL: vectsb(a=[1 2 3],b=[3 2 1]) #+RESULTS: | 4 | 4 | 4 | The org-babel section of the Org mode manual ...


1

The function org-babel-octave-evaluate-session is bugged. Fixed it with a rewrite. It should work correctly on Matlab input now. If anyone else has trouble with Matlab and org-babel interfacing in session mode, copy the following to a file and run (require 'ob-octave-fix.el nil t): ;; Session evaluation of MATLAB in org-babel is broken, this goes some ;; ...


1

The package name is matlab-mode but the provided feature is matlab. Have a look at the very end of that source code file. According to use-package Manual you have to get that right. So your use-package declaration should look like this: (use-package matlab :ensure matlab-mode :config (add-to-list 'auto-mode-alist '("\\.m\\'" . matlab-mode)) (...


1

octave-mode does have some keywords (see source). Even so, you can add your own: (font-lock-add-keywords 'octave-mode '(("\\<load\\>". font-lock-keyword-face) ("\\<clear\\>". ...


1

Supposedly, this is a bug in MATLAB R2016b. A solution is to downgrade to R2016a! I installed R2016b to find out that MATLAB crashes upon start up. What is strange however, is that I managed to run R2016b from Emacs once. My first thought was a bad configuration, but it kept crashing despite having cleared the config from ~/Library/Application\ Support/...


1

Start by installing el-get; then, juts el-get-install and select matlab-mode. Then, have a look to INSTALL and README. Here you'll find all you need. Don't forget to (require 'matlab-load) At this point, you'll be able to launch the matlab shell as an inferior process, evaluate regions, lines, etc., and use mlint to check your code. Note that you may ...


1

I don't use MATLAB, but this sounded like a problem I had when first starting to use emacs. Did you originally try M-x compile to compile your code? That will run the shell command specified by the next input. The default is make, which is used for c programming. Here's the documentation: http://www.gnu.org/software/emacs/manual/html_node/emacs/Compilation....


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