[m-dev.] diff: fix problems with the mdb help

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 19 00:33:06 AEDT 1999


Estimated hours taken: 1

Fix some problems with the mdb help.

util/info_to_mdb.c:
	Update to reflect the fact that concept headings are now
	formatted with @emph rather than @var.
	My previous change to fix the formatting of the headings
	in the manual unfortunately broke the mdb help.

doc/mdb_categories:
	List the names of the documented debugger concepts,
	so that the user knows what documentation is available.
	Mention the `delete' command in the list of breakpoint commands.
	Add "For help on the `help' command, type `help help help'"
	to the help for the "help" category.

Workspace: /d-drive/home/hg/fjh/mercury
Index: doc/mdb_categories
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/mdb_categories,v
retrieving revision 1.4
diff -u -d -b -r1.4 mdb_categories
--- doc/mdb_categories	1999/03/05 12:52:23	1.4
+++ doc/mdb_categories	1999/11/18 13:26:17
@@ -1,11 +1,16 @@
 document_category 100 concepts
 concepts   - The concepts on which the Mercury debugger is based.
+             The concepts for which documentation is available are
+             `break_points', `strict_commands', `print_level',
+             `default_print_level', `current_environment',
+             and `procedure_specification'.
 
 end
 document_category 150 queries
 queries    - Commands for invoking goals interactively.
              The commands for queries are
 	     `query', `cc_query', and `io_query'.
+
 end
 document_category 200 forward
 forward    - Commands that move execution forward.
@@ -27,7 +32,7 @@
 document_category 500 breakpoint
 breakpoint - Commands that let users set and control breakpoints.
              The breakpoint commands are `break', `disable', `enable',
-             `modules', `procedures' and `register'.
+             `delete', `modules', `procedures' and `register'.
 
 end
 document_category 600 parameter
@@ -39,6 +44,7 @@
 document_category 700 help
 help       - Commands that let users access and control the help system.
              The help commands are `document_category', `document' and `help'.
+             For help on the `help' command, type `help help help'.
 
 end
 document_category 800 exp
Index: util/info_to_mdb.c
===================================================================
RCS file: /home/mercury1/repository/mercury/util/info_to_mdb.c,v
retrieving revision 1.4
diff -u -d -b -r1.4 info_to_mdb.c
--- util/info_to_mdb.c	1999/04/16 07:06:39	1.4
+++ util/info_to_mdb.c	1999/11/18 12:59:12
@@ -31,8 +31,7 @@
 static	char	*get_next_line(FILE *infp);
 static	void	put_line_back(char *line);
 
-#define	concept_char(c)		(MR_isupper(c) ? tolower((unsigned char)c) : \
-					(MR_isspace(c) ? '_' : (c)))
+#define	concept_char(c)		(MR_isspace(c) ? '_' : (c))
 
 int
 main(int argc, char **argv)
@@ -89,8 +88,8 @@
 		printf("document %s %d ", category, slot);
 		if (is_concept) {
 			int	i;
-			for (i = 0; line[i] != '\n'; i++) {
-				command[i] = concept_char(line[i]);
+			for (i = 0; line[i + 2] != '\n'; i++) {
+				command[i] = concept_char(line[i + 1]);
 			}
 			command[i] = '\0';
 		} else {
@@ -181,7 +180,7 @@
 	if ((line[0] == '`') && (line[len-2] == '\'')) {
 		*is_concept = FALSE;
 		return TRUE;
-	} else if (MR_isupper(line[0]) && MR_isupper(line[1])) {
+	} else if ((line[0] == '_') && (line[len-2] == '_')) {
 		*is_concept = TRUE;
 		return TRUE;
 	} else {
@@ -206,18 +205,11 @@
 	int	len;
 	int	i;
 
-	if (is_concept) {
-		for (i = 0; line[i] != '\n'; i++) {
-			putchar(concept_char(line[i]));
-		}
-		putchar('\n');
-	} else {
 		len = strlen(line);
 		for (i = 1; i < len - 2; i++) {
-			putchar(line[i]);
+		putchar(is_concept ? concept_char(line[i]) : line[i]);
 		}
 		putchar('\n');
-	}
 }
 
 static	char	*putback_line = NULL;

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list