diff options
author | Christophe Raffalli <christophe.raffalli@univ-savoie.fr> | 2000-09-15 13:05:15 +0000 |
---|---|---|
committer | Christophe Raffalli <christophe.raffalli@univ-savoie.fr> | 2000-09-15 13:05:15 +0000 |
commit | 6bebc1e36b744a46da03ad1292dfd7cab8540f9c (patch) | |
tree | 99f866b1f07a3bdc4ad78c70cc74ea1cbde601bf /af2 | |
parent | f2809edb93a7dcf06df6b5eb7dfb2452eaeb2136 (diff) |
tags functions for af2
Diffstat (limited to 'af2')
-rw-r--r-- | af2/af2-tags.el | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/af2/af2-tags.el b/af2/af2-tags.el new file mode 100644 index 00000000..1c60b631 --- /dev/null +++ b/af2/af2-tags.el @@ -0,0 +1,77 @@ +;;--------------------------------------------------------------------------;; +;;--------------------------------------------------------------------------;; +;; gestion des TAGS +;;--------------------------------------------------------------------------;; + +; sous xemacs, visit-tags-table n'a pas d'argument optionnel. Sous gnu emacs : + +; Normally M-x visit-tags-table sets the global value of `tags-file-name'. +; With a prefix arg, set the buffer-local value instead. + +; mieux vaut sous gnu emacs gérer la variable tags-table-list, qui +; n'existe pas sous xemacs. +; Sous xemacs il faut gérer la variable tag-table-alist qui n'existe pas +; sous gnu emacs. + +(require 'etags) + +(defun af2-tags-add-table(table) + "add tags table" + (interactive "D directory, location of a file named TAGS to add : ") + (if proof-running-on-XEmacs + (let ((association (cons buffer-file-name table))) + (if (member association tag-table-alist) + (message (concat table " already loaded.")) + (setq tag-table-alist (cons association tag-table-alist)))) + ; gnu emacs + (if (member table tags-table-list) + (message (concat table " already loaded.")) +; (make-local-variable 'tags-table-list) ; ne focntionne pas + (setq tags-table-list (cons table tags-table-list)) + ) + ) + ) + +(defun af2-tags-reset-table() + "Set tags-table-list to nil." + (interactive) +; (make-local-variable 'tags-table-list) + (if proof-running-on-XEmacs + (progn + (setq tag-table-alist (remassoc buffer-file-name tag-table-alist))) + (setq tags-table-list nil)) + ) + +(defun af2-tags-add-doc-table() + "Add tags in text documentation." + (interactive) + (af2-tags-add-table (concat af2-doc-dir "/text/TAGS")) + ) + +(defun af2-tags-add-lib-table() + "Add tags in libraries." + (interactive) + (af2-tags-add-table (concat af2-lib-dir "TAGS")) + ) + +(defun af2-tags-add-local-table() + "Add the tags table created with function af2-create-local-table." + (interactive) + (af2-tags-add-table (concat buffer-file-name "TAGS")) + ) + +(defun af2-tags-create-local-table() + "create table on local buffer" + (interactive) + (shell-command (concat af2-etags + " -o " + (file-name-nondirectory (buffer-file-name)) + "TAGS " + (file-name-nondirectory (buffer-file-name)))) + ) + +;; default + +(if af2-tags-doc (add-hook 'af2-mode-hook 'af2-tags-add-doc-table)) + +(provide 'af2-tags)
\ No newline at end of file |