If it is an integer, use that position in the standard DOC file.
If it is (FILE . INTEGER), use FILE as the file name
and INTEGER as the position in that file.
- But if INTEGER is negative, make it positive.
- (A negative integer is used for user variables, so we can distinguish
- them without actually fetching the doc string.)
If the location does not point to the beginning of a docstring
(e.g. because the file has been modified and the location is stale),
else
return Qnil;
- EMACS_INT position = eabs (XFIXNUM (pos));
+ EMACS_INT position = XFIXNUM (pos);
if (!STRINGP (dir))
return Qnil;
P points beyond the data just read. */
p = get_doc_string_buffer;
- while (1)
+ while (true)
{
ptrdiff_t space_left = (get_doc_string_buffer_size - 1
- (p - get_doc_string_buffer));
the same file name is found in the `doc-directory'. */)
(Lisp_Object filename)
{
- doc_fd fd;
char buf[1024 + 1];
- int filled;
- EMACS_INT pos;
Lisp_Object sym;
char *p, *name;
char const *dirname;
Vbuild_files = Fpurecopy (Vbuild_files);
}
- fd = doc_open (name, O_RDONLY, 0);
+ doc_fd fd = doc_open (name, O_RDONLY, 0);
if (!doc_fd_p (fd))
{
int open_errno = errno;
record_unwind_protect_ptr (close_file_unwind_android_fd, &fd);
#endif /* !USE_ANDROID_ASSETS */
Vdoc_file_name = filename;
- filled = 0;
- pos = 0;
+ int filled = 0;
+ EMACS_INT pos = 0;
while (true)
{
if (filled < 512)
/* Attach a docstring to a variable? */
if (p[1] == 'V')
{
- /* Install file-position as variable-documentation property
- and make it negative for a user-variable
- (doc starts with a `*'). */
+ /* Install file-position as variable-documentation
+ property. */
if ((!NILP (Fboundp (sym))
|| !NILP (Fmemq (sym, delayed_init)))
&& strncmp (end, "\nSKIP", 5))
Fput (sym, Qvariable_documentation,
- make_fixnum ((pos + end + 1 - buf)
- * (end[1] == '*' ? -1 : 1)));
+ make_fixnum (pos + end + 1 - buf));
}
/* Attach a docstring to a function? */