texinfo-commits
[Top][All Lists]
Advanced

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

[5660] NAMED_FUNCTIONS unconditional; tidy-up


From: Gavin D. Smith
Subject: [5660] NAMED_FUNCTIONS unconditional; tidy-up
Date: Thu, 12 Jun 2014 10:18:33 +0000

Revision: 5660
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5660
Author:   gavin
Date:     2014-06-12 10:18:31 +0000 (Thu, 12 Jun 2014)
Log Message:
-----------
NAMED_FUNCTIONS unconditional; tidy-up

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/doc.h
    trunk/info/footnotes.c
    trunk/info/info.h
    trunk/info/infodoc.c
    trunk/info/infomap.c
    trunk/info/makedoc.c
    trunk/info/session.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-06-11 17:52:15 UTC (rev 5659)
+++ trunk/ChangeLog     2014-06-12 10:18:31 UTC (rev 5660)
@@ -1,3 +1,13 @@
+2014-06-12  Gavin Smith  <address@hidden>
+
+       * info/info.h, info/makedoc.c, info/doc.h, info/infomap.c,
+       info/infodoc.c: [NAMED_FUNCTIONS]: Made unconditional.
+       * info/infodoc.c (default_emacs_like_ea_keys): Commented out entry for
+       "M-x" removed.
+       * info/footnotes.c (make_footnotes_node): Disabled code removed.
+       * info/session.c (info_next_window, info_prev_window): Don't include
+       echo area in window loop.
+
 2014-06-11  Gavin Smith  <address@hidden>
 
        * info/session.c (info_follow_menus): Return value changed.  All

Modified: trunk/info/doc.h
===================================================================
--- trunk/info/doc.h    2014-06-11 17:52:15 UTC (rev 5659)
+++ trunk/info/doc.h    2014-06-12 10:18:31 UTC (rev 5660)
@@ -1,7 +1,7 @@
 /* doc.h -- Structures associating function pointers with documentation.
    $Id$
 
-   Copyright 1993, 2001, 2004, 2007, 2011, 2013
+   Copyright 1993, 2001, 2004, 2007, 2011, 2013, 2014
    Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -22,7 +22,7 @@
 #if !defined (DOC_H)
 #define DOC_H
 
-#include "info.h" /* for NAMED_FUNCTIONS, VFunction, etc.  */
+#include "info.h"
 
 #if defined (INFOKEY)
 /* For each function, we keep track of the first defined key sequence
@@ -46,7 +46,6 @@
 
 #endif /* INFOKEY */
 
-
 /* An array of FUNCTION_DOC structures is defined in doc.c, which is
    automagically generated by the makedoc utility, whose job is to scan
    through the source files for command function declarations and
@@ -55,9 +54,7 @@
 typedef struct
 {
   VFunction *func;
-#if defined (NAMED_FUNCTIONS)
   char *func_name;
-#endif /* NAMED_FUNCTIONS */
 #if defined (INFOKEY)
   FUNCTION_KEYSEQ *keys;
 #endif /* INFOKEY */
@@ -87,10 +84,8 @@
 
 #include "infomap.h" /* for Keymap.  */
 
-#if defined (NAMED_FUNCTIONS)
 extern char *function_name (InfoCommand *cmd);
 extern InfoCommand *named_function (char *name);
-#endif /* NAMED_FUNCTIONS */
 
 extern char *function_documentation (InfoCommand *cmd);
 extern char *pretty_keyname (unsigned char key);

Modified: trunk/info/footnotes.c
===================================================================
--- trunk/info/footnotes.c      2014-06-11 17:52:15 UTC (rev 5659)
+++ trunk/info/footnotes.c      2014-06-12 10:18:31 UTC (rev 5660)
@@ -172,13 +172,6 @@
     free (header);
   }
 
-#if defined (NOTDEF)
-  /* If the footnotes were gleaned from the node that we were called with,
-     shorten the calling node's display length. */
-  if (fn_node == node)
-    narrow_node (node, 0, fn_start);
-#endif /* NOTDEF */
-
   return result;
 }
 

Modified: trunk/info/info.h
===================================================================
--- trunk/info/info.h   2014-06-11 17:52:15 UTC (rev 5659)
+++ trunk/info/info.h   2014-06-12 10:18:31 UTC (rev 5660)
@@ -22,8 +22,7 @@
 #ifndef INFO_H
 #define INFO_H
 
-/* We always want these, so why clutter up the compile command?  */
-#define NAMED_FUNCTIONS
+/* We always want this, so why clutter up the compile command?  */
 #define INFOKEY
 
 /* System dependencies.  */

Modified: trunk/info/infodoc.c
===================================================================
--- trunk/info/infodoc.c        2014-06-11 17:52:15 UTC (rev 5659)
+++ trunk/info/infodoc.c        2014-06-12 10:18:31 UTC (rev 5660)
@@ -248,7 +248,6 @@
           while (tb->off - start_of_line < 8)
             text_buffer_printf (tb, " ");
 
-#if defined (NAMED_FUNCTIONS)
           /* Print the name of the function, and some padding before the
              documentation string is printed. */
           {
@@ -270,7 +269,6 @@
                   }
               }
           }
-#endif /* NAMED_FUNCTIONS */
           text_buffer_printf (tb, "%s\n", doc);
         }
     }
@@ -340,7 +338,6 @@
       text_buffer_printf (&msg, _("Commands available in the echo area:\n\n"));
       dump_map_to_text_buffer (&msg, "", echo_area_keymap);
 
-#if defined (NAMED_FUNCTIONS)
       /* Get a list of commands which have no keystroke equivs. */
       exec_keys = where_is (info_keymap, InfoCmd(info_execute_command));
       if (exec_keys)
@@ -378,7 +375,6 @@
         }
 
       free (exec_keys);
-#endif /* NAMED_FUNCTIONS */
 
       node = text_buffer_to_node (&msg);
       internal_info_help_node_contents = node->contents;
@@ -586,7 +582,6 @@
   return replace_in_documentation ((strlen (doc) == 0) ? doc : _(doc), 0);
 }
 
-#if defined (NAMED_FUNCTIONS)
 /* Return the user-visible name of the function associated with the
    Info command FUNCTION. */
 char *
@@ -621,7 +616,6 @@
 
   return DocInfoCmd(&function_doc_array[i]);
 }
-#endif /* NAMED_FUNCTIONS */
 
 DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
 {
@@ -698,20 +692,14 @@
 
           keyname = pretty_keyseq (keys);
 
-#if defined (NAMED_FUNCTIONS)
           funname = function_name (map[keystroke].function);
-#endif /* NAMED_FUNCTIONS */
 
           fundoc = function_documentation (map[keystroke].function);
 
           message = xmalloc
             (10 + strlen (keyname) + strlen (fundoc) + strlen (funname));
 
-#if defined (NAMED_FUNCTIONS)
           sprintf (message, "%s (%s): %s.", keyname, funname, fundoc);
-#else
-          sprintf (message, _("%s is defined to %s."), keyname, fundoc);
-#endif /* !NAMED_FUNCTIONS */
 
           window_message_in_echo_area ("%s", message);
           free (message);

Modified: trunk/info/infomap.c
===================================================================
--- trunk/info/infomap.c        2014-06-11 17:52:15 UTC (rev 5659)
+++ trunk/info/infomap.c        2014-06-12 10:18:31 UTC (rev 5660)
@@ -384,10 +384,8 @@
   Meta('f'), NUL,                 A_info_forward_word,
   Meta('r'), NUL,                 A_info_move_to_window_line,
   Meta('v'), NUL,                 A_info_scroll_backward_page_only,
-#if defined (NAMED_FUNCTIONS)
   ESC, 'x', NUL,                  A_info_execute_command,
   Meta('x'), NUL,                 A_info_execute_command,
-#endif /* NAMED_FUNCTIONS */
 
   CONTROL('x'), CONTROL('b'), NUL,        A_list_visited_nodes,
   CONTROL('x'), CONTROL('c'), NUL,        A_info_quit,
@@ -523,10 +521,6 @@
 #else
   DEL, NUL,                       A_ea_rubout,
 #endif
-#if defined (NAMED_FUNCTIONS)
-  /*    ESC, 'x', NUL,                  A_info_execute_command, */
-  /*    Meta('x'), NUL,                 A_info_execute_command, */
-#endif /* NAMED_FUNCTIONS */
   CONTROL('x'), 'o', NUL,         A_info_next_window,
   CONTROL('x'), DEL, NUL,         A_ea_backward_kill_line,
 
@@ -677,10 +671,8 @@
   ESC, 's', NUL,                  A_isearch_forward,
   ESC, 't', NUL,                  A_info_top_node,
   ESC, 'v', NUL,                  A_info_scroll_backward_page_only,
-#if defined (NAMED_FUNCTIONS)
   ESC, 'x', NUL,                  A_info_execute_command,
   Meta('x'), NUL,                 A_info_execute_command,
-#endif /* NAMED_FUNCTIONS */
   ESC, DEL, NUL,                  A_info_scroll_other_window_backward,
   CONTROL('x'), CONTROL('b'), NUL,        A_list_visited_nodes,
   CONTROL('x'), CONTROL('c'), NUL,        A_info_quit,

Modified: trunk/info/makedoc.c
===================================================================
--- trunk/info/makedoc.c        2014-06-11 17:52:15 UTC (rev 5659)
+++ trunk/info/makedoc.c        2014-06-12 10:18:31 UTC (rev 5660)
@@ -2,7 +2,7 @@
    $Id$
 
    Copyright 1993, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2007,
-   2008, 2012, 2013 Free Software Foundation, Inc.
+   2008, 2012, 2013, 2014 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -50,9 +50,7 @@
 static char *doc_header_1[] = {
   "   An entry in the array FUNCTION_DOC_ARRAY is made for each command",
   "   found in the above files; each entry consists of a function pointer,",
-#if defined (NAMED_FUNCTIONS)
   "   a string which is the user-visible name of the function,",
-#endif /* NAMED_FUNCTIONS */
   "   and a string which documents its purpose. */",
   "",
   "#include \"info.h\"",
@@ -208,21 +206,13 @@
 
 #if defined (INFOKEY)
 
-#if defined (NAMED_FUNCTIONS)
   fprintf (doc_stream,
            "   { NULL, NULL, NULL, NULL }\n};\n");
-#else /* !NAMED_FUNCTIONS */
-  fprintf (doc_stream, "   { NULL, NULL, NULL }\n};\n");
-#endif /* !NAMED_FUNCTIONS */
 
 #else /* !INFOKEY */
 
-#if defined (NAMED_FUNCTIONS)
   fprintf (doc_stream,
            "   { NULL, NULL, NULL }\n};\n");
-#else /* !NAMED_FUNCTIONS */
-  fprintf (doc_stream, "   { NULL, NULL }\n};\n");
-#endif /* !NAMED_FUNCTIONS */
 
 #endif /* !INFOKEY */
 
@@ -360,9 +350,7 @@
       int line_number = 0;
 
       char *func, *doc;
-#if defined (INFOKEY) || defined (NAMED_FUNCTIONS)
       char *func_name;
-#endif /* INFOKEY || NAMED_FUNCTIONS */
 
       for (; offset < (file_size - decl_len); offset++)
         {
@@ -427,7 +415,6 @@
         add_tag_to_block (block, tag_name, line_number, point);
       }
 
-#if defined (INFOKEY) || defined (NAMED_FUNCTIONS)
       /* Generate the user-visible function name from the function's name. */
       {
         register int i;
@@ -456,7 +443,6 @@
           if (func_name[i] == '_')
             func_name[i] = '-';
       }
-#endif /* INFOKEY || NAMED_FUNCTIONS */
 
       /* Find doc string. */
       point = offset + 1;
@@ -503,30 +489,19 @@
 
 #if defined (INFOKEY)
 
-#if defined (NAMED_FUNCTIONS)
       fprintf (doc_stream,
           "   { (VFunction *)%s, \"%s\", (FUNCTION_KEYSEQ *)0, %s },\n",
           func, func_name, doc);
-#else /* !NAMED_FUNCTIONS */
-      fprintf (doc_stream,
-          "   { (VFunction *) %s, (FUNCTION_KEYSEQ *)0, %s },\n", func, doc);
-#endif /* !NAMED_FUNCTIONS */
 
       fprintf (key_stream, "   { \"%s\", A_%s },\n", func_name, func);
 
 #else /* !INFOKEY */
 
-#if defined (NAMED_FUNCTIONS)
       fprintf (doc_stream, "   { %s, \"%s\", %s },\n", func, func_name, doc);
-#else /* !NAMED_FUNCTIONS */
-      fprintf (doc_stream, "   { %s, %s },\n", func, doc);
-#endif /* !NAMED_FUNCTIONS */
 
 #endif /* !INFOKEY */
 
-#if defined (INFOKEY) || defined (NAMED_FUNCTIONS)
       free (func_name);
-#endif /* INFOKEY || NAMED_FUNCTIONS */
 
 #if defined (INFOKEY)
       fprintf (funs_stream, "#define A_%s %u\n", func, next_func_key());

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-06-11 17:52:15 UTC (rev 5659)
+++ trunk/info/session.c        2014-06-12 10:18:31 UTC (rev 5660)
@@ -1085,7 +1085,7 @@
     }
 
   /* If no other window, error now. */
-  if (!windows->next && !echo_area_is_active)
+  if (!windows->next || echo_area_is_active)
     {
       info_error ("%s", msg_one_window);
       return;
@@ -1096,12 +1096,7 @@
       if (window->next)
         window = window->next;
       else
-        {
-          if (window == the_echo_area || !echo_area_is_active)
-            window = windows;
-          else
-            window = the_echo_area;
-        }
+        window = windows;
     }
 
   if (active_window != window)
@@ -1127,8 +1122,7 @@
     }
 
   /* Only one window? */
-
-  if (!windows->next && !echo_area_is_active)
+  if (!windows->next || echo_area_is_active)
     {
       info_error ("%s", msg_one_window);
       return;
@@ -1136,24 +1130,15 @@
 
   while (count--)
     {
-      /* If we are in the echo area, or if the echo area isn't active and we
-         are in the first window, find the last window in the chain. */
-      if (window == the_echo_area
-          || window == windows && !echo_area_is_active)
-        {
-          register WINDOW *win, *last = NULL;
 
-          for (win = windows; win; win = win->next)
-            last = win;
-
-          window = last;
-        }
-      else
+      if (window != windows && window->prev)
+        window = window->prev;
+      else if (window == windows)
         {
-          if (window == windows)
-            window = the_echo_area;
-          else
-            window = window->prev;
+          /* If we are in the first window, find the last window in the
+             chain. */
+          while (window->next)
+            window = window->next;
         }
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]