[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Software hunt...



Yuval El-Hanany <eyuval@netvision.net.il> writes:

<SNIP>
> What's tinytag? I don't have that function in my xemacs and I've never came
> accross it so far.

tinytag is a package by Jari Aalto <jari.aalto@poboxes.com>.
It shows you the syntax of the function your courser is on, right in
the echo area.  Its very convenient.  The only problem is that it is
written by Jari Aalto, and he dose not follow the emacs guidelines to
package programing very strictly.  if you install too meny of his
packges, things start to breake.  I use to have a whole set of the
stuff in my emacs, but I had to kick most of it out.  I think that the
only thing that I left was tinytag.

you can get it form :

	ftp://cs.uta.fi/pub/ssjaaa/elisp.html 
this is from the list code:

;; @(#) tinytag.el -- grep database: example show C++ synatx call while coding
<snip>

;;  Preface, overview of features
;;
;;	o   simple database searching, some analogue to emacs tags.
;;	o   you can flip databases very easily to show the right data.
;;	o   example: showing c++ funcall syntax in echo area while you program!
;;	o   installs hp-ux or netbsd c function databases automatically.
;;
;;  Story behind this package
;;
;;	the word "tag" refers to famous tags package in emacs that allows
;;	you to browse your c/c++ code easily.
;;
;;	now, i was in the middle of my c++ project at work and i noticed
;;	that i constantly looked up the man pages to find correct syntax
;;	for calling stdio.h c-functions. i never remembered them right
;;	from out of my mind. i calculated, that i spent over 40% of the time
;;	with the man pages, figuring out what #include statements
;;	each function might have required, and what type of parameters
;;	they needed.
;;
;;	i've had it. no more. there must be a way out of this...
;;
;;	if you have programmed in lisp, you propably know package called
;;	eldoc.el (get it fast if you haven't) by noah friedman
;;	<friedman@prep.ai.mit.edu>. it shows you the lisp function
;;	call arguments when your cursor is right over some function.
;;
;;	what a sexy tool! you never have to go to elisp info pages just
;;	to check what the function takes, and you don't have to pop
;;	up extra buffer with c-h f <func>.
;;
;;	it's a real time saver in lisp.
;;
;;	okay, now you guessed what i'm after... i started immediately
;;	thinking how could i get similar interface to c++. since eldoc
;;	looks the lisp args from memory (emacs obarray, symbol storage),
;;	i could do the same, but with external reference files: databases.
;;
;;	i needed to generate all function syntaxes out
;;	of the man pages. that was pretty easy with some piece of perl
;;	code. the final output after ripping all the 3c man pages was
;;	like this, which i put to database 'funcs'
;;
;;	    <dirent.h> dir *opendir(const char *dirname);
;;	    <dirent.h> int closedir(dir *dirp);
;;	    <dirent.h> int readdir_r(dir *dirp, struct dirent *result);
;;	    <dirent.h> long int telldir(dir *dirp);
;;	    <dirent.h> struct dirent *readdir(dir *dirp);
;;	    ...
;;	    <string.h><strings.h> char *index(const char *s, int c);
;;	    <string.h><strings.h> char *rindex(const char *s, int c);
;;
;;	notice that my perl stuck the '#define' statements to the beginning
;;	of each function.
;;
;;	now when i had the 'function' database, only thing i needed more
;;	was the lisp code to handle the database lookup for me and display
;;	the c++ call syntax for current function name under point. now i
;;	have "eldoc" running in my c/c++ buffer too with the help of this
;;	tinytag package.
;;
;;	hope you find some other uses for this package too. i assume you
;;	can use similar approach for any programming language.  just set up
;;	the database, entries to search/display, per line.  that's it.
;;

matan