From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How does Emacs load a non-existent .el file? Date: Fri, 01 Mar 2024 14:22:50 +0200 Message-ID: <86r0guqgyt.fsf@gnu.org> References: <0036123ac52383e6a4dc7bc3d76ec2941168b011.camel@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1607"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Konstantin Kharlamov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 01 13:23:44 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rg1vT-0000AX-Tv for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Mar 2024 13:23:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rg1uk-0004sp-EH; Fri, 01 Mar 2024 07:22:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rg1ui-0004sM-Er for emacs-devel@gnu.org; Fri, 01 Mar 2024 07:22:56 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rg1uh-0004ep-Uw; Fri, 01 Mar 2024 07:22:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=O8hHV3PJ5S1Z0ftRdslA2cjLiYnCS3HbVVjT6hVcZ7I=; b=XGTvW0WYTYElKefaVrBw KNcb1GHYGJhqDcbIWcjuMIFfgXjqPSPtaCbCeQB7cRxRgAFhQslyvMaYbzUsuFalE6DNWG1x19pFw 6rhaU3T25hsrvdLMa66kKhOZpmsGJR/Lr2gjkvsTRw8LsyxSCKHEeOn2cVf48ktIRIo2UmOvdkxJY i9tlhugIPTiQdwg3W10U9KOxuxUQcNGPIx+O2/naVnk0ieq+eaaTRDIkjn8TMqh2DxBgyK/10rQli yRHbPiGBq/zi/zwlnhIBjJVye7v7MPOG7gQdyxKJYUVEx2yTqO9GR8ULoAEqmU6D6yDe+c1wbEsqr gwiXIjiN1hSXQg==; In-Reply-To: <0036123ac52383e6a4dc7bc3d76ec2941168b011.camel@yandex.ru> (message from Konstantin Kharlamov on Fri, 01 Mar 2024 13:52:30 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316657 Archived-At: > From: Konstantin Kharlamov > Date: Fri, 01 Mar 2024 13:52:30 +0300 > > I was just looking whether it's too hard to add an option for reading > from stdin (a very requested featureĀ¹). Long story short, I presume > command line parsing happens in `lisp/startup.el`, function `(command- > line-1)`. That's where the weirdness starts. Since it is an ELisp file, > I figured to avoid recompiling I can move its `.elc` file out of the > way and just do edits to `startup.el` directly. Turned out though, not > only Emacs does not notice these edits, it somehow manages to load the > file when it does not exist! > > So e.g. I did a `sudo rm /usr/share/emacs/30.0.50/lisp/startup*`, so no > .el or elc files. But starting up `emacs -Q` and asking it `C-h f > command-line-1` still results in Emacs answering that such function > exists, except the help buffer doesn't have a link to it. > > I am thoroughly confused. Any idea what's going on here? Yes: startup.el is preloaded, see lisp/loadup.el. So if you change it, you need to rebuild Emacs to let the changes have their effect at startup. You can also load startup.el manually into a running session, and then invoke functions you've changed, but that will only be useful if what you are changing is not some special behavior that happens only at startup. > https://superuser.com/questions/31404/how-to-make-emacs-read-buffer-from-stdin-on-start There are a few answers there that solve the problem, so I'm not sure what else are you trying to do, and why.