Matlab-emacs integration - Symbol's value as variable is void: letion - matlab

I am new to emacs and I was trying to install the Matlab mode for emacs following the instruction on this page:
matlab script editing
Everything compiled fine, but I ran into this error:
Symbol's value as variable is void: letion
When I did "emacs --init-debug" it gave me the following:
Debugger entered--Lisp error: (void-variable letion)
eval-buffer(#<buffer *load*> nil "/home/wjlee/.emacs" nil t) ; Reading at buffer position 404
load-with-code-conversion("/home/wjlee/.emacs" "/home/wjlee/.emacs" t t)
load("~/.emacs" t t)
#[0 "\205\262
I googled around a bit and some people said it's related to using older versions of emacs (emacs23 or older), however, I have emacs24.3.1, so I am not sure why this is still the case. Does anyone know how to fix this, please?

I decided to go a clean install of emacs24.3.1 again, without recompiling cedet and the matlab-emacs components, and somehow it works now... It seems like (from what I found on the web) although the newest version of CEDET is not bundled with emacs24, those that are already in there is enough for me to do the matlab-emacs integration.
Since I am very new to using all these, I'll just post what I found here:
To do a clean install of emacs24:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:cassou/emacs
sudo apt-get update
sudo apt-get purge emacs-snapshot-common emacs-snapshot-bin-common emacs-snapshot emacs-snapshot-el emacs-snapshot-gtk emacs23 emacs23-bin-common emacs23-common emacs23-el emacs23-nox emacs23-lucid auctex emacs24 emacs24-bin-common emacs24-common emacs24-common-non-dfsg
sudo apt-get install emacs24 emacs24-el emacs24-common-non-dfsg
sudo rm /etc/apt/sources.list.d/cassou-emacs-precise.list
Download matlab.el:
cvs -d:pserver:anonymous#matlab-emacs.cvs.sourceforge.net:/cvsroot/matlab-emacs login
cvs -z3 -d:pserver:anonymous#matlab-emacs.cvs.sourceforge.net:/cvsroot/matlab-emacs co -P matlab-emacs
And modify ~/.emacs:
(add-to-list 'load-path "~/.emacs.d/matlab-emacs")
(load-library "matlab-load")
I also found the following useful:
(custom-set-variables
'(matlab-shell-command-switches '("-nodesktop -nosplash")))
And some short-cuts:
Some useful short cuts to begin with:
C-c C-r : run region in matlab
C-c C-s : save and run the file in matlab
C-c C-c E : insert a matching END statment
M-TAB : symbol/variable completion based on the script
M-s : brings up matlab-shell (in a different buffer if available)
M-p, M-n : in matlab-shell (or any emacs shell) cycle through past commands

Related

Unable to install cider to emacs - package not found

Fresh install of Ubuntu 20.04
Added openjdk-11 and lein 2.9.3
$ sudo apt-add-repository ppa:kelleyk/emacs
Installed
GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14)
of 2020-03-26, modified by Debian
Tried the instructions on the cider Getting Started page
M-x package-refresh-contents
M-x package install <RET>
cider <RET>
The cider package isn't found. Tried to package-list-packages - list doesn't contain cider.
What am I missing?
Finally did the steps from the following link to get it to work
Brave Clojure book companion repo
Not sure why the cider instructions don't mention this.
You need to create a ~/.emacs.d/init.el file with the following contents
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
Save and restart emacs.
M-x package-list-packages check the archive column shows packages from gnu as well as melpa archives.
Sometimes you would see an error Failed to download ‘gnu’ archive. - this one is a flaky one. A restart and/or M-x package-refresh-contents fixed it for me.
Now we have the sources configured correctly.
Install:
M-x package-install <RET> cider <RET>
M-x package-list-packages - Move to the end of the listing to see Status=installed packages.
Test: M-x cider-jack-in. Answer no to the prompt indicating you are not in a clojure project. Soon you should be dropped to a user> prompt - ready to REPL and roll.
You may also consider trying out popular existing "bundle setups' like Spacemacs and Prelude Both of which have all the tooling necessary for Clojure development built-in.
Instead of modifying .emacs or init file manually, you can just change the package-archives variable by typing the following:
M-x customize-variable package-archives
By default, you should only have a GNU source set. Go ahead and add Melpa's name and URL (https://melpa.org/packages/) too by clicking INS. Then apply the changes. Next, type the following commands into the terminal:
M-x package-refresh-contents [RET]
M-x package-install [RET] cider [RET]
You should be all set.
CIDER is available on the two major package.el community maintained repos - MELPA Stable and MELPA.
After adding the following in my ./emacs, i could install CIDER.
(setq package-archives
'(("Elpa" . "https://elpa.gnu.org/packages/")
("Melpa Stable" . "https://stable.melpa.org/packages/")
("Melpa" . "https://melpa.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/"))
package-archive-priorities
'(("MELPA Stable" . 10)
("GNU ELPA" . 5)
("MELPA" . 0)))

process inferior-lisp not running

I installed sbcl
sudo apt-get install sbcl
then loaded quicklisp
sbcl --load ~/Downloads/quicklisp.lisp
then ran the installation command for installing quicklisp
(quicklisp-quickstart:install)
added quicklisp to my init file
(ql:add-to-init-file)
and then installed slime
(ql:quickload "quicklisp-slime-helper")
which then printed out:
(load (expand-file-name "~/quicklisp/slime-helper.el"))
;; Replace "sbcl" with the path to your implementation
(setq inferior-lisp-program "sbcl")
Which I dutifully copied to my Emacs initialization file.
Upon running M-xslime I got the following error:
Searching for program: No such file or directory, sbcl
so I changed inferior-lisp-program to "/usr/bin/sbcl" as such:
(setq inferior-lisp-program "/usr/bin/sbcl")
Now, when I run M-xslime I get:
Process inferior-lisp not running
and in ielm when I enter inferior-lisp-program I get
ELISP> inferior-lisp-program
"/usr/bin/sbcl"
So I am all out of ideas of what I might have gone wrong. This is a new install by me, and I have used Common Lisp and SBCL in the past with no hiccups. What did I screw up?
edit:
It turns out I was getting this information in the **Inferior Lisp** buffer:
emacs: /usr/bin/sbcl: No such file or directory
Process inferior-lisp exited abnormally with code 127
Turns out it is because I installed Emacs via Flatpak. Emacs installed via Ubuntu's default repository is able to use SBCL and other binaries.

error when using load-theme from emacs

I am running emacs 24.4.50.1 and when I add the following line
(load-theme 'wombat t)
I get the following error when I try and start emacs:
Fatal error 6: Abort trap^[[>0;95;c/usr/local/bin/emacs: line 2: 676
Abort trap: 6
/usr/local/Cellar/emacs/HEAD/Emacs.app/Contents/MacOS/Emacs -nw "$#"
The same thing happens when I enter the command:
load-them <RET> wombat
I installed this via homebrew:
brew install emacs --HEAD --use-git-head --cocoa --with-gnutls
Which installed version 24.4.50.1
I uninstalled this and installed version 24.3.1 and the problem went away so it seems the issues is with the HEAD of emacs.

run sml console at emacs - searching for program: no such file or directory?

I installed SML on Ubuntu 12.04.
Here is more info:
nazar_art#nazar-desctop:~$ sml -version
Standard ML of New Jersey v110.75 [built: Mon Sep 2 23:36:16 2013]
And added to emacs this package:
M x list-packages + Enter
find sml-mode and install by mouse click.
But when I tried write easy .sml file I want to open sml console at emacs.
I press C c + C s => I see SML command: sml and press Enter.
And see this message:
Searching for program: no such file or directory
Instead of opening sml console.
I couldn't figure out why this happen?
How to solve this trouble?
Update:
Here is my which sml:
/usr/local/SML/bin/sml
and emacs version - GNU Emacs 24.3.1
Installed from here but only for emacs24, not for emacs-snapshot.
Option 4: Eval the following with: C-M-: (setq exec-path (cons "/usr/local/SML/bin" exec-path)) return/enter or put it into $home/.emacs to make it persist over all sessions.
Your problem is that the sml executable isn't on the PATH that Emacs sees.
And you can launch sml from bash probably because you modify path
in ~/.bashrc.
Option 1: modify PATH
In ~/.profile (you'll need to log out once):
export PATH=$PATH:/usr/local/SML/bin/
Option 2: create link
sudo ln -s /usr/local/SML/bin/sml /usr/bin/sml
Option 3: apt installs for me sml to /usr/bin/ (Emacs knows this path)
sudo apt-get install smlnj
Just elaborating on the steps mentioned by the Bleeding fingers:
Step1: Launch emacs from terminal.
step2: Press ctrl+x+f.
step3: You will get something in the bottom saying "Find a file:~/" then there write "/.emacs".
step4: Paste this line "setq exec-path (cons "/usr/local/SML/bin" exec-path))" in that.
step5: Press Ctrx+x+s to save the changes and then restart the emacs.

Emacs Autocomplete: the function `define-package` is not known

I am trying to install autocomplete mode on OS X 10.8.4 using emacs 24 installed through brew.
I have cloned autocomplete through git git mirror here and I'm following the build instructions build instructions here. I am getting an error during make install telling me that define-package (presumably some elisp) is undefined.
➜ auto-complete git:(master) make install
emacs -Q -L . -batch -l etc/install
Install to: ~/.emacs.d/
Installing to ~/.emacs.d/ from /Users/f/src/auto-complete/
In toplevel form:
auto-complete-config.el:31:1:Error: Cannot open load file: popup
In end of data:
auto-complete-pkg.el:5:1:Warning: the function `define-package' is not known
to be defined.
Wrote /Users/f/src/auto-complete/auto-complete-pkg.elc
In toplevel form:
auto-complete.el:51:1:Error: Cannot open load file: popup
83117999910111511510211710810812132105110115116971081081011003310106510010032116104101321021111081081111191051101033299111100101321161113212111111711432461011099799115581010409710010045116111451081051151163239108111971004511297116104323412647461011099799115461004734411040114101113117105114101323997117116111459911110911210810111610145991111101021051034110409799459911111010210510345100101102971171081164110
Anybody encounter this before / have a fix?
Install using Melpa or Marmalade via package.el. Auto-complete expects to be installed this way, and you'll also get updates installed very easily.
If you don't have package.el configured already, add the following to .emacs or .emacs.d/init.el
(setq package-archives
'(
("marmalade" . "http://marmalade-repo.org/packages/")
("elpa" . "http://tromey.com/elpa/")
("melpa" . "http://melpa.milkbox.net/packages/")
("gnu" . "http://elpa.gnu.org/packages/")
))
(package-initialize) ;; init elpa packages
Just run M-x package-list-packages (or M-x p-l-p TAB) and install auto-complete from the package list, mark packages with i use x to run the installation of marked packages.
Periodically, opening M-x package-list-packages and pressing U will mark installed packages for updating, press x to run the updates.
This is assuming Emacs 24.