Subject: Re: bug#14120: invalid load-history in emacsen that CANNOT_DUMP

From: [email-masked] (Andrés Ramírez)
Date: Mon, 17 Feb 2020 13:34:51 +0000

Hi Stefan.

> FWIW, CANNOT_DUMP is a compilation option that is only meant to be used
> as a temporary measure.  It suffers from various shortcomings (other
> than the obvious startup cost).

> So before we start trying to fix them, I'd like to know why you need to
> use CANNOT_DUMP.

I use CANNOT_DUMP on a daily basis on emacs 23.4 (the best emacs for
poor machines. it renders very quick. I would like to profile It against
latest emacs which I also use) It was compiled on on November 13 2019. I have suffered
the same issue as Templeton. So probably I have done the same workaround
as Templeton. See my function below:
--8<---------------cut here---------------start------------->8---
      (defun load-history-filename-element (file-regexp)
        "Get the first elt of `load-history' whose car matches FILE-REGEXP.
Return nil if there isn't one.
NOTE2ME: UPDATE stringp condition cos of error on tramp"
        (let* ((loads load-history)
               (load-elt (and loads (car loads))))
          (save-match-data
            (while (and loads
                        (or (null (and (car load-elt) (stringp (car load-elt))))
                            (not (string-match file-regexp (car load-elt)))))
              (setq loads (cdr loads)
                    load-elt (and loads (car loads)))))
          load-elt))
--8<---------------cut here---------------end--------------->8---

I have not reported the bug because. Emacs23 is very old emacs. And Also
most of Emacs developers believe It cann't compile with glibc 2.30. But
thanks to Gentoo packagers It does (Those guys have backported most of
the changes needed for Emacs23 to compile[1]. I have also upgraded tramp
built-in version there to 2.3.1. On x86 it compiles really fine. But on
armv7h It needs the CANNOT_DUMP compilation option. Because of an issue with
glibc on compilation it cores-dump).

I am answering the email probably just for the record. A couple of years
ago I was compiling very old code from nantuncked clipper (dbase like Prg
program). And I had run emacs20 from within DOS on dosbox (an
emulator) At that time. Anyone never knows ;).

Best Regards
[1] https://gitweb.gentoo.org/repo/gentoo.git/plain/app-editors/emacs/emacs-23.4-r14.ebuild