}
/* #### mrb: following STILL completely broken */
- return_me = make_ext_string ((Bufbyte *) buffer, to - buffer, FORMAT_BINARY);
+ return_me = make_ext_string (buffer, to - buffer, Qbinary);
done:
if (buffer != buf) /* We must have allocated buffer above */
/* !!#### This function has not been Mule-ized */
REGISTER int fd;
REGISTER char *name_nonreloc = 0;
- int minsize;
EMACS_INT position;
Lisp_Object file, tem;
Lisp_Object name_reloc = Qnil;
tem = Ffile_name_absolute_p (file);
if (NILP (tem))
{
+ size_t minsize;
/* XEmacs: Move this check here. OK if called during loadup to
load byte code instructions. */
if (!STRINGP (Vdoc_directory))
DEFUN ("documentation", Fdocumentation, 1, 2, 0, /*
Return the documentation string of FUNCTION.
-Unless a non-nil second argument is given, the
+Unless a non-nil second argument RAW is given, the
string is passed through `substitute-command-keys'.
*/
(function, raw))
else if (COMPILED_FUNCTIONP (fun))
{
Lisp_Object tem;
- struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
+ Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
if (! (f->flags.documentationp))
return Qnil;
tem = compiled_function_documentation (f);
through `substitute-command-keys'. A non-nil third argument avoids this
translation.
*/
- (sym, prop, raw))
+ (symbol, prop, raw))
{
/* This function can GC */
REGISTER Lisp_Object doc = Qnil;
GCPRO1 (doc);
- doc = Fget (sym, prop, Qnil);
+ doc = Fget (symbol, prop, Qnil);
if (INTP (doc))
doc = get_doc_string (XINT (doc) > 0 ? doc : make_int (- XINT (doc)));
else if (CONSP (doc))
#ifdef I18N3
if (!NILP (doc))
{
- domain = Fget (sym, Qvariable_domain, Qnil);
+ domain = Fget (symbol, Qvariable_domain, Qnil);
if (NILP (domain))
doc = Fgettext (doc);
else
}
\f
static void
-weird_doc (Lisp_Object sym, CONST char *weirdness, CONST char *type, int pos)
+weird_doc (Lisp_Object sym, const char *weirdness, const char *type, int pos)
{
if (!strcmp (weirdness, GETTEXT ("duplicate"))) return;
message ("Note: Strange doc (%s) for %s %s @ %d",
{
/* Compiled-Function objects sometimes have
slots for it. */
- struct Lisp_Compiled_Function *f =
- XCOMPILED_FUNCTION (fun);
+ Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
/* This compiled-function object must have a
slot for the docstring, since we've found a
kludgily_ignore_lost_doc_p (Lisp_Object sym)
{
# define kludge_prefix "ad-Orig-"
- struct Lisp_String *name = XSYMBOL (sym)->name;
+ Lisp_String *name = XSYMBOL (sym)->name;
return (string_length (name) > (Bytecount) (sizeof (kludge_prefix)) &&
!strncmp ((char *) string_data (name), kludge_prefix,
sizeof (kludge_prefix) - 1));
}
else if (COMPILED_FUNCTIONP (fun))
{
- struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
+ Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
if (! (f->flags.documentationp))
doc = -1;
else
replaced by either: a keystroke sequence that will invoke COMMAND,
or "M-x COMMAND" if COMMAND is not on any keys.
Substrings of the form \\=\\{MAPVAR} are replaced by summaries
-\(made by describe-bindings) of the value of MAPVAR, taken as a keymap.
+\(made by `describe-bindings') of the value of MAPVAR, taken as a keymap.
Substrings of the form \\=\\<MAPVAR> specify to use the value of MAPVAR
as the keymap for future \\=\\[COMMAND] substrings.
\\=\\= quotes the following character and is discarded;
thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ into the output.
*/
- (str))
+ (string))
{
/* This function can GC */
Bufbyte *buf;
Bytecount idx;
Bytecount bsize;
Bufbyte *new;
- Lisp_Object tem;
- Lisp_Object keymap;
+ Lisp_Object tem = Qnil;
+ Lisp_Object keymap = Qnil;
+ Lisp_Object name = Qnil;
Bufbyte *start;
Bytecount length;
- Lisp_Object name;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
- if (NILP (str))
+ if (NILP (string))
return Qnil;
- CHECK_STRING (str);
- tem = Qnil;
- keymap = Qnil;
- name = Qnil;
- GCPRO4 (str, tem, keymap, name);
+ CHECK_STRING (string);
+ GCPRO4 (string, tem, keymap, name);
/* There is the possibility that the string is not destined for a
translating stream, and it could be argued that we should do the
same thing here as in Fformat(), but there are very few times
when this will be the case and many calls to this function
would have to have `gettext' calls added. (I18N3) */
- str = LISP_GETTEXT (str);
+ string = LISP_GETTEXT (string);
/* KEYMAP is either nil (which means search all the active keymaps)
or a specified local map (which means search just that and the
global map). If non-nil, it might come from Voverriding_local_map,
- or from a \\<mapname> construct in STR itself.. */
+ or from a \\<mapname> construct in STRING itself.. */
#if 0 /* FSFmacs */
/* This is really weird and garbagey. If keymap is nil and there's
an overriding-local-map, `where-is-internal' will correctly note
*/
#endif
- strlength = XSTRING_LENGTH (str);
+ strlength = XSTRING_LENGTH (string);
bsize = 1 + strlength;
buf = (Bufbyte *) xmalloc (bsize);
bufp = buf;
/* Have to reset strdata every time GC might be called */
- strdata = XSTRING_DATA (str);
+ strdata = XSTRING_DATA (string);
for (idx = 0; idx < strlength; )
{
Bufbyte *strp = strdata + idx;
tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qnil);
#if 0 /* FSFmacs */
- /* Disregard menu bar bindings; it is positively annoying to
- mention them when there's no menu bar, and it isn't terribly
- useful even when there is a menu bar. */
- if (!NILP (tem))
- {
- firstkey = Faref (tem, Qzero);
- if (EQ (firstkey, Qmenu_bar))
- tem = Qnil;
- }
+ /* Disregard menu bar bindings; it is positively annoying to
+ mention them when there's no menu bar, and it isn't terribly
+ useful even when there is a menu bar. */
+ if (!NILP (tem))
+ {
+ firstkey = Faref (tem, Qzero);
+ if (EQ (firstkey, Qmenu_bar))
+ tem = Qnil;
+ }
#endif
if (NILP (tem)) /* but not on any keys */
case '{':
case '<':
{
- /* ### jump to label `subst_string|subst' crosses
- initialization of `buffer|_buf' */
- Lisp_Object buffer;
- struct buffer *buf_;
-
- buffer = Fget_buffer_create (QSsubstitute);
- buf_ = XBUFFER (buffer);
+ Lisp_Object buffer = Fget_buffer_create (QSsubstitute);
+ struct buffer *buf_ = XBUFFER (buffer);
Fbuffer_disable_undo (buffer);
Ferase_buffer (buffer);
if (NILP (tem))
{
- char boof[255], *b = boof;
- *b++ = '\n';
- /* #### This sprintf() is potentially dangerous! */
- sprintf (b, GETTEXT (
- "Uses keymap \"%s\", which is not currently defined."),
- (char *) XSTRING_DATA (Fsymbol_name (name)));
- b += strlen (b);
- *b++ = '\n';
- *b++ = 0;
- buffer_insert_c_string (buf_, boof);
+ buffer_insert_c_string (buf_, "(uses keymap \"");
+ buffer_insert_lisp_string (buf_, Fsymbol_name (name));
+ buffer_insert_c_string (buf_, "\", which is not currently defined) ");
if (start[-1] == '<') keymap = Qnil;
}
tem = make_string_from_buffer (buf_, BUF_BEG (buf_),
BUF_Z (buf_) - BUF_BEG (buf_));
Ferase_buffer (buffer);
- goto subst_string;
-
- subst_string:
- start = XSTRING_DATA (tem);
- length = XSTRING_LENGTH (tem);
- subst:
- bsize += length;
- new = (Bufbyte *) xrealloc (buf, bsize);
- bufp += new - buf;
- buf = new;
- memcpy (bufp, start, length);
- bufp += length;
-
- /* Reset STRDATA in case gc relocated it. */
- strdata = XSTRING_DATA (str);
-
- break;
}
+ goto subst_string;
+
+ subst_string:
+ start = XSTRING_DATA (tem);
+ length = XSTRING_LENGTH (tem);
+ subst:
+ bsize += length;
+ new = (Bufbyte *) xrealloc (buf, bsize);
+ bufp += new - buf;
+ buf = new;
+ memcpy (bufp, start, length);
+ bufp += length;
+
+ /* Reset STRDATA in case gc relocated it. */
+ strdata = XSTRING_DATA (string);
+
+ break;
}
}
if (changed) /* don't bother if nothing substituted */
tem = make_string (buf, bufp - buf);
else
- tem = str;
+ tem = string;
xfree (buf);
UNGCPRO;
return tem;