unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Eric Ludlam <ericludlam@gmail.com>
Cc: Nix <nix@esperi.org.uk>,
	emacs-devel@gnu.org,
	Stephen Leake <stephen_leake@stephe-leake.org>,
	Dmitry Gutov <dgutov@yandex.ru>
Subject: Re: Per-language project-search-path, was: Re: Unified project interface
Date: Mon, 03 Aug 2015 01:39:33 +0200	[thread overview]
Message-ID: <87mvy9uuoa.fsf@web.de> (raw)
In-Reply-To: <55BEA31E.6010802@gmail.com> (Eric Ludlam's message of "Sun, 02 Aug 2015 19:09:18 -0400")

Eric Ludlam <ericludlam@gmail.com> 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.



  reply	other threads:[~2015-08-02 23:39 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 11:43 Unified project interface Dmitry Gutov
2015-06-04 14:40 ` Stephen Leake
2015-06-05  0:08   ` Dmitry Gutov
2015-06-05 10:08     ` Stephen Leake
2015-06-05 13:03       ` Stephen Leake
2015-06-05 13:14         ` Dmitry Gutov
2015-06-08  1:24           ` Stephen Leake
2015-06-09 18:16             ` Dmitry Gutov
2015-06-09 18:21               ` Eli Zaretskii
2015-06-09 18:49                 ` Dmitry Gutov
2015-06-09 19:03                   ` Eli Zaretskii
2015-06-07 23:22         ` Dmitry Gutov
2015-06-08  1:35           ` [SPAM UNSURE] " Stephen Leake
2015-06-09 19:04             ` Dmitry Gutov
2015-06-07 23:15       ` Dmitry Gutov
2015-06-08  1:59         ` Stephen Leake
2015-06-09 22:31           ` Dmitry Gutov
2015-06-10  7:13             ` Steinar Bang
2015-07-08  0:25             ` Dmitry Gutov
2015-07-11 13:43               ` Bozhidar Batsov
2015-07-11 14:17                 ` Dmitry Gutov
2015-07-12 14:42                   ` Dmitry Gutov
2015-07-13  8:49                   ` Bozhidar Batsov
2015-07-13 10:23                     ` Dmitry Gutov
2015-07-24 23:43       ` Dmitry Gutov
2015-07-25  0:55         ` Stephen Leake
2015-07-25  7:29           ` Eli Zaretskii
2015-07-26  2:12             ` Dmitry Gutov
2015-07-26  2:45               ` Eli Zaretskii
2015-07-26 11:25               ` Stephen Leake
2015-07-26  2:11           ` Dmitry Gutov
2015-07-26 11:22             ` Stephen Leake
2015-07-26 17:23               ` Dmitry Gutov
2015-07-26 18:57                 ` Stephen Leake
2015-07-26 23:56                   ` John Yates
2015-07-27  1:49                     ` Dmitry Gutov
2015-07-27 11:12                     ` Stephen Leake
2015-07-27 11:27                       ` Dmitry Gutov
2015-07-27 13:00                   ` Dmitry Gutov
2015-07-27 13:02                     ` Dmitry Gutov
2015-07-28  1:21                     ` Stephen Leake
2015-07-28 11:05                       ` Stephen Leake
2015-07-28 14:33                         ` Dmitry Gutov
2015-07-28 15:45                           ` Stephen Leake
2015-07-28 16:25                             ` Dmitry Gutov
2015-07-29  1:36                               ` Stephen Leake
2015-07-29  2:10                                 ` Dmitry Gutov
2015-07-28 14:18                       ` Dmitry Gutov
2015-07-28 16:15                         ` Stephen Leake
2015-07-28 18:44                           ` Dmitry Gutov
2015-07-29  2:27                             ` Stephen Leake
2015-07-29 22:51                               ` Dmitry Gutov
2015-07-30  8:17                                 ` Stephen Leake
2015-07-31  0:15                                   ` Dmitry Gutov
2015-07-31 16:13                                     ` Stephen Leake
2015-08-01  0:57                                       ` Dmitry Gutov
2015-08-01  9:50                                         ` Stephen Leake
2015-08-01 10:51                                           ` Stephen Leake
2015-08-01 12:42                                             ` Dmitry Gutov
2015-08-01 12:40                                           ` Dmitry Gutov
2015-08-01 14:15                                             ` Stephen Leake
2015-08-01 15:09                                               ` Dmitry Gutov
2015-08-01 19:04                                                 ` Stephen Leake
2015-08-01 22:33                                                   ` Dmitry Gutov
2015-08-01  1:14                                       ` Per-language project-search-path, was: " Dmitry Gutov
2015-08-01 10:43                                         ` Stephen Leake
2015-08-01 14:12                                           ` Dmitry Gutov
2015-08-01 18:57                                             ` Stephen Leake
2015-08-02  0:25                                               ` Dmitry Gutov
2015-08-02  2:29                                             ` Eric Ludlam
2015-08-02  8:57                                               ` Nix
2015-08-02 17:14                                                 ` Michael Heerdegen
2015-08-02 23:09                                                   ` Eric Ludlam
2015-08-02 23:39                                                     ` Michael Heerdegen [this message]
2015-08-03 11:33                                                       ` Eric Ludlam
2015-08-02 23:07                                                 ` Dmitry Gutov
2015-08-03 10:24                                                   ` Nix
2015-08-03 10:35                                                     ` Dmitry Gutov
2015-08-07 15:25                                                       ` Nix
2015-08-03  1:21                                               ` Dmitry Gutov
2015-07-29 23:11                               ` xref display and multiple locations, " Dmitry Gutov
2015-06-06 10:20 ` Bozhidar Batsov
2015-06-06 10:29   ` Dmitry Gutov
2015-06-06 12:32 ` Eric Ludlam
2015-06-06 18:44   ` Dmitry Gutov
2015-06-06 19:28     ` Eli Zaretskii
2015-06-07 22:29       ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvy9uuoa.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=ericludlam@gmail.com \
    --cc=nix@esperi.org.uk \
    --cc=stephen_leake@stephe-leake.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).