texinfo-commits
[Top][All Lists]
Advanced

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

[5687] M-x describe-key


From: Gavin D. Smith
Subject: [5687] M-x describe-key
Date: Sat, 28 Jun 2014 19:18:46 +0000

Revision: 5687
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5687
Author:   gavin
Date:     2014-06-28 19:18:44 +0000 (Sat, 28 Jun 2014)
Log Message:
-----------
M-x describe-key

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-06-28 18:37:16 UTC (rev 5686)
+++ trunk/ChangeLog     2014-06-28 19:18:44 UTC (rev 5687)
@@ -33,6 +33,11 @@
        * info/infodoc.c (pretty_keyseq_internal): Merged into pretty_keyseq.
        (pretty_keyseq): Use struct text_buffer.
 
+       * info/infodoc.c (describe_key): Call get_input_key to get key press.
+       * info/session.c (info_dispatch_on_key): Use tolower where intended.
+
+       * info/doc.h (DocInfoCmd): Macro removed.  Uses updated.
+
 2014-06-28  Gavin Smith  <address@hidden>
 
        * info/infokey.h:

Modified: trunk/info/doc.h
===================================================================
--- trunk/info/doc.h    2014-06-28 18:37:16 UTC (rev 5686)
+++ trunk/info/doc.h    2014-06-28 19:18:44 UTC (rev 5687)
@@ -66,7 +66,6 @@
    dereferencing a void *.  */
 #define InfoFunction(ic) ((ic) ? (ic)->func : (VFunction *) NULL)
 #define InfoCmd(fn) (&function_doc_array[A_##fn])
-#define DocInfoCmd(fd) ((fd) && (fd)->func ? (fd) : NULL)
 
 #include "infomap.h" /* for Keymap.  */
 

Modified: trunk/info/infodoc.c
===================================================================
--- trunk/info/infodoc.c        2014-06-28 18:37:16 UTC (rev 5686)
+++ trunk/info/infodoc.c        2014-06-28 19:18:44 UTC (rev 5687)
@@ -227,7 +227,7 @@
         exec_keys = xstrdup (exec_keys);
       for (i = 0; function_doc_array[i].func; i++)
         {
-          InfoCommand *cmd = DocInfoCmd(&function_doc_array[i]);
+          InfoCommand *cmd = &function_doc_array[i];
 
           if (InfoFunction(cmd) != (VFunction *) info_do_lowercase_version
               && !where_is_internal (info_keymap, cmd)
@@ -469,13 +469,16 @@
     if (strcmp (function_doc_array[i].func_name, name) == 0)
       break;
 
-  return DocInfoCmd(&function_doc_array[i]);
+  if (!function_doc_array[i].func)
+    return 0;
+  else
+    return &function_doc_array[i];
 }
 
 DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
 {
   int keys[50];
-  unsigned char keystroke;
+  int keystroke;
   int *k = keys;
   Keymap map = info_keymap;
 
@@ -484,7 +487,7 @@
   for (;;)
     {
       message_in_echo_area (_("Describe key: %s"), pretty_keyseq (keys));
-      keystroke = info_get_input_byte ();
+      keystroke = get_input_key ();
       unmessage_in_echo_area ();
 
       /* Add the KEYSTROKE to our list. */
@@ -514,10 +517,18 @@
           if (InfoFunction(map[keystroke].function)
               == (VFunction *) info_do_lowercase_version)
             {
-              unsigned char lowerkey = Meta_p(keystroke)
-                                       ? Meta (tolower (UnMeta (keystroke)))
-                                       : tolower (keystroke);
+              int lowerkey;
 
+              if (keystroke >= KEYMAP_META_BASE)
+                {
+                  lowerkey = keystroke;
+                  lowerkey -= KEYMAP_META_BASE;
+                  lowerkey = tolower (lowerkey);
+                  lowerkey += KEYMAP_META_BASE;
+                }
+              else
+                lowerkey = tolower (keystroke);
+
               if (map[lowerkey].function == NULL)
                 {
                   message_in_echo_area (_("%s is undefined."),
@@ -544,7 +555,7 @@
     }
 }
 
-/* Return the pretty printable name of a single character. */
+/* Return the pretty-printable name of a single key. */
 char *
 pretty_keyname (int key)
 {

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-06-28 18:37:16 UTC (rev 5686)
+++ trunk/info/session.c        2014-06-28 19:18:44 UTC (rev 5687)
@@ -4663,11 +4663,11 @@
                   {
                     lowerkey = key;
                     lowerkey -= KEYMAP_META_BASE;
-                    lowerkey = towlower (lowerkey);
+                    lowerkey = tolower (lowerkey);
                     lowerkey += KEYMAP_META_BASE;
                   }
                 else
-                  lowerkey = towlower (key);
+                  lowerkey = tolower (key);
 
                 if (lowerkey == key)
                   {




reply via email to

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