From ad128fee434a954da2ead75647b6396ddbf91f6a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 13 Apr 2017 20:12:02 -0400 Subject: [PATCH] Create generated lisp files before main loaddefs.el This should improve reproducibility of lisp/loaddefs.el. * lisp/Makefile.in (gen-lisp): New phony target. ($(lisp)/loaddefs.el, compile-main): Depend on gen-lisp. * src/Makefile.in ($(leimdir)/leim-list.el): Depend on all of ../leim. * lisp/cedet/semantic.el (semantic-mode): * lisp/cedet/semantic/fw.el (top-level): * lisp/emacs-lisp/eieio-core.el (top-level): Robustify to generated input files maybe not yet existing. --- lisp/Makefile.in | 13 ++++++++++--- lisp/cedet/semantic.el | 7 ++++--- lisp/cedet/semantic/fw.el | 2 +- lisp/emacs-lisp/eieio-core.el | 2 +- src/Makefile.in | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lisp/Makefile.in b/lisp/Makefile.in index ec9ea16021e..b82f2c6918a 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -179,6 +179,10 @@ $(lisp)/finder-inf.el: # Note that we set no-update-autoloads in _generated_ leim files. # If you want to allow autoloads in such files, remove that, # and make this depend on leim. +# Actually this should depend on leim anyway, since no-update-autoloads +# files are still recorded in loaddefs. So we should ensure +# that all input files are generated before we create loaddefs. +# Otherwise making loaddefs again will change the output. # # Write to a temporary file in case we're doing a parallel build and a # CANNOT_DUMP-mode Emacs needs to read loaddefs at startup. @@ -192,7 +196,7 @@ $(lisp)/finder-inf.el: # slow; starting from an almost-correct content will enable the "only # update where necessary" feature of batch-update-autoloads. autoloads .PHONY: $(lisp)/loaddefs.el -$(lisp)/loaddefs.el: $(LOADDEFS) +$(lisp)/loaddefs.el: gen-lisp $(LOADDEFS) @echo Directories for loaddefs: ${SUBDIRS_ALMOST} @if test -f $@ ; then cp $@ $(lisp)/loaddefs.tmp ; fi $(AM_V_GEN)$(emacs) -l autoload \ @@ -319,7 +323,7 @@ compile-targets: $(TARGETS) # Compile all the Elisp files that need it. Beware: it approximates # 'no-byte-compile', so watch out for false-positives! -compile-main: leim semantic compile-clean +compile-main: gen-lisp compile-clean @(cd $(lisp) && \ els=`echo "${SUBDIRS_REL} " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ for el in $$els; do \ @@ -343,7 +347,10 @@ compile-clean: fi \ done -.PHONY: leim semantic +.PHONY: gen-lisp leim semantic + +gen-lisp: leim semantic + leim: $(MAKE) -C ../leim all EMACS="$(EMACS)" diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el index 6a264cabd65..c38afed3964 100644 --- a/lisp/cedet/semantic.el +++ b/lisp/cedet/semantic.el @@ -1116,8 +1116,9 @@ Semantic mode. ;; Enable all the global auxiliary minor modes in ;; `semantic-submode-list'. (dolist (mode semantic-submode-list) - (if (memq mode semantic-default-submodes) - (funcall mode 1))) + (and (memq mode semantic-default-submodes) + (fboundp mode) + (funcall mode 1))) (unless semantic-load-system-cache-loaded (setq semantic-load-system-cache-loaded t) (when (and (boundp 'semanticdb-default-system-save-directory) @@ -1139,7 +1140,7 @@ Semantic mode. (add-hook 'completion-at-point-functions 'semantic-analyze-completion-at-point-function) - (if global-ede-mode + (if (bound-and-true-p global-ede-mode) (define-key cedet-menu-map [cedet-menu-separator] '("--"))) (dolist (b (buffer-list)) (with-current-buffer b diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el index 3884cd09ccc..3527f3e6af8 100644 --- a/lisp/cedet/semantic/fw.el +++ b/lisp/cedet/semantic/fw.el @@ -30,7 +30,7 @@ ;; (require 'mode-local) (require 'eieio) -(load "semantic/loaddefs" nil 'nomessage) +(load "semantic/loaddefs" 'noerror 'nomessage) ;;; Compatibility ;; diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index c59f85d6fb2..7c149421d43 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -33,7 +33,7 @@ (require 'cl-lib) (require 'pcase) -(require 'eieio-loaddefs) +(require 'eieio-loaddefs nil t) ;;; ;; A few functions that are better in the official EIEIO src, but diff --git a/src/Makefile.in b/src/Makefile.in index 7890ea9878e..0b0d1768b5c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -495,7 +495,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ $(NOTIFY_LIBS) $(LIB_MATH) $(LIBZ) $(LIBMODULES) $(LIBSYSTEMD_LIBS) $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT) - $(MAKE) -C ../leim leim-list.el EMACS="$(bootstrap_exe)" + $(MAKE) -C ../leim all EMACS="$(bootstrap_exe)" ## FORCE it so that admin/unidata can decide whether these files ## are up-to-date. Although since charprop depends on bootstrap-emacs, -- 2.39.2