* Re: [nongnu] elpa/git-commit 8b5d0b2bc6 1/2: Don’t try to evaluate startup assertions when byte-compiling
[not found] ` <20220318165808.45C11C01681@vcs2.savannah.gnu.org>
@ 2022-03-18 19:33 ` Stefan Monnier
0 siblings, 0 replies; only message in thread
From: Stefan Monnier @ 2022-03-18 19:33 UTC (permalink / raw)
To: emacs-devel; +Cc: Philipp Stephani
> --- a/lisp/magit.el
> +++ b/lisp/magit.el
> @@ -616,7 +616,7 @@ and Emacs to it."
> ;; See comment above.
> "https://github.com/magit/magit/wiki/Don't-set-$GIT_DIR-and-alike"))
> ;; Git isn't required while building Magit.
> - (cl-eval-when (load eval)
> + (unless byte-compile-current-file
> (magit-git-version-assert))
> (when (version< emacs-version magit--minimal-emacs)
> (display-warning 'magit (format "\
> @@ -672,10 +672,11 @@ For X11 something like ~/.xinitrc should work.\n"
> (with-eval-after-load 'bookmark
> (require 'magit-bookmark))
>
> -(if after-init-time
> - (progn (magit-startup-asserts)
> - (magit-version))
> - (add-hook 'after-init-hook #'magit-startup-asserts t)
> - (add-hook 'after-init-hook #'magit-version t))
> +(unless byte-compile-current-file
> + (if after-init-time
> + (progn (magit-startup-asserts)
> + (magit-version))
> + (add-hook 'after-init-hook #'magit-startup-asserts t)
> + (add-hook 'after-init-hook #'magit-version t)))
>
> ;;; magit.el ends here
BTW, the better way to do that is to move the checking code to
a function and call that function the first time Magit is used, rather
than run it when loading some file.
Stefan "loading a file should not have such side-effects"
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-18 19:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <164762268794.12821.8588776573613488178@vcs2.savannah.gnu.org>
[not found] ` <20220318165808.45C11C01681@vcs2.savannah.gnu.org>
2022-03-18 19:33 ` [nongnu] elpa/git-commit 8b5d0b2bc6 1/2: Don’t try to evaluate startup assertions when byte-compiling Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).