emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speeding up Flymake in emacs-lisp-mode


From: Stefan Monnier
Subject: Re: Speeding up Flymake in emacs-lisp-mode
Date: Fri, 02 Nov 2018 08:08:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Which brings me to my question: is there a way to re-flash the current
> emacs's image with a brand new one, or to erase any side-effects of
> previous byte-compilations? The only pitfall would be that I would need
> server.el's bits to escape this reflashing otherwise I would be locked
> out.

There is no such thing, but you should be able to get some approximation
of it using the same approach I used on my "dump to .elc" attempts.

I.e. something like:

    (defun emacs-snapshot-get ()
      (let ((syms ()))
        (mapatoms
          (lambda (sym)
            (let ((ns (make-symbol (symbol-name sym))))
              (setf (symbol-function ns) (symbol-function sym))
              (setf (symbol-plist ns) (symbol-plist sym))
              (when (default-boundp sym)
                (setf (default-value ns) (default-value sym))))))
        syms))

    (defun emacs-snapshot-revert (snapshot)
      (dolist (sym snapshot)
        (let ((ns (intern (symbol-name sym))))
          (setf (symbol-function ns) (symbol-function sym))
          (setf (symbol-plist ns) (symbol-plist sym))
          (when (default-boundp sym)
            (setf (default-value ns) (default-value sym))))))

Of course, this may also just eat your lunch, so handle with care.


        Stefan "who was careful not to test it"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]