all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Doc strings starting with a line break
Date: Sun, 18 Sep 2016 11:58:23 -0400	[thread overview]
Message-ID: <jwvd1k1jjhd.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: CAPM58ogXOkqURAEtTpUFA3EV+YB2pWgG85WuFWHkKvCuZrtxaQ@mail.gmail.com

>> i am wondering what could be the reason for some doc strings
>> starting with a break line.
>> For instance, see `isearch-forward' or `looking-at-p'.

> The newline is escaped so it's not part of the docstring. For
> `looking-at-p' it allows the following line of code to fit into 80
> characters. For `isearch-forward' it seems unnecessary but it
> has been that way for 24 years. They do things differently
> there :)

There's a special hack in the Lisp reader which reads such strings as
the constant 0 (under some circumstances) so that we don't allocate
memory for those strings which will soon after be replaced by
a reference to some part of the DOC file (via Snarf-documentation).

This memory could/would be recovered by GC, so it wouldn't be completely
wasted, but it usually wouldn't be returned to the OS (IOW it would stay
in the free-list of Elisp's memory manager), so it would result in
a slightly larger bin/emacs executable and initial memory footprint
(unless we replace this current hack by some other mechanism, obviously).


        Stefan




  parent reply	other threads:[~2016-09-18 15:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-18 10:51 Doc strings starting with a line break Tino Calancha
2016-09-18 11:06 ` Richard Copley
2016-09-18 11:18   ` Tino Calancha
2016-09-18 15:58   ` Stefan Monnier [this message]
2016-09-18 16:59     ` Andreas Schwab
2016-09-19  1:06       ` Stefan Monnier
2016-09-18 12:27 ` Andreas Schwab
2016-09-18 12:29   ` Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd1k1jjhd.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.