]> granicus.if.org Git - mutt/commitdiff
patch-1.3.3.bj.docref.1
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 19 Jun 2000 21:13:17 +0000 (21:13 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 19 Jun 2000 21:13:17 +0000 (21:13 +0000)
doc/devel-notes.txt
doc/manual.sgml.head
init.h
makedoc.c

index 511441658d4dde181855d2c07eeb7bb08f4746cf..252a19af03eb14192007d1ac5f4f01d208cc60b8 100644 (file)
@@ -168,9 +168,7 @@ similar to [ntg]roff:
 
  - $word will be converted to a reference to word, where appropriate.
    Note that $$word is possible as well.
-
-   (Not yet implemented in makedoc, but please use it nevertheless
-   when writing documentation!)
+   Use $$$ to get a literal $ without making a reference.
 
  - '. ' in the beginning of a line expands to two space characters.
    This is used to protect indentations in tables.
index 942aaa296ca36382514c8dbe0f30e2bd0e59d6e3..1611deee315c0aa6a5c9bb5f3467c43ce09f1b33 100644 (file)
@@ -1338,7 +1338,7 @@ Usage: <tt/unscore/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
 
 The <tt/score/ commands adds <em/value/ to a message's score if <em/pattern/
 matches it.  <em/pattern/ is a string in the format described in the <ref
-id="pattern" name="patterns"> section.  <em/value/ is a positive or
+id="patterns" name="patterns"> section.  <em/value/ is a positive or
 negative integer.  A message's final score is the sum total of all matching
 <tt/score/ entries.  However, you may optionally prefix <em/value/ with an
 equal sign (=) to cause evaluation to stop at a particular entry if there is
@@ -1436,7 +1436,7 @@ something like <tt/unhook send-hook/.
 <sect1>Regular Expressions<label id="regexp">
 <p>
 All string patterns in Mutt including those in more complex
-<ref id="pattern" name="patterns"> must be specified
+<ref id="patterns" name="patterns"> must be specified
 using regular expressions (regexp) in the ``POSIX extended'' syntax (which
 is more or less the syntax used by egrep and GNU awk).  For your
 convenience, we have included below a brief description of this syntax.
@@ -1590,7 +1590,7 @@ Matches the empty string at the end of a buffer.
 Please note however that these operators are not defined by POSIX, so
 they may or may not be available in stock libraries on various systems.
 
-<sect1>Patterns<label id="pattern">
+<sect1>Patterns<label id="patterns">
 <p>
 Many of Mutt's commands allow you to specify a pattern to match
 (limit, tag-pattern, delete-pattern, etc.).  There are several ways to select
@@ -1741,7 +1741,7 @@ a mailing list to a separate folder, or to delete all messages with a given
 subject.  To tag all messages matching a pattern, use the tag-pattern
 function, which is bound to ``control-T'' by default.  Or you can select
 individual messages by hand using the ``tag-message'' function, which is
-bound to ``t'' by default.  See <ref id="pattern" name="patterns"> for
+bound to ``t'' by default.  See <ref id="patterns" name="patterns"> for
 Mutt's pattern matching syntax.
 
 Once you have tagged the desired messages, you can use the
@@ -1759,7 +1759,7 @@ execute arbitrary commands before performing some operation.  For example,
 you may wish to tailor your configuration based upon which mailbox you are
 reading, or to whom you are sending mail.  In the Mutt world, a <em/hook/
 consists of a <ref id="regexp" name="regular expression"> or
-<ref id="pattern" name="pattern"> along with a
+<ref id="patterns" name="pattern"> along with a
 configuration option/command.  See
 <itemize>
 <item><ref id="folder-hook" name="folder-hook">
@@ -1781,7 +1781,7 @@ sufficient.  But in dealing with messages a finer grain of control is
 needed for matching since for different purposes you want to match
 different criteria.
 
-Mutt allows the use of the <ref id="pattern" name="search pattern">
+Mutt allows the use of the <ref id="patterns" name="search pattern">
 language for matching messages in hook commands.  This works in exactly the
 same way as it would when <em/limiting/ or <em/searching/ the mailbox,
 except that you are restricted to those operators which match information
diff --git a/init.h b/init.h
index 94c9a046a5b30c3a217d92607d8a981b83202710..bfbda7f4052e2480be5f1cdee1c5cde87004df8d 100644 (file)
--- a/init.h
+++ b/init.h
@@ -510,7 +510,7 @@ struct option_t MuttVars[] = {
   ** Controls whether or not the \fIMail-Followup-To\fP header field is
   ** generated when sending mail.  When \fIset\fP, Mutt will generate this
   ** field when you are replying to a known mailing list, specified with
-  ** the ``$subscribe'' or ``$lists'' commands.
+  ** the ``subscribe'' or ``$lists'' commands.
   ** .pp
   ** This field has two purposes.  First, preventing you from receiving
   ** duplicate copies of replies to messages which you send to mailing
@@ -1010,7 +1010,7 @@ struct option_t MuttVars[] = {
   { "message_format",  DT_STR,  R_NONE, UL &MsgFmt, UL "%s" },
   /*
   ** .pp
-  ** This is the string displayed in the ``$attachment'' menu for
+  ** This is the string displayed in the ``attachment'' menu for
   ** attachments of type message/rfc822.  For a full listing of defined
   ** escape sequences see the section on ``$$index_format''.
   */
@@ -1910,7 +1910,7 @@ struct option_t MuttVars[] = {
   ** If your spool mailbox is in a non-default place where Mutt cannot find
   ** it, you can specify its location with this variable.  Mutt will
   ** automatically set this variable to the value of the environment
-  ** variable $MAIL if it is not set.
+  ** variable $$$MAIL if it is not set.
   */
   { "status_chars",    DT_STR,  R_BOTH, UL &StChars, UL "-*%A" },
   /*
@@ -1994,14 +1994,14 @@ struct option_t MuttVars[] = {
   { "status_on_top",   DT_BOOL, R_BOTH, OPTSTATUSONTOP, 0 },
   /*
   ** .pp
-  ** Setting this variable causes the ``$status bar'' to be displayed on
+  ** Setting this variable causes the ``status bar'' to be displayed on
   ** the first line of the screen rather than near the bottom.
   */
   { "strict_threads",  DT_BOOL, R_RESORT|R_INDEX, OPTSTRICTTHREADS, 0 },
   /*
   ** .pp
   ** If set, threading will only make use of the ``In-Reply-To'' and
-  ** ``References'' fields when ``$sorting'' by message threads.  By
+  ** ``References'' fields when you ``$$sort'' by message threads.  By
   ** default, messages with the same subject are grouped together in
   ** ``pseudo threads.''  This may not always be desirable, such as in a
   ** personal mailbox where you might have several unrelated messages with
@@ -2100,7 +2100,7 @@ struct option_t MuttVars[] = {
   ** escape\fP, \fIpipe-message\fP, \fIpipe-entry\fP, \fIprint-message\fP,
   ** and \fIprint-entry\fP commands.
   ** .pp
-  ** It is also used when viewing attachments with ``$autoview'', provided
+  ** It is also used when viewing attachments with ``$auto_view'', provided
   ** that the corresponding mailcap entry has a \fIneedsterminal\fP flag,
   ** and the external program is interactive.
   ** .pp
index 70aede971e354910c3264f89653fdc328637ead3..b5e4444687ef43121a361eb9125ac2eb5652e6f1 100644 (file)
--- a/makedoc.c
+++ b/makedoc.c
@@ -1069,6 +1069,30 @@ static int print_it (int special, char *str, FILE *out, int docstat)
   return docstat;
 }
 
+void print_ref (FILE *out, int output_dollar, const char *ref)
+{
+  switch (OutputFormat)
+  {
+  case F_CONF:
+  case F_MAN:
+    if (output_dollar)
+      putc ('$', out);
+    fputs (ref, out);
+    break;
+
+  case F_SGML:
+    fprintf (out, "<ref id=\"%s\" name=\"", ref);
+    if (output_dollar)
+      fputs ("&dollar;", out);
+    sgml_fputs (ref, out);
+    fputs ("\">", out);
+    break;
+
+  default:
+    break;
+  }
+}
+
 static int commit_buff (char *buff, char **d, FILE *out, int docstat)
 {
   if (*d > buff)
@@ -1146,8 +1170,35 @@ static int handle_docline (char *l, FILE *out, int docstat)
       s += 3;
     }
     else if (*s == '$')
-      /* add code for references here. */
-      ;
+    {
+      int output_dollar = 0;
+      char *ref;
+      char save;
+
+      ++s;
+      if (*s == '$')
+      {
+       output_dollar = 1;
+       ++s;
+      }
+      if (*s == '$')
+      {
+       *d++ = '$';
+      }
+      else
+      {
+       ref = s;
+       while (isalnum (*s) || *s == '-' || *s == '_')
+         ++s;
+
+       docstat = commit_buff (buff, &d, out, docstat);
+       save = *s;
+       *s = 0;
+       print_ref (out, output_dollar, ref);
+       *s = save;
+       --s;
+      }
+    }
     else
       *d++ = *s;
   }