-
Notifications
You must be signed in to change notification settings - Fork 0
/
cedet-matlab.el
61 lines (48 loc) · 1.79 KB
/
cedet-matlab.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
;;; cedet-matlab.el --- CEDET Setup support
;;
;; Copyright (C) 2009, 2012 Eric Ludlam
;;
;; Author: Eric Ludlam <eludlam@mathworks.com>
;; X-RCS: $Id$
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or (at
;; your option) any later version.
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;
;; Setup miscelaneous CEDET tools to work with MATLAB.
;;; Code:
;;;###autoload
(defun matlab-cedet-setup ()
"Update various paths to get SRecode to identify our macros."
(interactive)
;; Setup Semantic parser:
(add-hook 'matlab-mode-hook 'semantic-default-matlab-setup)
;; Setup semanticdb for MATLAB support:
(require 'semanticdb-matlab)
;; Setup Semantic Recoder (Template support for MATLAB and TLC.):
(let* ((lib (locate-library "matlab.el" t))
(ededir (file-name-directory lib))
(tmpdir (file-name-as-directory
(expand-file-name "templates" ededir))))
(when (not tmpdir)
(error "Unable to locate MATLAB Templates directory"))
;; Rig up the map.
(condition-case nil
(require 'srecode-map)
(error (require 'srecode/map)))
(add-to-list 'srecode-map-load-path tmpdir)
(srecode-map-update-map t)
)
)
(provide 'cedet-matlab)
;;; cedet-matlab.el ends here