Hi Eric,
Here is a patch for semantic-el.el and semanticdb-el.el that fixes
various "wrong-type-argument" errors in `senator-jump-interactive'
and `senator-complete-symbol', in `emacs-lisp-mode'.
In semantic-el.el I fixed override of `semantic-ctxt-current-symbol'
and `semantic-ctxt-current-function' to ensure they return their
result in a list as specified in semantic-ctxt.
In semanticdb-el.el I fixed `insert' errors in senator completion,
when the semantic database is enabled. The problem was in method
`semanticdb-find-nonterminal-by-name-regexp-method' that returned nil
values in the token list, because `semanticdb-elisp-sym->nonterm'
failed to convert some symbols returned by `apropos-internal' into
semantic tokens. The fix ensure that only valid tokens are returned.
I also simplified the code ;-)
What do you think=3F
David
2003-02-12 David Ponce <david@...>
* semanticdb-el.el
(semanticdb-find-nonterminal-by-name-regexp-method): Ensure it
returns valid data. Code simplified.
* bovine/semantic-el.el
(semantic-ctxt-current-symbol emacs-lisp-mode)
(semantic-ctxt-current-function emacs-lisp-mode): Return result
in a list.
=09
Index: semanticdb-el.el
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/cedet/cedet/semantic/semanticdb-el.el,v
retrieving revision 1.2
diff -c -r1.2 semanticdb-el.el
*** semanticdb-el.el=096 Dec 2002 01:33:38 -0000=091.2
--- semanticdb-el.el=0912 Feb 2003 15:53:23 -0000
***************
*** 194,221 ****
(defmethod semanticdb-find-nonterminal-by-name-regexp-method
((database semanticdb-project-database-emacs-lisp)
regex search-parts search-includes diff-mode find-file-match)
! "Find all occurances of nonterminals with name matching REGEX in DATA=
BASE.
! Uses `apropos-internal' to find matches.a
See `semanticdb-find-nonterminal-by-function' for details on DATABASES,=
SEARCH-PARTS, SEARCH-INCLUDES DIFF-MODE, and FIND-FILE-MATCH.
Return a list ((DB-TABLE . TOKEN-LIST) ...)."
! (let ((syms (apropos-internal regex))
! =09(toklst nil)
! =09(newtable nil)
! =09)
! (when syms
! (while syms
! =09(setq toklst (cons (semanticdb-elisp-sym->nonterm (car syms))
! =09=09=09 toklst)
! =09 syms (cdr syms)))
! ;; Set up the table.
! (setq newtable (semanticdb-table-emacs-lisp "name regexp search")=
)
! (oset newtable parent-db database)
! (oset newtable tokens toklst)
! ;; Return the new table.
! (list (cons newtable toklst))
! )
! ))
(defmethod semanticdb-find-nonterminal-by-type-method
((database semanticdb-project-database-emacs-lisp)
--- 194,213 ----
(defmethod semanticdb-find-nonterminal-by-name-regexp-method
((database semanticdb-project-database-emacs-lisp)
regex search-parts search-includes diff-mode find-file-match)
! "Find all occurrences of nonterminals with name matching REGEX in DAT=
ABASE.
! Uses `apropos-internal' to find matches.
See `semanticdb-find-nonterminal-by-function' for details on DATABASES,=
SEARCH-PARTS, SEARCH-INCLUDES DIFF-MODE, and FIND-FILE-MATCH.
Return a list ((DB-TABLE . TOKEN-LIST) ...)."
! (let ((toklst (delq nil (mapcar 'semanticdb-elisp-sym->nonterm
! =09=09=09=09 (apropos-internal regex)))))
! (if toklst
! =09;; Set up the table.
! =09(let ((newtable (semanticdb-table-emacs-lisp "name regexp search")))=
! =09 (oset newtable parent-db database)
! =09 (oset newtable tokens toklst)
! =09 ;; Return the new table.
! =09 (list (cons newtable toklst))))))
(defmethod semanticdb-find-nonterminal-by-type-method
((database semanticdb-project-database-emacs-lisp)
Index: bovine/semantic-el.el
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/cedet/cedet/semantic/bovine/semantic-el.el,v
retrieving revision 1.6
diff -c -r1.6 semantic-el.el
*** bovine/semantic-el.el=0929 Jan 2003 03:43:44 -0000=091.6
--- bovine/semantic-el.el=0912 Feb 2003 15:53:23 -0000
***************
*** 387,393 ****
(save-excursion
(if point (goto-char point))
(require 'thingatpt)
! (thing-at-point 'symbol)))
(define-mode-overload-implementation semantic-ctxt-current-assignment e=
macs-lisp-mode
(&optional point)
--- 387,395 ----
(save-excursion
(if point (goto-char point))
(require 'thingatpt)
! (let ((sym (thing-at-point 'symbol)))
! (if sym (list sym)))
! ))
(define-mode-overload-implementation semantic-ctxt-current-assignment e=
macs-lisp-mode
(&optional point)
***************
*** 401,407 ****
(save-excursion
(if point (goto-char point))
(semantic-beginning-of-command)
! (function-at-point)
))
(define-mode-overload-implementation semantic-ctxt-current-argument ema=
cs-lisp-mode
--- 403,410 ----
(save-excursion
(if point (goto-char point))
(semantic-beginning-of-command)
! (let ((fun (function-at-point)))
! (if fun (list fun)))
))
(define-mode-overload-implementation semantic-ctxt-current-argument ema=
cs-lisp-mode
|