emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] dynamic-modules fa450f8 07/22: doc.c: use DOC format sanit


From: Teodor Zlatanov
Subject: [Emacs-diffs] dynamic-modules fa450f8 07/22: doc.c: use DOC format sanity checks instead of bytecompiled checks on module doc files.
Date: Thu, 27 Nov 2014 02:01:51 +0000

branch: dynamic-modules
commit fa450f82b985092c9b434b319e535b1e1b16a145
Author: Aurélien Aptel <address@hidden>
Date:   Sun Nov 23 20:57:51 2014 +0100

    doc.c: use DOC format sanity checks instead of bytecompiled checks on 
module doc files.
---
 src/doc.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/doc.c b/src/doc.c
index f4aa0c5..bc74553 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -56,6 +56,15 @@ read_bytecode_char (bool unreadflag)
   return *read_bytecode_pointer++;
 }
 
+/* A module doc file must have a doc extension */
+static bool
+doc_is_from_module_p (const char* path)
+{
+  int len = strlen (path);
+  return len > 4 && (strcmp (path + len - 4, ".doc") == 0
+                     || (strcmp (path + len - 4, ".DOC") == 0));
+}
+
 /* Extract a doc string from a file.  FILEPOS says where to get it.
    If it is an integer, use that position in the standard DOC file.
    If it is (FILE . INTEGER), use FILE as the file name
@@ -211,7 +220,7 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool 
definition)
   SAFE_FREE ();
 
   /* Sanity checking.  */
-  if (CONSP (filepos))
+  if (CONSP (filepos) && !doc_is_from_module_p (name))
     {
       int test = 1;
       /* A dynamic docstring should be either at the very beginning of a "#@



reply via email to

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