Fix typos.
[bpt/emacs.git] / lisp / cedet / srecode / texi.el
index 2c8d1a7..acfc248 100644 (file)
@@ -1,6 +1,6 @@
-;;; srecode-texi.el --- Srecode texinfo support.
+;;; srecode/texi.el --- Srecode texinfo support.
 
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2011 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
 
@@ -175,10 +175,17 @@ Adds the following:
 
 (define-mode-local-override semantic-insert-foreign-tag
   texinfo-mode (foreign-tag)
-  "Insert TAG from a foreign buffer in TAGFILE.
+  "Insert FOREIGN-TAG from a foreign buffer in TAGFILE.
 Assume TAGFILE is a source buffer, and create a documentation
 thingy from it using the `document' tool."
-  (let ((srecode-semantic-selected-tag foreign-tag))
+  (srecode-texi-insert-tag-as-doc foreign-tag))
+
+(defun srecode-texi-insert-tag-as-doc (tag)
+  "Insert TAG into the current buffer with SRecode."
+  (when (not (eq major-mode 'texinfo-mode))
+    (error "Can only insert tags into texinfo in texinfo mode"))
+  (let ((srecode-semantic-selected-tag tag))
+    (srecode-load-tables-for-mode major-mode)
     ;; @todo - choose of the many types of tags to insert,
     ;; or put all that logic into srecode.
     (srecode-insert "declaration:function")))
@@ -224,7 +231,7 @@ This is to take advantage of TeXinfo's markup symbols."
     (if buffer
        (progn (set-buffer buffer)
               (srecode-texi-texify-docstring string))
-      ;; Else, no buffer, so lets do something else
+      ;; Else, no buffer, so let's do something else
       (with-mode-local texinfo-mode
        (srecode-texi-texify-docstring string)))))
 
@@ -278,5 +285,4 @@ that class.
 ;; generated-autoload-load-name: "srecode/texi"
 ;; End:
 
-;; arch-tag: 6f0e7f45-2281-49e4-b73c-680cba477094
 ;;; srecode/texi.el ends here