;;; semanto-example.el --- Examples using the semantic API
-;;; Copyright (C) 2002 Eric M. Ludlam
+;;; Copyright (C) 2002 Eric M. Ludlam
;; Author: Eric M. Ludlam <email@example.com>
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;; Simplified example programs that use the semantic API.
"Jump to the token with NAME.
;; ( "this" "that" "th" )
(car (reverse (semantic-ctxt-current-symbol)))
;; The stream is from this buffer
;; We don't need a filter.
- (setq tok (semantic-find-
+ (setq tok (semantic-find--by-name
;; Get the stream. May be a buffer too.
;; Look inside structures
;; Don't search include files. Perhaps a later
;; Get the position of the token.
- (setq pos (semantic-t
+ (setq pos (semantic-t-start tok))
;; Because we only searched this buffer, we can assume the token is
(error "No tag %s found" name)
-(defcustom se-summary-function 'semantic-uml-prototype-
+(defcustom se-summary-function 'semantic-uml-prototype
"*Function to use when showing info about a token for Examples.
* Create a customization variable."
- :type semantic-
+ :type semantic--custom-list)
"Show important information about some token with NAME.
- * Create a variable with `semantic-
+ * Create a variable with `semantic--functions'.
* Create the colorized text."
(interactive (list (semantic-read-symbol "Symbol: ")))
- (let ((tok (semantic-find-
nonterminal-by-name name (current-buffer) t))
+ (let ((tok (semantic-find--by-name name (current-buffer) t))
;; Token text functions can take a PARENT argument. To find this
;; really quickly, jump to TOK, then use the overlay mechanism to
- (goto-char (semantic-token-start tok))
- (setq parent (semantic-current-nonterminal-parent))
+ (goto-char (semantic-tag-start tok))
+ (setq parent (semantic-current-tag-parent))
(setq msg (funcall se-summary-function tok parent t))
(list (read-string "Symbol: "
;; Current symbol is the default
(car (reverse (semantic-ctxt-current-symbol))))))
- (let ((tok (semanticdb-
+ (let ((tok (semanticdb--by-name-regexp
;; The current list of active databases for this file.
;; This is the same as passing `nil'
- t ;; Search inside types
- nil ;; Do not search include files
- nil ;; Only files of the same mode
t ;; When a token is found, make sure it is