]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/senator.el
Update copyright year to 2015
[gnu-emacs] / lisp / cedet / semantic / senator.el
index fd2989adbeba595cff8d2c759b884a04453a0db6..c58def60585e9080ba447b5ad29bd5605af94a46 100644 (file)
@@ -1,10 +1,9 @@
 ;;; semantic/senator.el --- SEmantic NAvigaTOR
 
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;;   2009, 2010, 2011  Free Software Foundation, Inc.
+;; Copyright (C) 2000-2015 Free Software Foundation, Inc.
 
 ;; Author: David Ponce <david@dponce.com>
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
 ;; Created: 10 Nov 2000
 ;; Keywords: syntax
 
@@ -180,8 +179,8 @@ source."
     (goto-char (semantic-tag-start tag))
     (when (re-search-forward (concat
                               ;; The tag name is expected to be
-                              ;; between word delimiters, whitespaces,
-                              ;; or punctuations.
+                              ;; between word delimiters, whitespace,
+                              ;; or punctuation.
                               "\\(\\<\\|\\s-+\\|\\s.\\)"
                               (regexp-quote name)
                               "\\(\\>\\|\\s-+\\|\\s.\\)")
@@ -256,6 +255,7 @@ TEXT, BOUND, NOERROR, and COUNT arguments are interpreted."
   "Navigate to the next Semantic tag.
 Return the tag or nil if at end of buffer."
   (interactive)
+  (semantic-error-if-unparsed)
   (let ((pos (point))
         (tag (semantic-current-tag))
         where)
@@ -295,6 +295,7 @@ Return the tag or nil if at end of buffer."
   "Navigate to the previous Semantic tag.
 Return the tag or nil if at beginning of buffer."
   (interactive)
+  (semantic-error-if-unparsed)
   (let ((pos (point))
         (tag (semantic-current-tag))
         where)
@@ -520,6 +521,7 @@ If that parent which is only a reference in the function tag
 is found, we can jump to it.
 Some tags such as includes have other reference features."
   (interactive)
+  (semantic-error-if-unparsed)
   (let ((result (semantic-up-reference (or tag (semantic-current-tag)))))
     (if (not result)
         (error "No up reference found")
@@ -720,12 +722,24 @@ yanked to."
 (defun senator-copy-tag-to-register (register &optional kill-flag)
   "Copy the current tag into REGISTER.
 Optional argument KILL-FLAG will delete the text of the tag to the
-kill ring."
-  (interactive "cTag to register: \nP")
+kill ring.
+
+Interactively, reads the register using `register-read-with-preview',
+if available."
+  (interactive (list (if (fboundp 'register-read-with-preview)
+                        (register-read-with-preview "Tag to register: ")
+                      (read-char "Tag to register: "))
+                    current-prefix-arg))
   (semantic-fetch-tags)
   (let ((ft (semantic-obtain-foreign-tag)))
     (when ft
-      (set-register register ft)
+      (set-register
+       register (registerv-make
+                 ft
+                 :insert-func #'semantic-insert-foreign-tag
+                 :jump-func (lambda (v)
+                              (switch-to-buffer (semantic-tag-buffer v))
+                              (goto-char (semantic-tag-start v)))))
       (if kill-flag
           (kill-region (semantic-tag-start ft)
                        (semantic-tag-end ft))))))
@@ -861,5 +875,4 @@ Use a senator search function when semantic isearch mode is enabled."
 ;; generated-autoload-load-name: "semantic/senator"
 ;; End:
 
-;; arch-tag: 397100d0-e2db-467e-8c19-d8d4d99d51f1
 ;;; semantic/senator.el ends here