From: André L. T. R. <and...@gm...> - 2013-08-18 22:16:03
|
On Fri, 2013-08-16 at 23:53 +0000, mat...@li... wrote: > Today's Topics: > > 1. Emacs matlab-mode (Andr? Luiz Tietb?hl Ramos) > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 17 Jul 2013 08:00:45 -0300 > From: Andr? Luiz Tietb?hl Ramos <and...@gm...> > Subject: [Matlab-emacs-discuss] Emacs matlab-mode > To: mat...@li..., el...@ma... > Message-ID: <1374058845.8334.11.camel@Sigmatech> > Content-Type: text/plain; charset="utf-8" > > Hello, > > I'm trying to use this mode in ubuntu 13.04 to no avail and would like > your support. CEDET 1.1 is installed. The relevant parts of my .emacs > are below. > > CEDET: > > ;; Load CEDET. > ;; See cedet/common/cedet.info for configuration details. > ;; IMPORTANT: For Emacs >= 23.2, you must place this *before* any > ;; CEDET component (including EIEIO) gets activated by another > ;; package (Gnus, auth-source, ...). > (load-file "/usr/share/emacs/site-lisp/cedet-1.1/common/cedet.el") > ;; (load-file "~/cedet-VERSION/common/cedet.el") > ;; Enable EDE (Project Management) features > (global-ede-mode 1) > ;; Enable EDE for a pre-existing C++ project > ;; (ede-cpp-root-project "NAME" :file "~/myproject/Makefile") > ;; Enabling Semantic (code-parsing, smart completion) features > ;; Select one of the following: > ;; * This enables the database and idle reparse engines > (semantic-load-enable-minimum-features) > ;; * This enables some tools useful for coding, such as summary mode, > ;; imenu support, and the semantic navigator > (semantic-load-enable-code-helpers) > ;; * This enables even more coding tools such as intellisense mode, > ;; decoration mode, and stickyfunc mode (plus regular code helpers) > ;; (semantic-load-enable-gaudy-code-helpers) > ;; * This enables the use of Exuberant ctags if you have it installed. > ;; If you use C++ templates or boost, you should NOT enable it. > ;; (semantic-load-enable-all-exuberent-ctags-support) > ;; Or, use one of these two types of support. > ;; Add support for new languages only via ctags. > ;; (semantic-load-enable-primary-exuberent-ctags-support) > ;; Add support for using ctags as a backup parser. > ;; (semantic-load-enable-secondary-exuberent-ctags-support) > ;; Enable SRecode (Template management) minor-mode. > ;; (global-srecode-minor-mode 1) > > MATLAB: > > ;; MATLAB mode > ;; Replace path below to be where your matlab.el file is. > ;; Add matlab location > (add-to-list 'load-path "/opt/matlab/bin") > ;; (add-to-list 'load-path > "/usr/share/emacs/site-lisp/emacs-goodies-el") > (add-to-list 'load-path "/usr/share/emacs/site-lisp/matlab-emacs") > ;; (add-to-list 'load-path > "/home/andreltr/Documents/matlab/matlab-emacs/") > (require 'matlab-load) > (autoload 'matlab-mode "matlab" "Enter MATLAB mode." t) > (setq auto-mode-alist > (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) > (autoload 'matlab-shell "matlab" "Interactive MATLAB mode." t) > ;; Turn off Matlab desktop > (setq matlab-shell-command-switches '("-nodesktop -nojvm")) > ;; User Level customizations (You need not use them all): > (setq matlab-indent-function-body t) ; if you want function bodies > indented > (setq matlab-verify-on-save-flag nil) ; turn off auto-verify on save > (defun my-matlab-mode-hook () > (setq fill-column 76)) ; where auto-fill should wrap > (add-hook 'matlab-mode-hook 'my-matlab-mode-hook) > (defun my-matlab-shell-mode-hook () > '()) > (add-hook 'matlab-shell-mode-hook 'my-matlab-shell-mode-hook) > ;; Enable CEDET feature support for MATLAB code. (Optional) > (matlab-cedet-setup) > ;; (autoload 'tlc-mode "tlc" "tlc Editing Mode" t) > (add-to-list 'auto-mode-alist '("\\.tlc$" . tlc-mode)) > (setq tlc-indent-function t) > > When I open a very simple .m file such as for instance one with the code > a=2 only, the matlab shell is not open and I receive the message Output > file descriptor of MATLAB is closed. Would anyone know how to solve this > issue? > I found the solution through the emacs newsgroup. My .emacs MATLAB section is below. ;; MATLAB mode ;; Replace path below to be where your matlab.el file is. ;; Add matlab location (add-to-list 'load-path "/opt/MATHWORKS_R2009B/bin") (add-to-list 'load-path "/opt/matlab/bin") (add-to-list 'load-path "~/.emacs.d/matlab-emacs") (load-library "matlab-load") (custom-set-variables '(matlab-shell-command-switches '("-nodesktop -nosplash"))) (add-to-list 'load-path "/usr/share/emacs/site-lisp/emacs-goodies-el") ;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/matlab-emacs") ;; (add-to-list 'load-path "/home/andreltr/Documents/matlab/matlab-emacs/") (require 'matlab-load) (autoload 'matlab-mode "matlab" "Enter MATLAB mode." t) (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) (autoload 'matlab-shell "matlab" "Interactive MATLAB mode." t) ;; Turn off Matlab desktop ;; (setq matlab-shell-command-switches '("-nodesktop -nojvm")) ;; User Level customizations (You need not use them all): (setq matlab-indent-function-body t) ; if you want function bodies indented (setq matlab-verify-on-save-flag nil) ; turn off auto-verify on save (defun my-matlab-mode-hook () (setq fill-column 76)) ; where auto-fill should wrap (add-hook 'matlab-mode-hook 'my-matlab-mode-hook) (defun my-matlab-shell-mode-hook () '()) (add-hook 'matlab-shell-mode-hook 'my-matlab-shell-mode-hook) ;; Enable CEDET feature support for MATLAB code. (Optional) (matlab-cedet-setup) ;; (autoload 'tlc-mode "tlc" "tlc Editing Mode" t) (add-to-list 'auto-mode-alist '("\\.tlc$" . tlc-mode)) (setq tlc-indent-function t) I also defined an executable shell script called matlab.sh which, in this case, begins emacs in MATLAB mode automatically and sets the $PATH variable. It is required to do that is one uses the GNOME side panel ICON to call emacs because it doesn't read the .bashrc PATH seeting AFAIK. #! /bin/bash # environment variables export PATH=$PATH:/opt/gams:/opt/cmucl/bin:/opt/MagicDraw\ UML/bin:/opt/CPNTools:/opt/Protege:/opt/bin:/opt/android-sdk:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/smlnj:/opt/smlnj/bin:/opt/smlnj/lib:/opt/MATHWORKS_R2009B/bin:/opt/matlab/bin emacs --eval '(matlab-mode)' Andre Luiz > > > |