From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Too fine design granularity leads to numerous macro/function/command existed in Emacs. Date: Sat, 14 Aug 2021 14:29:38 +0800 Message-ID: References: <838s15dcwl.fsf@gnu.org> <83o8a0blby.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9283"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 14 08:30:29 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mEnBd-0002CY-Qv for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 08:30:29 +0200 Original-Received: from localhost ([::1]:56066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEnBc-0001Pz-QF for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 14 Aug 2021 02:30:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEnB4-0001Pr-KP for help-gnu-emacs@gnu.org; Sat, 14 Aug 2021 02:29:54 -0400 Original-Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:43896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEnB2-0004UP-Ur; Sat, 14 Aug 2021 02:29:54 -0400 Original-Received: by mail-lj1-x231.google.com with SMTP id x7so18957277ljn.10; Fri, 13 Aug 2021 23:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=10B5H/wERH1X3sCEXsACbe3wcfOXPR+5lntKWhAu4mo=; b=e1CrgpdhJfnAFkzRdXFhWnEdAl4Jcu4bJ/XXllSlB4p+CtMTfzqCeMvINalAfxGUr8 gqBiDDv7T9gUu6HbRzp1cWluZlYbfUrf1vnqrklPMEC2Nlfxe8bFH6/tW7l8XE53hMXH ezUItRhIkHsHmtjkPIiKshXmffp95cnLtB69PNS7S4UCyCr9+3cGjpd8E8HKmsiR/FIi txBlIUu00eA3ms6y30GV8vJiU8YBkuHGAEqnzOokSAcVc3do4gDF2Imi46IqHjZAXWUX hahtPkyWixEzV73RBb9Q+xanE1x+uRmafPm5HvT6q7lViQTY3bWvn0Rrjh1Gu3TWVao3 xNzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=10B5H/wERH1X3sCEXsACbe3wcfOXPR+5lntKWhAu4mo=; b=aEUse/7CETkv7g6g+QFtjikF5MCsMmvwC9zz79bX7KXsAVs5Y2EpjsAnbWZtS3qgvQ kxb1Ct3dpZqolfYv0qcuhzSsggkHmo9P9ozYGOW7skkPV75a8L0AsU4OluAuF6fTNoW/ jmZfNofhZ4JtMIeLno/dg4tBB8LsCkK/CNjyfd8p4NBJ/XoCKtZ3vnKWC16BK/pTYN2a 9FfNC3cwN6akwBmtQv2G2ZzIpTJRdXFXvQd5hhk8H0Q0SmuRTi0oSR1Dh2jriBte7guY AkGdI8KJuvqr8xNo5gg3YgRye8LC8RAeZ1oNYK8fj6f0AV9lal6vefjkFZCCXyVXbYoZ Z+mQ== X-Gm-Message-State: AOAM533C61tUWj8PIuhBX+aXIQWN0qbqj9wLTwPPnohnP5zZkcU5GuxF GWFeb+TRIalPZfT/ESLt59CWzVfu5By2bbvN4JZKc5h0GH7erXJWrhI= X-Google-Smtp-Source: ABdhPJx/jQHrxb4XRUdweBMDIjuCIiXhWsMbWeyN+COH6LXZ/TyK/Qi6m4Sjef4ElAKPAXtSP0faVpjV7Q2ck+W7lpc= X-Received: by 2002:a2e:bd0c:: with SMTP id n12mr4324455ljq.447.1628922590177; Fri, 13 Aug 2021 23:29:50 -0700 (PDT) In-Reply-To: <83o8a0blby.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=hongyi.zhao@gmail.com; helo=mail-lj1-x231.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:132532 Archived-At: On Sat, Aug 14, 2021 at 2:19 PM Eli Zaretskii wrote: > > > From: Hongyi Zhao > > Date: Sat, 14 Aug 2021 08:46:27 +0800 > > Cc: help-gnu-emacs > > > > > Specifically about the one example you provided: directory-files is a > > > primitive, written in C, so it provides the basic functionality of > > > fetching file names from a single directory. The > > > directory-files-recursively function is written in Lisp, it builds on > > > that primitive and provides extended functionality. > > > > Thank you for letting me know this difference, which I really didn't > > notice before. But there's still one question I don't understand: > > C is a compiled language, so how does the compilation and invocation > > of such C primitives work in Emacs? Are they compiled into libraries > > and called in real time? > > The low-level infrastructure of the Lisp machine IMO, by saying ``Lisp machine'', it always means the operating system is written in lisp, but this is obviously not the case of Emacs. > in Emacs is also written in C, and that includes the primitives used to call Lisp > functions. Those primitives have a special way of calling other > primitives written in C. Basically, a primitive written in C is > wrapped in a special 'subr' object that tells Emacs about this, and > then such primitives are called via the normal C mechanisms of calling > functions. > > For more details, I suggest to study the node "Writing Emacs > Primitives" in the ELisp manual. Thank you very much for your valuable comments. Hongyi