From:	CRDGW2::CRDGW2::MRGATE::"SMTP::PREP.AI.MIT.EDU::INFO-GNU-EMACS-REQUEST" 28-JUL-1989 20:43
To:	MRGATE::"ARISIA::EVERHART"
Subj:	etags.c recognizes packages

Received: by life.ai.mit.edu (4.1/AI-4.10) id AA03652; Fri, 28 Jul 89 17:38:51 EDT
Return-Path: <info-gnu-emacs-request@prep.ai.mit.edu>
Received: from tut.cis.ohio-state.edu by life.ai.mit.edu (4.1/AI-4.10) id AA03530; Fri, 28 Jul 89 17:31:55 EDT
Received: by tut.cis.ohio-state.edu (5.61/4.890725)
	id AA28612; Fri, 28 Jul 89 17:03:19 -0400
Received: from USENET by tut.cis.ohio-state.edu with netnews
	for info-gnu-emacs@prep.ai.mit.edu (info-gnu-emacs@prep.ai.mit.edu)
	(contact usenet@tut.cis.ohio-state.edu if you have questions)
Date: 28 Jul 89 20:51:29 GMT
From: moore@cdr.utah.edu  (Tim Moore)
Organization: University of Utah CS Dept
Subject: etags.c recognizes packages
Message-Id: <2263@wasatch.utah.edu>
Sender: info-gnu-emacs-request@prep.ai.mit.edu
To: info-gnu-emacs@prep.ai.mit.edu

Here are some changes to etags.c so that it will recognize package
qualified defining forms i.e., lisp::defmacro, in Lisp files. I've
found this useful in our Utah Common Lisp project. Almost all special
forms and macros in UCL are defined using ucl::defmacro instead of defmacro
to avoid screwing up the cross compiler's definition of the macro or
to avoid using the cross compiler's defmacro.

The "-p" flag enables this new behavior. Diffs follow.

Tim Moore                     moore@cs.utah.edu {ut-sally,hplabs}!utah-cs!moore
"Ah, youth. Ah, statute of limitations."
		-John Waters

*** /n/jaguar/usr/src/gnu/emacs/dist/etc/etags.c	Thu Jun 23 06:45:37 1988
--- etags.c	Fri Jul 28 14:49:35 1989
***************
*** 188,193 ****
--- 188,195 ----
  int	vflag = 0;		/* -v: create vgrind style index output */
  int	xflag = 0;		/* -x: create cxref style output */
  int	eflag = 0;		/* -e: emacs style output */
+ int	pflag = 0;		/* -p: look for package qualified defs */
+ 				/* in lisp files */
  
  /* Name this program was invoked with.  */
  char *progname;
***************
*** 308,313 ****
--- 310,318 ----
  		}
  	      outfile = av[1];
  	      goto end_loop;
+ 	    case 'p':
+ 	      pflag++;
+ 	      break;
  	    case 't':
  	      tflag++;
  	      break;
***************
*** 1209,1215 ****
  
  /*
   * lisp tag functions
!  * just look for (def or (DEF
   */
  
  L_funcs (fi)
--- 1214,1220 ----
  
  /*
   * lisp tag functions
!  * look for (def or (DEF or (foo:def or (foo::def or ...
   */
  
  L_funcs (fi)
***************
*** 1225,1240 ****
        linecharno = charno;
        charno += readline (&lb, fi) + 1;
        dbp = lb.buffer;
!       if (dbp[0] == '(' && 
! 	  (dbp[1] == 'D' || dbp[1] == 'd') &&
! 	    (dbp[2] == 'E' || dbp[2] == 'e') &&
! 	      (dbp[3] == 'F' || dbp[3] == 'f'))
  	{
! 	  while (!isspace(*dbp)) dbp++;
! 	  while (isspace(*dbp)) dbp++;
! 	  L_getit();
  	}
      }
  }
  
  L_getit()
--- 1230,1267 ----
        linecharno = charno;
        charno += readline (&lb, fi) + 1;
        dbp = lb.buffer;
!       if (dbp[0] == '(')
  	{
! 	  if (L_isdef())
! 	    {
! 	      while (!isspace(*dbp)) dbp++;
! 	      while (isspace(*dbp)) dbp++;
! 	      L_getit();
! 	    }
! 	  else if (pflag)
! 	    {
! 	      while (*dbp != ':' && !isspace(*dbp)) dbp++;
! 	      if (*dbp == ':')
! 		{
! 		  if (dbp[1] == ':') dbp++; /* deal with "::" */
! 		  if (L_isdef())
! 		    {
! 		      while (!isspace(*dbp)) dbp++;
! 		      while (isspace(*dbp)) dbp++;
! 		      L_getit();
! 		    }    
! 		}
! 	    }
  	}
+       
      }
+ }
+ 
+ L_isdef()
+ {
+   return ((dbp[1] == 'D' || dbp[1] == 'd') &&
+ 	  (dbp[2] == 'E' || dbp[2] == 'e') && 
+ 	  (dbp[3] == 'F' || dbp[3] == 'f'));
  }
  
  L_getit()
Tim Moore                     moore@cs.utah.edu {ut-sally,hplabs}!utah-cs!moore
"Ah, youth. Ah, statute of limitations."
		-John Waters
