From d04731b5885957150b54efaa40fdf712b30170ff Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 16 Mar 2023 09:40:02 +0800 Subject: [PATCH] Update Android port * lisp/loadup.el (current-load-list): Set to empty load list after startup. * src/lread.c (build_load_history): Revert earlier changes. --- lisp/loadup.el | 7 +++++++ src/lread.c | 14 +++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lisp/loadup.el b/lisp/loadup.el index 47565f809af..15267cca3be 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -666,6 +666,13 @@ lost after dumping"))) (setq load-file-name nil) (eval top-level t) +;; loadup.el is loaded at startup, but clobbers current-load-list. +;; Set current-load-list to a list containing no definitions and only +;; its name, to prevent invalid entries from ending up in +;; Vload_history when running temacs interactively. + +(setq current-load-list (list "loadup.el")) + ;; Local Variables: ;; no-byte-compile: t diff --git a/src/lread.c b/src/lread.c index c29c7ede6ac..fe48e614393 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2317,7 +2317,7 @@ static void build_load_history (Lisp_Object filename, bool entire) { Lisp_Object tail, prev, newelt; - Lisp_Object tem, tem2, association; + Lisp_Object tem, tem2; bool foundit = 0; tail = Vload_history; @@ -2366,16 +2366,8 @@ build_load_history (Lisp_Object filename, bool entire) front of load-history, the most-recently-loaded position. Also do this if we didn't find an existing member for the file. */ if (entire || !foundit) - { - association = Fnreverse (Vcurrent_load_list); - - if (!NILP (association) && STRINGP (XCAR (association))) - /* readevalloop can be called with SOURCENAME set to some - nonsense value, meaning the car of ASSOCIATION will be nil - (or worse something else), leading to an invalid - Vload_history. Ignore such invalid entries. */ - Vload_history = Fcons (association, Vload_history); - } + Vload_history = Fcons (Fnreverse (Vcurrent_load_list), + Vload_history); } static void -- 2.39.2