From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Narendra Joshi Newsgroups: gmane.emacs.help Subject: Re: Requiring elisp that comes with Emacs Date: Tue, 31 Jan 2017 19:16:11 +0530 Message-ID: <87k29bl4v0.fsf@gmail.com> References: <874m0gv6ba.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485871933 22301 195.159.176.226 (31 Jan 2017 14:12:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2017 14:12:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Skip Montanaro Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 31 15:12:08 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYZAG-0005et-In for geh-help-gnu-emacs@m.gmane.org; Tue, 31 Jan 2017 15:12:08 +0100 Original-Received: from localhost ([::1]:38416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYZAL-00051L-W7 for geh-help-gnu-emacs@m.gmane.org; Tue, 31 Jan 2017 09:12:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYYh6-00034t-E1 for help-gnu-emacs@gnu.org; Tue, 31 Jan 2017 08:42:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYYh1-0005wx-Gw for help-gnu-emacs@gnu.org; Tue, 31 Jan 2017 08:42:00 -0500 Original-Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:33065) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cYYh1-0005wR-Bn for help-gnu-emacs@gnu.org; Tue, 31 Jan 2017 08:41:55 -0500 Original-Received: by mail-pf0-x242.google.com with SMTP id e4so27855741pfg.0 for ; Tue, 31 Jan 2017 05:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=jf6qOXV0FKEDAnEzfa8ZPMEv5unPfOak+qaq1dv3pFw=; b=V+cyscycd8OtfXpHCeanMhECOgYQAeqOSxW+h5VqZFHrvuDYun0mtGexS6lYDq0e5R noqNY2OAFquFtGrWfvPPeKo8NVewCDiqxtQsLOpYmc123W92Bnc8uqEi0SNgTYd3BUlm C+dVNZF0emGpM6W46nDcOPzirOcqOxo8pCYpruhLZao4FqRvPQQwLDVKvJK9hHRs1tZP B0ReZupkMkVdH4L/2OEc94bxeL5J0ggYCgEVquncY8FcYKtuxW1Z5nQWefJJZjSbR64w 9bBBueZ9CnM5TFH1wHfkcwlXU80ddn4qMSx0I3YxmdRWWzgqGZsSxESA8ZudUoXeEO0h EoVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=jf6qOXV0FKEDAnEzfa8ZPMEv5unPfOak+qaq1dv3pFw=; b=srIN7WgrT8vfGCcxDbREYChXmqqOGeu5W/bbmjBM+2qrkWJ7Hh2WKWobeKWM1VoOrL jo42DoTrGOeFEuy1XPj6lgW8n3YO/AjyIvm8UinYgmjABzYftX+50mqjhwqiF4acJ1bK Pa4Oxd25q1QnUwpms0QJIDOo+gkqZZlulp2HvPHCggVH4RL7L5krSyuqS1P/2IjnSn9x XpHaiofxfMdZDT/XGg1t9kP/5A128sEy1ozLwCBgcVUr7rh4eO5e2ZKftYmqc81F7KcX CtToN30aEwbWyxmM1t+Zgo4MLDTY8X4XqANSy04gVxQo0hJDd1qrwklGClcQc5dFo0SA 9ISw== X-Gm-Message-State: AIkVDXLtg7JOVAuXyBotUdVd+SL2RIcsTmxVb99zdAxuCfeKUCOX8K0a9eOdXvh23xXvrg== X-Received: by 10.84.199.194 with SMTP id d2mr39922192plh.134.1485870114291; Tue, 31 Jan 2017 05:41:54 -0800 (PST) Original-Received: from vicarie ([182.70.100.223]) by smtp.gmail.com with ESMTPSA id w25sm41683992pge.9.2017.01.31.05.41.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Jan 2017 05:41:53 -0800 (PST) In-Reply-To: (Skip Montanaro's message of "Mon, 30 Jan 2017 12:50:58 -0600") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::242 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112210 Archived-At: Skip Montanaro 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. > > While under the covers I imagine the implementation is much > different, I my mental model is similar to Python's import statement > or C++'s namespace statement. All three make a series of names > available to you, though require is a global operation, not local to > a particular module or translation unit. I think every file in the `load-path' would need to be read for a (provide 'something) at the end while trying to (require 'something). Languages that make sure that the name of the module is the same as the name of the file do not have to look inside the file. This is all speculation and I do not know how exactly things are done in reality. Narendra