[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5841] don't show file extensions in apropos node
From: |
Gavin D. Smith |
Subject: |
[5841] don't show file extensions in apropos node |
Date: |
Sun, 28 Sep 2014 17:06:16 +0000 |
Revision: 5841
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5841
Author: gavin
Date: 2014-09-28 17:06:14 +0000 (Sun, 28 Sep 2014)
Log Message:
-----------
don't show file extensions in apropos node
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/indices.c
trunk/info/session.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2014-09-26 21:32:09 UTC (rev 5840)
+++ trunk/ChangeLog 2014-09-28 17:06:14 UTC (rev 5841)
@@ -1,3 +1,11 @@
+2014-09-28 Gavin Smith <address@hidden>
+
+ * info/indices.c (info_index_apropos): Strip any suffix like
+ ".info" from uses of filename in generated node contents. Mark
+ node contents as an index. Comment added mentioning problem
+ with character encodings. Introductory text changed to be more
+ descriptive.
+
2014-09-24 Gavin Smith <address@hidden>
* info/doc.h (InfoCommand): Removed. All uses updated.
Modified: trunk/info/indices.c
===================================================================
--- trunk/info/indices.c 2014-09-26 21:32:09 UTC (rev 5840)
+++ trunk/info/indices.c 2014-09-28 17:06:14 UTC (rev 5841)
@@ -618,26 +618,39 @@
}
else
{
+ /* Create the node. FIXME: Labels and node names taken from the
+ indices of Info files may be in a different character encoding to
+ the one currently being used. */
register int i;
text_buffer_init (&message);
- text_buffer_printf (&message,
- _("\n* Menu: Nodes whose indices contain '%s':\n"),
- line);
+ text_buffer_add_char (&message, '\n');
+ text_buffer_printf (&message, _("Index entries containing "
+ "'%s':\n"), line);
+ text_buffer_printf (&message, "\n* Menu:");
+ text_buffer_printf (&message, " \b[index \b]");
+ text_buffer_add_char (&message, '\n');
for (i = 0; apropos_list[i]; i++)
{
int line_start = text_buffer_off (&message);
+ char *filename;
- /* The label might be identical to that of another index
- entry in another Info file. Therefore, we make the file
- name part of the menu entry, to make them all distinct. */
+ /* Remove file extension. */
+ filename = program_name_from_file_name
+ (apropos_list[i]->filename);
+
+ /* The label might be identical to that of another index
+ entry in another Info file. Therefore, we make the file
+ name part of the menu entry, to make them all distinct. */
text_buffer_printf (&message, "* %s [%s]: ",
- apropos_list[i]->label, apropos_list[i]->filename);
+ apropos_list[i]->label, filename);
+
while (text_buffer_off (&message) - line_start < 40)
text_buffer_add_char (&message, ' ');
text_buffer_printf (&message, "(%s)%s.\n",
- apropos_list[i]->filename, apropos_list[i]->nodename);
+ filename, apropos_list[i]->nodename);
+ free (filename);
}
}
Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c 2014-09-26 21:32:09 UTC (rev 5840)
+++ trunk/info/session.c 2014-09-28 17:06:14 UTC (rev 5841)
@@ -3378,8 +3378,9 @@
return entry;
}
-/* Given a name of an Info file, find the name of the package it
- describes by removing the leading directories and extensions. */
+/* Given a name of an Info file, find the name of the package it describes by
+ removing the leading directories and extensions. Return value should be
+ freed by caller. */
char *
program_name_from_file_name (char *file_name)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5841] don't show file extensions in apropos node,
Gavin D. Smith <=