emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Per-language project-search-path, was: Re: Unified project interface


From: Michael Heerdegen
Subject: Re: Per-language project-search-path, was: Re: Unified project interface
Date: Mon, 03 Aug 2015 01:39:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Eric Ludlam <address@hidden> writes:

> It may be that the specifics you are looking for are part of the local
> context parser, which includes functions such as -get-local-variables,
> -get-local-arguments, and -current-symbol, which gets the whole
> symbols in a dotted expression.   This is in semantic/ctxt.el.

Thanks for the explanations.

I gave these functions a quick try, evaluating them via M-:
(the-function), with not much luck.  In Elisp, all calls always returned
nil.  In a C file, I even got an error:

Debugger entered--Lisp error: (wrong-type-argument syntax-table-p nil)
  set-syntax-table(nil)
  (progn (set-syntax-table semantic-lex-syntax-table) (save-excursion (cond 
((looking-at "\\w\\|\\s_") (forward-sexp 1)) ((looking-at fieldsep1) nil) 
((save-excursion (and (condition-case nil (progn ... ... t) (error nil)) 
(looking-at fieldsep1))) (setq symlist (list "")) (forward-sexp -1) (while 
(looking-at "\\s(") (forward-sexp -1)) (forward-sexp 1))) (setq end (point)) 
(condition-case nil (while (save-excursion (forward-char -1) (looking-at 
"\\w\\|\\s_")) (forward-sexp -1) (setq symlist (cons 
(buffer-substring-no-properties (point) end) symlist)) (let ((cp (point))) 
(forward-sexp -1) (forward-sexp 1) (if (<= cp (point)) (error nil))) (if 
(looking-at fieldsep) (progn (forward-sexp -1) (while (and ... ...) 
(forward-sexp -1)) (forward-sexp 1) (setq end (point))) (error nil))) (error 
nil))) symlist)
  (unwind-protect (progn (set-syntax-table semantic-lex-syntax-table) 
(save-excursion (cond ((looking-at "\\w\\|\\s_") (forward-sexp 1)) ((looking-at 
fieldsep1) nil) ((save-excursion (and (condition-case nil ... ...) (looking-at 
fieldsep1))) (setq symlist (list "")) (forward-sexp -1) (while (looking-at 
"\\s(") (forward-sexp -1)) (forward-sexp 1))) (setq end (point)) 
(condition-case nil (while (save-excursion (forward-char -1) (looking-at 
"\\w\\|\\s_")) (forward-sexp -1) (setq symlist (cons 
(buffer-substring-no-properties ... end) symlist)) (let ((cp ...)) 
(forward-sexp -1) (forward-sexp 1) (if (<= cp ...) (error nil))) (if 
(looking-at fieldsep) (progn (forward-sexp -1) (while ... ...) (forward-sexp 1) 
(setq end ...)) (error nil))) (error nil))) symlist) (save-current-buffer 
(set-buffer #:buffer) (set-syntax-table #:table)))
  (let ((#2=#:table (syntax-table)) (#1=#:buffer (current-buffer))) 
(unwind-protect (progn (set-syntax-table semantic-lex-syntax-table) 
(save-excursion (cond ((looking-at "\\w\\|\\s_") (forward-sexp 1)) ((looking-at 
fieldsep1) nil) ((save-excursion (and ... ...)) (setq symlist (list "")) 
(forward-sexp -1) (while (looking-at "\\s(") (forward-sexp -1)) (forward-sexp 
1))) (setq end (point)) (condition-case nil (while (save-excursion 
(forward-char -1) (looking-at "\\w\\|\\s_")) (forward-sexp -1) (setq symlist 
(cons ... symlist)) (let (...) (forward-sexp -1) (forward-sexp 1) (if ... ...)) 
(if (looking-at fieldsep) (progn ... ... ... ...) (error nil))) (error nil))) 
symlist) (save-current-buffer (set-buffer #1#) (set-syntax-table #2#))))
  (with-syntax-table semantic-lex-syntax-table (save-excursion (cond 
((looking-at "\\w\\|\\s_") (forward-sexp 1)) ((looking-at fieldsep1) nil) 
((save-excursion (and (condition-case nil (progn ... ... t) (error nil)) 
(looking-at fieldsep1))) (setq symlist (list "")) (forward-sexp -1) (while 
(looking-at "\\s(") (forward-sexp -1)) (forward-sexp 1))) (setq end (point)) 
(condition-case nil (while (save-excursion (forward-char -1) (looking-at 
"\\w\\|\\s_")) (forward-sexp -1) (setq symlist (cons 
(buffer-substring-no-properties (point) end) symlist)) (let ((cp (point))) 
(forward-sexp -1) (forward-sexp 1) (if (<= cp (point)) (error nil))) (if 
(looking-at fieldsep) (progn (forward-sexp -1) (while (and ... ...) 
(forward-sexp -1)) (forward-sexp 1) (setq end (point))) (error nil))) (error 
nil))) symlist)
  (let* ((fieldsep1 (mapconcat (lambda (a) (regexp-quote a)) 
semantic-type-relation-separator-character "\\|")) (fieldsep (concat "[    
\n.]*\\(" fieldsep1 "\\)[       \n.]*\\(\\w\\|\\s_\\)")) (case-fold-search 
semantic-case-fold) (symlist nil) end) (with-syntax-table 
semantic-lex-syntax-table (save-excursion (cond ((looking-at "\\w\\|\\s_") 
(forward-sexp 1)) ((looking-at fieldsep1) nil) ((save-excursion (and 
(condition-case nil ... ...) (looking-at fieldsep1))) (setq symlist (list "")) 
(forward-sexp -1) (while (looking-at "\\s(") (forward-sexp -1)) (forward-sexp 
1))) (setq end (point)) (condition-case nil (while (save-excursion 
(forward-char -1) (looking-at "\\w\\|\\s_")) (forward-sexp -1) (setq symlist 
(cons (buffer-substring-no-properties ... end) symlist)) (let ((cp ...)) 
(forward-sexp -1) (forward-sexp 1) (if (<= cp ...) (error nil))) (if 
(looking-at fieldsep) (progn (forward-sexp -1) (while ... ...) (forward-sexp 1) 
(setq end ...)) (error nil))) (error nil))) symlist))
  (save-excursion (if point (goto-char point)) (let* ((fieldsep1 (mapconcat 
(lambda (a) (regexp-quote a)) semantic-type-relation-separator-character 
"\\|")) (fieldsep (concat "[       \n.]*\\(" fieldsep1 "\\)[       
\n.]*\\(\\w\\|\\s_\\)")) (case-fold-search semantic-case-fold) (symlist nil) 
end) (with-syntax-table semantic-lex-syntax-table (save-excursion (cond 
((looking-at "\\w\\|\\s_") (forward-sexp 1)) ((looking-at fieldsep1) nil) 
((save-excursion (and ... ...)) (setq symlist (list "")) (forward-sexp -1) 
(while (looking-at "\\s(") (forward-sexp -1)) (forward-sexp 1))) (setq end 
(point)) (condition-case nil (while (save-excursion (forward-char -1) 
(looking-at "\\w\\|\\s_")) (forward-sexp -1) (setq symlist (cons ... symlist)) 
(let (...) (forward-sexp -1) (forward-sexp 1) (if ... ...)) (if (looking-at 
fieldsep) (progn ... ... ... ...) (error nil))) (error nil))) symlist)))
  semantic-ctxt-current-symbol-default()
  ...

because semantic-lex-syntax-table is bound to nil which
`set-syntax-table' doesn't like.


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]