From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.devel Subject: Re: How does Emacs load a non-existent .el file? Date: Fri, 01 Mar 2024 16:30:07 +0300 Message-ID: <3787c36325de4bcfbd7084d3a581c4de3157fc8c.camel@yandex.ru> References: <0036123ac52383e6a4dc7bc3d76ec2941168b011.camel@yandex.ru> <86r0guqgyt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2360"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.50.4 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 01 14:31:16 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 1rg2yq-0000Q3-Ee for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Mar 2024 14:31:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rg2y0-00051e-IQ; Fri, 01 Mar 2024 08:30:28 -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 1rg2xx-0004vs-5Z for emacs-devel@gnu.org; Fri, 01 Mar 2024 08:30:21 -0500 Original-Received: from forward502a.mail.yandex.net ([2a02:6b8:c0e:500:1:45:d181:d502]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rg2xq-00025u-C2; Fri, 01 Mar 2024 08:30:20 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net [IPv6:2a02:6b8:c1f:1492:0:640:cd24:0]) by forward502a.mail.yandex.net (Yandex) with ESMTPS id 2C80C61673; Fri, 1 Mar 2024 16:30:08 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 7UbS95AXn0U0-fFxyh0cu; Fri, 01 Mar 2024 16:30:07 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1709299807; bh=coitgFyRbCzfEgY9HEZvvbETYwUAFeQxuhR2UPaJK1A=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=gzdszZjp/11xOimWAeBW/X7VYTCCtYrM6ax29V5HBw6FdfDHwqQA2gsVqeGsyLe7f jwn2kXmSxntJcPug4UQomwgtP6ctCKMqF94t7B1ixedfXNAMthJlnoKVaO+2tdWiGn 2YnP9vMIUZjYz9NvI3KO129u35JKdFboQFq+1Eio= Authentication-Results: mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: <86r0guqgyt.fsf@gnu.org> Received-SPF: pass client-ip=2a02:6b8:c0e:500:1:45:d181:d502; envelope-from=Hi-Angel@yandex.ru; helo=forward502a.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:316658 Archived-At: On Fri, 2024-03-01 at 14:22 +0200, Eli Zaretskii wrote: > > From: Konstantin Kharlamov > > Date: Fri, 01 Mar 2024 13:52:30 +0300 > >=20 > > I was just looking whether it's too hard to add an option for > > reading > > from stdin (a very requested feature=C2=B9). Long story short, I presum= e > > 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! > >=20 > > 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. > >=20 > > I am thoroughly confused. Any idea what's going on here? >=20 > Yes: startup.el is preloaded, see lisp/loadup.el.=C2=A0 So if you change > it, you need to rebuild Emacs to let the changes have their effect at > startup.=C2=A0 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. Okay, I see, so the `startup.el` is a dummy file that's not being read. I wonder if it's too hard to add to `*Help*` buffer mention that certain functions are not being read from the file where the buffer claims that they reside. > > https://superuser.com/questions/31404/how-to-make-emacs-read-buffer-fro= m-stdin-on-start >=20 > There are a few answers there that solve the problem, so I'm not sure > what else are you trying to do, and why. I see only one answer that is more or less convenient, which is `emacs --insert <(echo 123)`. The problem with this one is that `--insert` is not supported in `emacsclient`; and in the context of the problem such support would be useless anyway because it would make `emacsclient` paste the text to a random buffer which is not at all something a user expects. The rest of answers require jumping through the hoops with either writing separate scripts or using a temporary file. I agree with the opinion of one of the commenters here: this is absolutely basic feature that most editors have. Not having it in Emacs is very strange.