aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.c
diff options
context:
space:
mode:
authorTom Tromey2013-06-03 12:25:05 -0600
committerTom Tromey2013-06-03 12:25:05 -0600
commit68359abba96d7ec4db8aab3d3dd9cf1105c3bab5 (patch)
tree862703e7e1a1888170136a8296a5750d6b2ae2eb /src/doc.c
parentcbcba8ce7f980b01c18c0fd561ef6687b1361507 (diff)
parente2d8a6f0a229b4ebe26484b892ec4f14888f58b6 (diff)
downloademacs-68359abba96d7ec4db8aab3d3dd9cf1105c3bab5.tar.gz
emacs-68359abba96d7ec4db8aab3d3dd9cf1105c3bab5.zip
merge from trunk; clean up some issues
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/doc.c b/src/doc.c
index 7234fb38bf9..e45481944f0 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -58,7 +58,7 @@ read_bytecode_char (bool unreadflag)
58} 58}
59 59
60/* Extract a doc string from a file. FILEPOS says where to get it. 60/* Extract a doc string from a file. FILEPOS says where to get it.
61 If it is an integer, use that position in the standard DOC-... file. 61 If it is an integer, use that position in the standard DOC file.
62 If it is (FILE . INTEGER), use FILE as the file name 62 If it is (FILE . INTEGER), use FILE as the file name
63 and INTEGER as the position in that file. 63 and INTEGER as the position in that file.
64 But if INTEGER is negative, make it positive. 64 But if INTEGER is negative, make it positive.
@@ -215,14 +215,20 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
215 if (CONSP (filepos)) 215 if (CONSP (filepos))
216 { 216 {
217 int test = 1; 217 int test = 1;
218 if (get_doc_string_buffer[offset - test++] != ' ') 218 /* A dynamic docstring should be either at the very beginning of a "#@
219 return Qnil; 219 comment" or right after a dynamic docstring delimiter (in case we
220 while (get_doc_string_buffer[offset - test] >= '0' 220 pack several such docstrings within the same comment). */
221 && get_doc_string_buffer[offset - test] <= '9') 221 if (get_doc_string_buffer[offset - test] != '\037')
222 test++; 222 {
223 if (get_doc_string_buffer[offset - test++] != '@' 223 if (get_doc_string_buffer[offset - test++] != ' ')
224 || get_doc_string_buffer[offset - test] != '#') 224 return Qnil;
225 return Qnil; 225 while (get_doc_string_buffer[offset - test] >= '0'
226 && get_doc_string_buffer[offset - test] <= '9')
227 test++;
228 if (get_doc_string_buffer[offset - test++] != '@'
229 || get_doc_string_buffer[offset - test] != '#')
230 return Qnil;
231 }
226 } 232 }
227 else 233 else
228 { 234 {
@@ -602,7 +608,7 @@ the same file name is found in the `doc-directory'. */)
602 while (*beg && c_isspace (*beg)) ++beg; 608 while (*beg && c_isspace (*beg)) ++beg;
603 609
604 for (end = beg; *end && ! c_isspace (*end); ++end) 610 for (end = beg; *end && ! c_isspace (*end); ++end)
605 if (*end == '/') beg = end+1; /* skip directory part */ 611 if (*end == '/') beg = end + 1; /* Skip directory part. */
606 612
607 len = end - beg; 613 len = end - beg;
608 if (len > 4 && end[-4] == '.' && end[-3] == 'o') 614 if (len > 4 && end[-4] == '.' && end[-3] == 'o')