Commit 1c0977a9 authored by Eli Zaretskii's avatar Eli Zaretskii

Add reveal-filename function instead of 3 set-generated-*-file funcs, as suggested by Glenn Morris.

parent 4cf86a2f
......@@ -164,21 +164,21 @@ $(lisp)/cus-load.el:
custom-deps: doit
cd $(lisp); $(setwins_almost); \
echo Directories: $$wins; \
$(emacs) -l cus-dep --eval '(set-generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins
$(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file (reveal-filename "$(lisp)/cus-load.el"))' -f custom-make-dependencies $$wins
$(lisp)/finder-inf.el:
$(MAKE) $(MFLAGS) finder-data
finder-data: doit
cd $(lisp); $(setwins_almost); \
echo Directories: $$wins; \
$(emacs) -l finder --eval '(set-generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins
$(emacs) -l finder --eval '(setq generated-finder-keywords-file (reveal-filename "$(lisp)/finder-inf.el"))' -f finder-compile-keywords-make-dist $$wins
# The chmod +w is to handle env var CVSREAD=1.
autoloads: $(LOADDEFS) doit
cd $(lisp) && chmod +w $(AUTOGEN_VCS)
cd $(lisp); $(setwins_almost); \
echo Directories: $$wins; \
$(emacs) -l autoload --eval '(set-generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
$(emacs) -l autoload --eval '(setq generated-autoload-file (reveal-filename "$(lisp)/loaddefs.el"))' -f batch-update-autoloads $$wins
# This is required by the bootstrap-emacs target in ../src/Makefile, so
# we know that if we have an emacs executable, we also have a subdirs.el.
......@@ -373,7 +373,7 @@ mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el
$(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
$(emacs) -l autoload \
--eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
--eval "(set-generated-autoload-file \"$@\")" \
--eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--eval "(setq make-backup-files nil)" \
-f batch-update-autoloads $(MH_E_DIR)
......@@ -391,7 +391,7 @@ TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-adb.el \
$(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC)
$(emacs) -l autoload \
--eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \
--eval "(set-generated-autoload-file \"$@\")" \
--eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--eval "(setq make-backup-files nil)" \
-f batch-update-autoloads $(TRAMP_DIR)
......@@ -413,21 +413,21 @@ CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el \
$(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
$(emacs) -l autoload \
--eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
--eval "(set-generated-autoload-file \"$@\")" \
--eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--eval "(setq make-backup-files nil)" \
-f batch-update-autoloads $(CAL_DIR)
$(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC)
$(emacs) -l autoload \
--eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
--eval "(set-generated-autoload-file \"$@\")" \
--eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--eval "(setq make-backup-files nil)" \
-f batch-update-autoloads $(CAL_DIR)
$(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC)
$(emacs) -l autoload \
--eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
--eval "(set-generated-autoload-file \"$@\")" \
--eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--eval "(setq make-backup-files nil)" \
-f batch-update-autoloads $(CAL_DIR)
......
......@@ -38,18 +38,6 @@ ldefs-boot\\|cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)"
(autoload 'autoload-rubric "autoload")
(defun set-generated-custom-dependencies-file (file)
"Set value of `generated-custom-dependencies-file' from FILE.
On systems other than MS-Windows, just sets the value
of `generated-custom-dependencies-file'. On MS-Windows, converts
/d/foo/bar form passed by MSYS Make into d:/foo/bar that Emacs can
grok. This function is called from lisp/Makefile."
(when (and (eq system-type 'windows-nt)
(string-match "\\`/[a-zA-Z]/" file))
(setq file (concat (substring file 1 2) ":" (substring file 2))))
(setq generated-custom-dependencies-file file))
(defun custom-make-dependencies ()
"Batch function to extract custom dependencies from .el files.
Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS"
......
......@@ -86,18 +86,6 @@ that text will be copied verbatim to `generated-autoload-file'.")
(defvar autoload-modified-buffers) ;Dynamically scoped var.
(defun set-generated-autoload-file (file)
"Set value of `generated-autoload-file' from FILE.
On systems other than MS-Windows, just sets the value
of `generated-autoload-file'. On MS-Windows, converts /d/foo/bar
form passed by MSYS Make into d:/foo/bar that Emacs can grok.
This function is called from lisp/Makefile."
(when (and (eq system-type 'windows-nt)
(string-match "\\`/[a-zA-Z]/" file))
(setq file (concat (substring file 1 2) ":" (substring file 2))))
(setq generated-autoload-file file))
(defun make-autoload (form file &optional expansion)
"Turn FORM into an autoload or defvar for source file FILE.
Returns nil if FORM is not a special autoload form (i.e. a function definition
......
......@@ -138,18 +138,6 @@ cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)"
(autoload 'autoload-rubric "autoload")
(defun set-generated-finder-keywords-file (file)
"Set value of `generated-finder-keywords-file' from FILE.
On systems other than MS-Windows, just sets the value
of `generated-finder-keywords-file'. On MS-Windows, converts
/d/foo/bar form passed by MSYS Make into d:/foo/bar that Emacs
can grok. This function is called from lisp/Makefile."
(when (and (eq system-type 'windows-nt)
(string-match "\\`/[a-zA-Z]/" file))
(setq file (concat (substring file 1 2) ":" (substring file 2))))
(setq generated-finder-keywords-file file))
(defvar finder--builtins-alist
'(("calc" . calc)
("ede" . ede)
......
......@@ -4655,4 +4655,20 @@ as alpha versions."
(prin1-to-string (make-hash-table)))))
(provide 'hashtable-print-readable))
;; This is used in lisp/Makefile.in to generate file names for
;; autoloads, custom-deps, and finder-data.
(defun reveal-filename (file)
"Produce the real file name for FILE.
On systems other than MS-Windows, just returns FILE.
On MS-Windows, converts /d/foo/bar form of file names
passed by MSYS Make into d:/foo/bar that Emacs can grok.
This function is called from lisp/Makefile."
(when (and (eq system-type 'windows-nt)
(string-match "\\`/[a-zA-Z]/" file))
(setq file (concat (substring file 1 2) ":" (substring file 2))))
file)
;;; subr.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment