;;; semantic/senator.el --- SEmantic NAvigaTOR
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009, 2010 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
(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.\\)")
"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)
"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)
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")
(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))))))
;; generated-autoload-load-name: "semantic/senator"
;; End:
-;; arch-tag: 397100d0-e2db-467e-8c19-d8d4d99d51f1
;;; semantic/senator.el ends here