emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] feature/aptel/dynamic-modules-rc3 0cfb066 07/25: doc.c: us


From: Teodor Zlatanov
Subject: [Emacs-diffs] feature/aptel/dynamic-modules-rc3 0cfb066 07/25: doc.c: use DOC format sanity checks instead of bytecompiled checks on module doc files.
Date: Wed, 04 Feb 2015 22:56:12 +0000

branch: feature/aptel/dynamic-modules-rc3
commit 0cfb0665271fd364df9ad7378e435998a5f98326
Author: Aurélien Aptel <address@hidden>
Commit: Aurélien Aptel <address@hidden>

    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]