aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.c
diff options
context:
space:
mode:
authorJoakim Verona2012-07-27 02:22:03 +0200
committerJoakim Verona2012-07-27 02:22:03 +0200
commit5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f (patch)
tree5c55f1096a656a9759f0b53a0b5d1a2289bd366f /src/doc.c
parent0c5c85cf2b350c965bb1ffa5b2d77c2adebc406b (diff)
parent562157c814037dcba58a20cd6908a95992c22283 (diff)
downloademacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.tar.gz
emacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.zip
upstream
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/doc.c b/src/doc.c
index 223741c3bf5..44363e30e82 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -42,9 +42,6 @@ static char *get_doc_string_buffer;
42static ptrdiff_t get_doc_string_buffer_size; 42static ptrdiff_t get_doc_string_buffer_size;
43 43
44static unsigned char *read_bytecode_pointer; 44static unsigned char *read_bytecode_pointer;
45static Lisp_Object Fdocumentation_property (Lisp_Object, Lisp_Object,
46 Lisp_Object);
47static Lisp_Object Fsnarf_documentation (Lisp_Object);
48 45
49/* readchar in lread.c calls back here to fetch the next byte. 46/* readchar in lread.c calls back here to fetch the next byte.
50 If UNREADFLAG is 1, we unread a byte. */ 47 If UNREADFLAG is 1, we unread a byte. */
@@ -384,7 +381,7 @@ string is passed through `substitute-command-keys'. */)
384 } 381 }
385 else if (CONSP (fun)) 382 else if (CONSP (fun))
386 { 383 {
387 funcar = Fcar (fun); 384 funcar = XCAR (fun);
388 if (!SYMBOLP (funcar)) 385 if (!SYMBOLP (funcar))
389 xsignal1 (Qinvalid_function, fun); 386 xsignal1 (Qinvalid_function, fun);
390 else if (EQ (funcar, Qkeymap)) 387 else if (EQ (funcar, Qkeymap))
@@ -580,14 +577,13 @@ the same file name is found in the `doc-directory'. */)
580 (0) 577 (0)
581#endif /* CANNOT_DUMP */ 578#endif /* CANNOT_DUMP */
582 { 579 {
583 name = (char *) alloca (SCHARS (filename) + 14); 580 name = alloca (SCHARS (filename) + 14);
584 strcpy (name, "../etc/"); 581 strcpy (name, "../etc/");
585 } 582 }
586 else 583 else
587 { 584 {
588 CHECK_STRING (Vdoc_directory); 585 CHECK_STRING (Vdoc_directory);
589 name = (char *) alloca (SCHARS (filename) 586 name = alloca (SCHARS (filename) + SCHARS (Vdoc_directory) + 1);
590 + SCHARS (Vdoc_directory) + 1);
591 strcpy (name, SSDATA (Vdoc_directory)); 587 strcpy (name, SSDATA (Vdoc_directory));
592 } 588 }
593 strcat (name, SSDATA (filename)); /*** Add this line ***/ 589 strcat (name, SSDATA (filename)); /*** Add this line ***/
@@ -649,7 +645,7 @@ the same file name is found in the `doc-directory'. */)
649 { 645 {
650 ptrdiff_t len = end - p - 2; 646 ptrdiff_t len = end - p - 2;
651 char *fromfile = alloca (len + 1); 647 char *fromfile = alloca (len + 1);
652 strncpy (fromfile, &p[2], len); 648 memcpy (fromfile, &p[2], len);
653 fromfile[len] = 0; 649 fromfile[len] = 0;
654 if (fromfile[len-1] == 'c') 650 if (fromfile[len-1] == 'c')
655 fromfile[len-1] = 'o'; 651 fromfile[len-1] = 'o';
@@ -760,7 +756,7 @@ Otherwise, return a new string, without any text properties. */)
760 keymap = Voverriding_local_map; 756 keymap = Voverriding_local_map;
761 757
762 bsize = SBYTES (string); 758 bsize = SBYTES (string);
763 bufp = buf = (char *) xmalloc (bsize); 759 bufp = buf = xmalloc (bsize);
764 760
765 strp = SDATA (string); 761 strp = SDATA (string);
766 while (strp < SDATA (string) + SBYTES (string)) 762 while (strp < SDATA (string) + SBYTES (string))
@@ -831,7 +827,7 @@ Otherwise, return a new string, without any text properties. */)
831 ptrdiff_t offset = bufp - buf; 827 ptrdiff_t offset = bufp - buf;
832 if (STRING_BYTES_BOUND - 4 < bsize) 828 if (STRING_BYTES_BOUND - 4 < bsize)
833 string_overflow (); 829 string_overflow ();
834 buf = (char *) xrealloc (buf, bsize += 4); 830 buf = xrealloc (buf, bsize += 4);
835 bufp = buf + offset; 831 bufp = buf + offset;
836 memcpy (bufp, "M-x ", 4); 832 memcpy (bufp, "M-x ", 4);
837 bufp += 4; 833 bufp += 4;
@@ -897,11 +893,11 @@ Otherwise, return a new string, without any text properties. */)
897 if (NILP (tem)) 893 if (NILP (tem))
898 { 894 {
899 name = Fsymbol_name (name); 895 name = Fsymbol_name (name);
900 insert_string ("\nUses keymap \""); 896 insert_string ("\nUses keymap `");
901 insert_from_string (name, 0, 0, 897 insert_from_string (name, 0, 0,
902 SCHARS (name), 898 SCHARS (name),
903 SBYTES (name), 1); 899 SBYTES (name), 1);
904 insert_string ("\", which is not currently defined.\n"); 900 insert_string ("', which is not currently defined.\n");
905 if (start[-1] == '<') keymap = Qnil; 901 if (start[-1] == '<') keymap = Qnil;
906 } 902 }
907 else if (start[-1] == '<') 903 else if (start[-1] == '<')
@@ -927,7 +923,7 @@ Otherwise, return a new string, without any text properties. */)
927 ptrdiff_t offset = bufp - buf; 923 ptrdiff_t offset = bufp - buf;
928 if (STRING_BYTES_BOUND - length_byte < bsize) 924 if (STRING_BYTES_BOUND - length_byte < bsize)
929 string_overflow (); 925 string_overflow ();
930 buf = (char *) xrealloc (buf, bsize += length_byte); 926 buf = xrealloc (buf, bsize += length_byte);
931 bufp = buf + offset; 927 bufp = buf + offset;
932 memcpy (bufp, start, length_byte); 928 memcpy (bufp, start, length_byte);
933 bufp += length_byte; 929 bufp += length_byte;