$NetBSD: patch-ac,v 1.3 2005/12/01 18:46:53 wiz Exp $

--- common/main.c.orig	1996-10-12 00:28:28.000000000 +0200
+++ common/main.c
@@ -64,6 +64,9 @@ editor(gp, argc, argv)
 	size_t len;
 	u_int flags;
 	int ch, flagchk, lflag, secure, startup, readonly, rval, silent;
+#ifdef GTAGS
+	int gtags = 0;
+#endif
 	char *tag_f, *wsizearg, path[256];
 
 	/* Initialize the busy routine, if not defined by the screen. */
@@ -113,11 +116,19 @@ editor(gp, argc, argv)
 	/* Set the file snapshot flag. */
 	F_SET(gp, G_SNAPSHOT);
 
+#ifdef GTAGS
+#ifdef DEBUG
+	while ((ch = getopt(argc, argv, "c:D:eFGlRrSsT:t:vw:")) != EOF)
+#else
+	while ((ch = getopt(argc, argv, "c:eFGlRrSst:vw:")) != EOF)
+#endif
+#else
 #ifdef DEBUG
 	while ((ch = getopt(argc, argv, "c:D:eFlRrSsT:t:vw:")) != EOF)
 #else
 	while ((ch = getopt(argc, argv, "c:eFlRrSst:vw:")) != EOF)
 #endif
+#endif
 		switch (ch) {
 		case 'c':		/* Run the command. */
 			/*
@@ -154,6 +165,11 @@ editor(gp, argc, argv)
 		case 'F':		/* No snapshot. */
 			F_CLR(gp, G_SNAPSHOT);
 			break;
+#ifdef GTAGS
+		case 'G':		/* gtags mode. */
+			gtags = 1;
+			break;
+#endif
 		case 'l':		/* Set lisp, showmatch options. */
 			lflag = 1;
 			break;
@@ -252,6 +268,10 @@ editor(gp, argc, argv)
 	}
 	if (readonly)
 		*oargp++ = O_READONLY;
+#ifdef GTAGS
+	if (gtags)
+		*oargp++ = O_GTAGSMODE;
+#endif
 	if (secure)
 		*oargp++ = O_SECURE;
 	*oargp = -1;			/* Options initialization. */
