From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: Per-language project-search-path, was: Re: Unified project interface Date: Mon, 03 Aug 2015 01:39:33 +0200 Message-ID: <87mvy9uuoa.fsf@web.de> References: <557039DB.4060607@yandex.ru> <86zj2jb1tx.fsf@stephe-leake.org> <55B517AC.5020401@yandex.ru> <86oaiybvbf.fsf@stephe-leake.org> <55B62B53.5060003@yandex.ru> <861tftaxgx.fsf@stephe-leake.org> <55B78F49.6010101@yandex.ru> <868ua09s1y.fsf@stephe-leake.org> <55B7CD86.20306@yandex.ru> <86oaiv8zqn.fsf@stephe-leake.org> <55B9590C.3080108@yandex.ru> <86wpxi6ovl.fsf@stephe-leake.org> <55BABE27.4040105@yandex.ru> <868u9wz4mw.fsf@stephe-leake.org> <55BC1D5F.4010502@yandex.ru> <86d1z7jnl9.fsf@stephe-leake.org> <55BCD3E9.40606@yandex.ru> <55BD807B.5030206@gmail.com> <877fpef4pl.fsf@esperi.org.uk> <87oaiptxxc.fsf@web.de> <55BEA31E.6010802@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1438558799 12421 80.91.229.3 (2 Aug 2015 23:39:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Aug 2015 23:39:59 +0000 (UTC) Cc: Nix , emacs-devel@gnu.org, Stephen Leake , Dmitry Gutov To: Eric Ludlam Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 03 01:39:50 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZM2r7-00088F-8C for ged-emacs-devel@m.gmane.org; Mon, 03 Aug 2015 01:39:49 +0200 Original-Received: from localhost ([::1]:57044 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM2r6-0001lw-CS for ged-emacs-devel@m.gmane.org; Sun, 02 Aug 2015 19:39:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM2r3-0001lr-7j for emacs-devel@gnu.org; Sun, 02 Aug 2015 19:39:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZM2qy-0003No-6I for emacs-devel@gnu.org; Sun, 02 Aug 2015 19:39:45 -0400 Original-Received: from mout.web.de ([212.227.17.12]:50781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZM2qx-0003Nk-Tm for emacs-devel@gnu.org; Sun, 02 Aug 2015 19:39:40 -0400 Original-Received: from drachen.dragon ([90.187.7.100]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MYvxn-1ZQDik1C9T-00Vf0y; Mon, 03 Aug 2015 01:39:37 +0200 In-Reply-To: <55BEA31E.6010802@gmail.com> (Eric Ludlam's message of "Sun, 02 Aug 2015 19:09:18 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:z7QF/n2RRTbpwbbYL6/AfGSRX3eHvfyFGtDwRLjz0Q8x6XCYYeL ujnfjRJ/ShVGshfyn7xFN/QyF3W6Sn4YjctaBkBFLubFIjPkcOu198bHkk0dKyAA7PSfYBh VX7fS8QmZJVwikLxvRTn10HFIoEzBbcWWJdvMf4pM8WlOqeyYjsGwfCLO2HUUVk3FUX48ad T6FzF+/WDqlaKvpe83wMw== X-UI-Out-Filterresults: notjunk:1;V01:K0:3SA8d58bSwM=:8KhyYkvSRyRD4QT2eKaRem ZaO5afjcwKLz6x7Ikt/El9y4a0PpVTTzvcti9SGPaPkp4R3M0zEJXooWSwOUdAdtDBccGlNXi 020GZB3Grf2XGqA/V/rewRw6GjlQFxR7vjOLFrqI+iB/jmDeygsF9UOjLIzBFNj+q6928lj1h GnxtZcefyo7fSylx2ZHfdAvBkoDdATRS2WS4yVdqfR+jNUVq05MGVgT3MK0CWpmh5RMW43ZaJ 3i202Di07eIQoR8Z+gx3ihDk1yfP4i2paKNkXANDTS8p7gkdqJXBTpLyueEL+UcNMrodVbRS2 8SF7d4CulWf4O0gih5B8mH6lO6MjzkVywy/aHsYRYHXMwH4x3vXcDA9AcjRug9Effd+YaA0rj pO3B9NLrvU6BYOYDDvBj7cde+dweUPHL1xmZGO7zdKg2F0vtRE0DrJTaMWUyYBQOtKdqr/h9I IqHTJgPYmypozzAgUBR+n55BFk52NeNbbu4gPh+zhY9oF4HPQuig9hZX5LOUGUbIVS7xaotXh 6jugcF0eI1Xohn19gLgRr/Lvu64NIVfP967pSzEnPD0Izl/pjhGnhs+CByOGlNPPhx/dpDVJe twzLqtqpavDQV5q3vjFZLh9D/krLQmd8ScNnL89cfqp6urPbMYVGOlrbliCOQJXuaUZtOLtyQ abZwQUVJCcQORkv4sp1RSFA0qMOb2jO3YRwXb2S4hUQ4fFw2DEMRaUTlDPwVWJnchKw0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:188310 Archived-At: Eric Ludlam 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 #:b uffer) (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))) symlis t) (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) (f orward-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.