unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Requiring elisp that comes with Emacs
Date: Wed, 01 Feb 2017 07:53:58 -0800	[thread overview]
Message-ID: <87mve5uctl.fsf@pellet> (raw)
In-Reply-To: 87k29bl4v0.fsf@gmail.com

Narendra Joshi <narendraj9@gmail.com> writes:

> Skip Montanaro <skip.montanaro@gmail.com> writes:
>
>> On Mon, Jan 30, 2017 at 10:52 AM, Narendra Joshi <
>> narendraj9@gmail.com> wrote:
>>
>>     What happens when we do `require'?
>>
>>
>> It guarantees the relevant feature is available, generally as a side
>> effect of loading the named package. I believe the package much
>> "provide" its name. If not found, an error is raised. Full details
>> can be found here:
>>
>> https://www.gnu.org/software/emacs/manual/html_node/elisp/
>> Named-Features.html
>
> My question was more about whether we need to `require` packages that
> come with Emacs itself, e.g. org-mode.

Practically speaking, every package that come with Emacs will provide
autoload statements for all the common entrypoint functions. Calling
`require' will instantly load all the package's code, and all the
packages it requires. Autoload, on the other hand, will leave the
package unloaded, but load it automatically the first time you use an
autoload'ed function. Most of the time, that's all you need.

Eric




      parent reply	other threads:[~2017-02-01 15:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 16:52 Requiring elisp that comes with Emacs Narendra Joshi
2017-01-30 18:50 ` Skip Montanaro
2017-01-31 13:46   ` Narendra Joshi
2017-01-31 14:39     ` Óscar Fuentes
2017-01-31 18:06       ` Skip Montanaro
2017-01-31 20:03         ` Óscar Fuentes
2017-01-31 14:50     ` Skip Montanaro
2017-01-31 20:01       ` Narendra Joshi
2017-01-31 20:40         ` Skip Montanaro
2017-02-01 10:07           ` hector
2017-02-01 15:10           ` Narendra Joshi
2017-02-01 15:53     ` Eric Abrahamsen [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87mve5uctl.fsf@pellet \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).