⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 infodoc.c

📁 gcc-2.95.3 Linux下最常用的C编译器
💻 C
📖 第 1 页 / 共 2 页
字号:
    {      /* If the current window is very large (greater than 45 lines),         then split it and show the help node in another window.         Otherwise, use the current window. */      if (active_window->height > 45)        active_window = window_make_window (node);      else        {          set_remembered_pagetop_and_point (active_window);          window_set_node_of_window (active_window, node);        }      remember_window_and_node (active_window, node);    }}/* **************************************************************** *//*                                                                  *//*                   Groveling Info Keymaps and Docs                *//*                                                                  *//* **************************************************************** *//* Return the documentation associated with the Info command FUNCTION. */char *function_documentation (function)     VFunction *function;{  register int i;  for (i = 0; function_doc_array[i].func; i++)    if (function == function_doc_array[i].func)      break;  return (replace_in_documentation (function_doc_array[i].doc));}#if defined (NAMED_FUNCTIONS)/* Return the user-visible name of the function associated with the   Info command FUNCTION. */char *function_name (function)     VFunction *function;{  register int i;  for (i = 0; function_doc_array[i].func; i++)    if (function == function_doc_array[i].func)      break;  return (function_doc_array[i].func_name);}/* Return a pointer to the function named NAME. */VFunction *named_function (name)     char *name;{  register int i;  for (i = 0; function_doc_array[i].func; i++)    if (strcmp (function_doc_array[i].func_name, name) == 0)      break;  return (function_doc_array[i].func);}#endif /* NAMED_FUNCTIONS *//* Return the documentation associated with KEY in MAP. */char *key_documentation (key, map)     char key;     Keymap map;{  VFunction *function = map[key].function;  if (function)    return (function_documentation (function));  else    return ((char *)NULL);}DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY")){  char keyname[50];  int keyname_index = 0;  unsigned char keystroke;  char *rep;  Keymap map;  keyname[0] = '\0';  map = window->keymap;  while (1)    {      message_in_echo_area (_("Describe key: %s"), keyname);      keystroke = info_get_input_char ();      unmessage_in_echo_area ();      if (Meta_p (keystroke) && (!ISO_Latin_p || key < 160))        {          if (map[ESC].type != ISKMAP)            {              window_message_in_echo_area                (_("ESC %s is undefined."), pretty_keyname (UnMeta (keystroke)));              return;            }          strcpy (keyname + keyname_index, "ESC ");          keyname_index = strlen (keyname);          keystroke = UnMeta (keystroke);          map = (Keymap)map[ESC].function;        }      /* Add the printed representation of KEYSTROKE to our keyname. */      rep = pretty_keyname (keystroke);      strcpy (keyname + keyname_index, rep);      keyname_index = strlen (keyname);      if (map[keystroke].function == (VFunction *)NULL)        {          message_in_echo_area (_("%s is undefined."), keyname);          return;        }      else if (map[keystroke].type == ISKMAP)        {          map = (Keymap)map[keystroke].function;          strcat (keyname, " ");          keyname_index = strlen (keyname);          continue;        }      else        {          char *message, *fundoc, *funname = "";#if defined (NAMED_FUNCTIONS)          funname = function_name (map[keystroke].function);#endif /* NAMED_FUNCTIONS */          fundoc = function_documentation (map[keystroke].function);          message = (char *)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);          break;        }    }}/* How to get the pretty printable name of a character. */static char rep_buffer[30];char *pretty_keyname (key)     unsigned char key;{  char *rep;  if (Meta_p (key))    {      char temp[20];      rep = pretty_keyname (UnMeta (key));      sprintf (temp, "ESC %s", rep);      strcpy (rep_buffer, temp);      rep = rep_buffer;    }  else if (Control_p (key))    {      switch (key)        {        case '\n': rep = "LFD"; break;        case '\t': rep = "TAB"; break;        case '\r': rep = "RET"; break;        case ESC:  rep = "ESC"; break;        default:          sprintf (rep_buffer, "C-%c", UnControl (key));          rep = rep_buffer;        }    }  else    {      switch (key)        {        case ' ': rep = "SPC"; break;        case DEL: rep = "DEL"; break;        default:          rep_buffer[0] = key;          rep_buffer[1] = '\0';          rep = rep_buffer;        }    }  return (rep);}/* Replace the names of functions with the key that invokes them. */char *replace_in_documentation (string)     char *string;{  register int i, start, next;  static char *result = (char *)NULL;  maybe_free (result);  result = (char *)xmalloc (1 + strlen (string));  i = next = start = 0;  /* Skip to the beginning of a replaceable function. */  for (i = start; string[i]; i++)    {      /* Is this the start of a replaceable function name? */      if (string[i] == '\\' && string[i + 1] == '[')        {          char *fun_name, *rep;          VFunction *function;          /* Copy in the old text. */          strncpy (result + next, string + start, i - start);          next += (i - start);          start = i + 2;          /* Move to the end of the function name. */          for (i = start; string[i] && (string[i] != ']'); i++);          fun_name = (char *)xmalloc (1 + i - start);          strncpy (fun_name, string + start, i - start);          fun_name[i - start] = '\0';          /* Find a key which invokes this function in the info_keymap. */          function = named_function (fun_name);          /* If the internal documentation string fails, there is a              serious problem with the associated command's documentation.             We croak so that it can be fixed immediately. */          if (!function)            abort ();          rep = where_is (info_keymap, function);          strcpy (result + next, rep);          next = strlen (result);          start = i;          if (string[i])            start++;        }    }  strcpy (result + next, string + start);  return (result);}/* Return a string of characters which could be typed from the keymap   MAP to invoke FUNCTION. */static char *where_is_rep = (char *)NULL;static int where_is_rep_index = 0;static int where_is_rep_size = 0;static char *where_is (map, function)     Keymap map;     VFunction *function;{  char *rep;  if (!where_is_rep_size)    where_is_rep = (char *)xmalloc (where_is_rep_size = 100);  where_is_rep_index = 0;  rep = where_is_internal (map, function);  /* If it couldn't be found, return "M-x Foo". */  if (!rep)    {      char *name;      name = function_name (function);      if (name)        sprintf (where_is_rep, "M-x %s", name);      rep = where_is_rep;    }  return (rep);}/* Return the printed rep of FUNCTION as found in MAP, or NULL. */static char *where_is_internal (map, function)     Keymap map;     VFunction *function;{  register int i;    /* If the function is directly invokable in MAP, return the representation     of that keystroke. */  for (i = 0; i < 256; i++)    if ((map[i].type == ISFUNC) && map[i].function == function)      {        sprintf (where_is_rep + where_is_rep_index, "%s", pretty_keyname (i));        return (where_is_rep);      }  /* Okay, search subsequent maps for this function. */  for (i = 0; i < 256; i++)    {      if (map[i].type == ISKMAP)        {          int saved_index = where_is_rep_index;          char *rep;          sprintf (where_is_rep + where_is_rep_index, "%s ",                   pretty_keyname (i));          where_is_rep_index = strlen (where_is_rep);          rep = where_is_internal ((Keymap)map[i].function, function);          if (rep)            return (where_is_rep);          where_is_rep_index = saved_index;        }    }  return ((char *)NULL);}extern char *read_function_name ();DECLARE_INFO_COMMAND (info_where_is,   "Show what to type to execute a given command"){  char *command_name;  command_name = read_function_name (_("Where is command: "), window);  if (!command_name)    {      info_abort_key (active_window, count, key);      return;    }  if (*command_name)    {      VFunction *function;      function = named_function (command_name);      if (function)        {          char *location;          location = where_is (active_window->keymap, function);          if (!location)            {              info_error (_("`%s' is not on any keys"), command_name);            }          else            {              if (strncmp (location, "M-x ", 4) == 0)                window_message_in_echo_area                  (_("%s can only be invoked via %s."), command_name, location);              else                window_message_in_echo_area                  (_("%s can be invoked via %s."), command_name, location);            }        }      else        info_error (_("There is no function named `%s'"), command_name);    }  free (command_name);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -