all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca
Subject: Re: master 3b1fd42732f: * lisp/loadup.el: Check advice after `rmc.el`; turn error into warning
Date: Thu, 14 Dec 2023 00:03:16 +0100	[thread overview]
Message-ID: <cd9ed72a-5a66-41ac-a832-725aa96e487e@vodafonemail.de> (raw)
In-Reply-To: <83wmtis4tt.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

On 2023-12-13  12:46, Eli Zaretskii wrote:
>> Date: Tue, 12 Dec 2023 22:48:56 +0100
>> From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
>>
>> So probably TRT here would be to place these paragraphs as follows:
>>
>> 0. (load "leim/leim-list.el" t)
>>
>> 1. (load "emacs-lisp/rmc")
>>
>> 2. Check for advices (on core libs only).
>>
>> 3. (load "site-load" t)
>>
>> 4. "default-directory must be unibyte"
>>
>> What do you think?
> 
> I think you are right about rmc, but leim-list should be after rmc,
> not before.

Is rmc (technically) required at all in loadup.el?  I tried
bootstrap'ping and check'ing with the attached patch, and these come
through fine.

rmc.el provides autoloaded function `read-multiple-choice', which is
called from `kill-buffer--possibly-save' (defined in simple.el),
which is called from Fkill_buffer (defined in buffer.c), but only
during interactive use.

Of course, killing buffers is everyday business, but autoloading "rmc"
while prompting for user input should be neglectable, shouldn't it?
And during bootstrap everything should be noninteractive, so "rmc"
wouldn't be required at that time, would it?

And do I get a free wish from Eli when I help reducing preloaded libs?

[-- Attachment #2: 0001-Remove-preload-of-rmc-from-loadup.el.patch --]
[-- Type: text/x-patch, Size: 2764 bytes --]

From 9e81cf1c7ec547098ce7ada260b116a5242bde72 Mon Sep 17 00:00:00 2001
From: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Date: Wed, 13 Dec 2023 22:11:32 +0100
Subject: [PATCH] ; Remove preload of rmc from loadup.el

See discussion on
https://lists.gnu.org/archive/html/emacs-devel/2023-12/msg00309.html.

* lisp/loadup.el ("emacs-lisp/rmc"): Remove preload.
* lisp/files.el (read-multiple-choice):
* lisp/simple.el (read-multiple-choice): Declare function.
* lisp/loadup.el: Make the warning on advised preloaded functions a
tad noisier.
---
 lisp/files.el  | 3 +++
 lisp/loadup.el | 5 +----
 lisp/simple.el | 3 +++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index f87e7807301..4ee7614f99a 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2297,6 +2297,9 @@ files--ask-user-about-large-file-help-text
    op-type
    op-type))
 
+(declare-function read-multiple-choice "emacs-lisp/rmc"
+                  (prompt choices &optional help-string show-help long-form))
+
 (defun files--ask-user-about-large-file (size op-type filename offer-raw)
   "Query the user about what to do with large files.
 Files are \"large\" if file SIZE is larger than `large-file-warning-threshold'.
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 1f959464b23..de1934e9299 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -406,9 +406,6 @@
       (message "Warning: Change in load-path due to site-load will be \
 lost after dumping")))
 
-;; Used by `kill-buffer', for instance.
-(load "emacs-lisp/rmc")
-
 ;; Actively check for advised functions during preload since:
 ;; - advices in Emacs's core are generally considered bad style;
 ;; - `Snarf-documentation' looses docstrings of primitives advised
@@ -419,7 +416,7 @@
         ;; Don't make it an error because it's not serious enough and
         ;; it can be annoying during development.  Also there are still
         ;; circumstances where we use advice on preloaded functions.
-        (message "Warning: Advice installed on preloaded function %S" f))))
+        (message "\nWarning: Advice installed on preloaded function %S" f))))
 
 ;; Make sure default-directory is unibyte when dumping.  This is
 ;; because we cannot decode and encode it correctly (since the locale
diff --git a/lisp/simple.el b/lisp/simple.el
index cee1ddac52f..71cedd6cb17 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -11093,6 +11093,9 @@ scratch-buffer
   (interactive)
   (pop-to-buffer-same-window (get-scratch-buffer-create)))
 
+(declare-function read-multiple-choice "emacs-lisp/rmc"
+                  (prompt choices &optional help-string show-help long-form))
+
 (defun kill-buffer--possibly-save (buffer)
   "Ask the user to confirm killing of a modified BUFFER.
 
-- 
2.30.2


  reply	other threads:[~2023-12-13 23:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <170197287539.12661.7539324399514249195@vcs2.savannah.gnu.org>
     [not found] ` <20231207181435.BCB79C0C6AD@vcs2.savannah.gnu.org>
2023-12-12 21:48   ` master 3b1fd42732f: * lisp/loadup.el: Check advice after `rmc.el`; turn error into warning Jens Schmidt
2023-12-12 23:13     ` Stefan Monnier
2023-12-13 11:46     ` Eli Zaretskii
2023-12-13 23:03       ` Jens Schmidt [this message]
2023-12-14  7:23         ` Eli Zaretskii
2023-12-14 20:03           ` Jens Schmidt
2023-12-14 20:27             ` Eli Zaretskii
2023-12-14 21:21               ` Jens Schmidt
2023-12-16 13:07                 ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=cd9ed72a-5a66-41ac-a832-725aa96e487e@vodafonemail.de \
    --to=jschmidt4gnu@vodafonemail.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.