From b893e8a66b5599f28bf358ff7bafbc0386e250e1 Mon Sep 17 00:00:00 2001 From: Eric Ludlam Date: Wed, 26 Nov 2014 10:38:37 -0500 Subject: [PATCH] semantic: Allow empty type relation separation character * lisp/cedet/semantic/ctxt.el (semantic-ctxt-current-symbol-default): Allow the type relation separator to be empty for languages that don't have symbol sequences, such as grammars and Lisp. --- lisp/cedet/semantic/ctxt.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/cedet/semantic/ctxt.el b/lisp/cedet/semantic/ctxt.el index 78e5ec508f6..4ebc68f27e7 100644 --- a/lisp/cedet/semantic/ctxt.el +++ b/lisp/cedet/semantic/ctxt.el @@ -454,7 +454,8 @@ This will include a list of type/field names when applicable. Depends on `semantic-type-relation-separator-character'." (save-excursion (if point (goto-char point)) - (let* ((fieldsep1 (mapconcat (lambda (a) (regexp-quote a)) + (let* ((dosequence (not (null semantic-type-relation-separator-character))) + (fieldsep1 (mapconcat (lambda (a) (regexp-quote a)) semantic-type-relation-separator-character "\\|")) ;; NOTE: The [ \n] expression below should used \\s-, but that @@ -491,9 +492,11 @@ Depends on `semantic-type-relation-separator-character'." ;; Now that we have gotten started, let's do the rest. (condition-case nil - (while (save-excursion - (forward-char -1) - (looking-at "\\w\\|\\s_")) + (while (and + (or dosequence (not symlist)) + (save-excursion + (forward-char -1) + (looking-at "\\w\\|\\s_"))) ;; We have a symbol.. Do symbol things (forward-sexp -1) (setq symlist (cons (buffer-substring-no-properties (point) end) -- 2.39.5