[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 06562ab 1/3: Fix and use make-directory-autol
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 06562ab 1/3: Fix and use make-directory-autoloads in Emacs 27 |
Date: |
Sat, 15 May 2021 12:57:09 -0400 (EDT) |
branch: externals/hyperbole
commit 06562abcc4e587aa9b9696b11f9e07f26d4dbe19
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
Fix and use make-directory-autoloads in Emacs 27
---
Makefile | 4 ++--
hyperbole.el | 24 +++++++++++++++++-------
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index fd0a92b..a2f2f80 100644
--- a/Makefile
+++ b/Makefile
@@ -337,10 +337,10 @@ ftp: package $(pkg_dir)/hyperbole-$(HYPB_VERSION).tar.gz
autoloads: hyperbole-autoloads.el kotl/kotl-autoloads.el
hyperbole-autoloads.el: $(EL_COMPILE)
- $(EMACS) $(BATCHFLAGS) --debug --eval "(progn (setq
generated-autoload-file (expand-file-name \"hyperbole-autoloads.el\")
backup-inhibited t) (update-directory-autoloads \".\"))"
+ $(EMACS) $(BATCHFLAGS) $(PRELOADS) --debug --eval "(progn (setq
generated-autoload-file (expand-file-name \"hyperbole-autoloads.el\")
backup-inhibited t) (make-directory-autoloads \".\" generated-autoload-file))"
kotl/kotl-autoloads.el: $(EL_KOTL)
- $(EMACS) $(BATCHFLAGS) --eval "(progn (setq generated-autoload-file
(expand-file-name \"kotl/kotl-autoloads.el\") backup-inhibited t)
(update-directory-autoloads \"kotl/\"))"
+ $(EMACS) $(BATCHFLAGS) $(PRELOADS) --eval "(progn (setq
generated-autoload-file (expand-file-name \"kotl/kotl-autoloads.el\")
backup-inhibited t) (make-directory-autoloads \"kotl/\"
generated-autoload-file))"
# Used for ftp.gnu.org tarball distributions.
$(pkg_dir)/hyperbole-$(HYPB_VERSION).tar.gz:
diff --git a/hyperbole.el b/hyperbole.el
index b21d4ad..71bd08b 100644
--- a/hyperbole.el
+++ b/hyperbole.el
@@ -410,9 +410,21 @@ frame, those functions by default still return the prior
frame."
;;; ************************************************************************
;; New autoload generation function defined only in Emacs 28
-;; (unless (fboundp #'make-directory-autoloads)
-;; ;; Don't use defalias on next line; causes a failure
-;; (fset 'make-directory-autoloads 'update-directory-autoloads))
+(unless (fboundp #'make-directory-autoloads)
+ (defun make-directory-autoloads (dir output-file)
+ "Update autoload definitions for Lisp files in the directories DIRS.
+DIR can be either a single directory or a list of
+directories. (The latter usage is discouraged.)
+
+The autoloads will be written to OUTPUT-FILE. If any Lisp file
+binds ‘generated-autoload-file’ as a file-local variable, write
+its autoloads into the specified file instead.
+
+The function does NOT recursively descend into subdirectories of the
+directory or directories specified."
+ ;; Don't use a 'let' on this next line or it will fail.
+ (setq generated-autoload-file output-file)
+ (update-directory-autoloads dir)))
;; Koutliner autoloads in the kotl/ subdirectory are generated by 'make pkg'.
;; This next line ensures they are loaded by hyperbole-autoloads whenever
@@ -674,12 +686,10 @@ This is used only when running from git source and not a
package release."
(al-file (expand-file-name "hyperbole-autoloads.el")))
;; (make-local-variable 'generated-autoload-file)
(with-current-buffer (find-file-noselect al-file)
- (setq generated-autoload-file al-file)
- (update-directory-autoloads "."))
+ (make-directory-autoloads "." al-file))
(setq al-file (expand-file-name "kotl/kotl-autoloads.el"))
(with-current-buffer (find-file-noselect al-file)
- (setq generated-autoload-file al-file)
- (update-directory-autoloads ".")))
+ (make-directory-autoloads "." al-file)))
(unless (hyperb:autoloads-exist-p)
(error (format "Hyperbole failed to generate autoload files; try running
'make src' in a shell in %s" hyperb:dir))))