;;; cedet-idutils.el --- ID Utils support for CEDET.
-;;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
;; Version: 0.2
;; Keywords: OO, lisp
+;; Package: cedet
;; This file is part of GNU Emacs.
:group 'cedet)
(defun cedet-idutils-search (searchtext texttype type scope)
- "Perform a search with IDUtils, return the created buffer.
+ "Perform a search with ID Utils, return the created buffer.
SEARCHTEXT is text to find.
TEXTTYPE is the type of text, such as 'regexp, 'string, 'tagname,
'tagregexp, or 'tagcompletions.
(let ((b (get-buffer-create "*CEDET fnid*"))
(cd default-directory)
)
- (save-excursion
- (set-buffer b)
+ (with-current-buffer b
(setq default-directory cd)
(erase-buffer))
(apply 'call-process cedet-idutils-file-command
(let ((b (get-buffer-create "*CEDET lid*"))
(cd default-directory)
)
- (save-excursion
- (set-buffer b)
+ (with-current-buffer b
(setq default-directory cd)
(erase-buffer))
(apply 'call-process cedet-idutils-token-command
;;; UTIL CALLS
;;
(defun cedet-idutils-expand-filename (filename)
- "Expand the FILENAME with IDUtils.
+ "Expand the FILENAME with ID Utils.
Return a filename relative to the default directory."
(interactive "sFile: ")
- (let ((ans (save-excursion
- (set-buffer (cedet-idutils-fnid-call (list filename)))
+ (let ((ans (with-current-buffer (cedet-idutils-fnid-call (list filename))
(goto-char (point-min))
(if (looking-at "[^ \n]*fnid: ")
(error "ID Utils not available")
(split-string (buffer-string) "\n" t)))))
(setq ans (mapcar 'expand-file-name ans))
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(if ans
(if (= (length ans) 1)
(message "%s" (car ans))
ans))
(defun cedet-idutils-support-for-directory (&optional dir)
- "Return non-nil if IDUtils has a support file for DIR.
+ "Return non-nil if ID Utils has a support file for DIR.
If DIR is not supplied, use the current default directory.
This works by running lid on a bogus symbol, and looking for
the error code."
(rev nil))
(if (not b)
(progn
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(message "ID Utils not found."))
nil)
- (save-excursion
- (set-buffer b)
+ (with-current-buffer b
(goto-char (point-min))
(re-search-forward "fnid - \\([0-9.]+\\)" nil t)
(setq rev (match-string 1))
(if (inversion-check-version rev nil cedet-idutils-min-version)
(if noerror
nil
- (error "Version of ID Utis is %s. Need at least %s"
+ (error "Version of ID Utils is %s. Need at least %s"
rev cedet-idutils-min-version))
;; Else, return TRUE, as in good enough.
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(message "ID Utils %s - Good enough for CEDET." rev))
t)))))
(provide 'cedet-idutils)
+;; arch-tag: 663ca082-5b3d-4384-8710-cc74f990b501
;;; cedet-idutils.el ends here