Function: idlwave-make-tags
idlwave-make-tags is an interactive and byte-compiled function defined
in idlwave.el.gz.
Signature
(idlwave-make-tags)
Documentation
Create the IDL tags file IDLTAGS in the current directory from the list of directories specified in the minibuffer. Directories may be for example: . /usr/local/rsi/idl/lib. All the subdirectories of the specified top directories are searched if the directory name is prefixed by @. Specify @ directories with care, it may take a long, long time if you specify /.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/idlwave.el.gz
(defun idlwave-make-tags ()
"Create the IDL tags file IDLTAGS in the current directory from
the list of directories specified in the minibuffer. Directories may be
for example: . /usr/local/rsi/idl/lib. All the subdirectories of the
specified top directories are searched if the directory name is prefixed
by @. Specify @ directories with care, it may take a long, long time if
you specify /."
(interactive)
(let (directory directories cmd append status numdirs dir getsubdirs
buffer save_buffer files numfiles item errbuf)
;;
;; Read list of directories
(setq directory (read-string "Tag Directories: " "."))
(setq directories (idlwave-split-string directory "[ \t]+"))
;;
;; Set etags command, vars
(setq cmd "etags --output=IDLTAGS --language=none --regex='/[
\\t]*[pP][Rr][Oo][ \\t]+\\([^ \\t,]+\\)/' --regex='/[
\\t]*[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn][ \\t]+\\([^ \\t,]+\\)/' ")
(setq append " ")
(setq status 0)
;;
;; For each directory
(setq numdirs 0)
(setq dir (nth numdirs directories))
(while (and dir)
;;
;; Find the subdirectories
(if (string-match "^[@]\\(.+\\)$" dir)
(setq getsubdirs t) (setq getsubdirs nil))
(if (and getsubdirs) (setq dir (substring dir 1 (length dir))))
(setq dir (expand-file-name dir))
(if (file-directory-p dir)
(progn
(if (and getsubdirs)
(progn
(setq buffer (get-buffer-create "*idltags*"))
(call-process "sh" nil buffer nil "-c"
(concat "find " dir " -type d -print"))
(setq save_buffer (current-buffer))
(set-buffer buffer)
(setq files (idlwave-split-string
(idlwave-replace-string
(buffer-substring 1 (point-max))
"\n" "/*.pro ")
"[ \t]+"))
(set-buffer save_buffer)
(kill-buffer buffer))
(setq files (list (concat dir "/*.pro"))))
;;
;; For each subdirectory
(setq numfiles 0)
(setq item (nth numfiles files))
(while (and item)
;;
;; Call etags
(if (not (string-match "^[ \t]*$" item))
(progn
(message "%s" (concat "Tagging " item "..."))
(setq errbuf (get-buffer-create "*idltags-error*"))
(setq status (+ status
(if (eq 0 (call-process
"sh" nil errbuf nil "-c"
(concat cmd append item)))
0
1)))
;;
;; Append additional tags
(setq append " --append ")
(setq numfiles (1+ numfiles))
(setq item (nth numfiles files)))
(progn
(setq numfiles (1+ numfiles))
(setq item (nth numfiles files))
)))
(setq numdirs (1+ numdirs))
(setq dir (nth numdirs directories)))
(progn
(setq numdirs (1+ numdirs))
(setq dir (nth numdirs directories)))))
(setq errbuf (get-buffer-create "*idltags-error*"))
(if (= status 0)
(kill-buffer errbuf))
(message "")
))