From 8d900aff246cc20e70871fd408eee10e4a884f19 Mon Sep 17 00:00:00 2001 From: zappo Date: Fri, 5 Sep 2008 20:18:00 +0000 Subject: [PATCH] (semantic-matlab-root-directory): New Function. (semantic-matlab-function-tags): Update to use above. --- semantic-matlab.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/semantic-matlab.el b/semantic-matlab.el index 5f0b053..25c8c61 100644 --- a/semantic-matlab.el +++ b/semantic-matlab.el @@ -65,6 +65,12 @@ Use `semantic-matlab-system-paths-include' to let semantic know which system directories you would like to include when doing completions.") +(defun semantic-matlab-root-directory () + "Calculate the current MATLAB root directory." + (if (matlab-shell-active-p) + (matlab-shell-matlabroot) + semantic-matlab-root-directory)) + ;; The version of this variable in MATLAB.el is not condusive to extracting ;; the information we need. (defvar semantic-matlab-match-function-re @@ -86,7 +92,7 @@ START=END=0 and no arguments or return values." (taglist nil) ) (goto-char (point-min)) - (if (and (string-match (format "^%s" semantic-matlab-root-directory) + (if (and (string-match (format "^%s" (semantic-matlab-root-directory)) (buffer-file-name)) (looking-at "%\\([A-Z0-9_]+\\)\\s-+\\(.*\\)\\s-*$")) ;; This is a builtin function, ie there's no function line. @@ -113,7 +119,7 @@ START=END=0 and no arguments or return values." (forward-line) (beginning-of-line) ;; snarf doc string - (cond + (cond ;; Mathworks standard ((looking-at "%[A-Z0-9_]+\\s-+\\(.*\\)\\s-*$") (match-string-no-properties 1))