[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 20bb1dd9b8: Add update-directory-autoloads action to
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 20bb1dd9b8: Add update-directory-autoloads action to HFF |
Date: |
Wed, 26 Mar 2025 16:02:07 -0400 (EDT) |
branch: elpa/helm
commit 20bb1dd9b8272fb44c75987583f0c3dd7c70fbff
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Add update-directory-autoloads action to HFF
---
helm-files.el | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/helm-files.el b/helm-files.el
index c2286fa40c..d1478856fe 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -113,6 +113,7 @@
(defvar helm-fd-executable)
(defvar wfnames-buffer)
(defvar Info-current-file)
+(defvar generated-autoload-file)
;;; Internal vars
;;
@@ -4535,6 +4536,20 @@ Arg FILE is the real part of candidate, a filename with
no props."
(setq rep (make-string (/ count 2) ?!))
(replace-regexp-in-string "[!]+" rep (buffer-string)))))
+(defun helm-ff-update-directory-autoloads (_candidate)
+ "Action to update or create autoloads file in current directory."
+ (let ((default-directory helm-ff-default-directory)
+ (file
+ (read-file-name "Write autoload definitions to file: "
+ helm-ff-default-directory
+ nil nil nil
+ (lambda (f)
+ (string-match "autoloads\\|loaddefs" f)))))
+ (if (fboundp 'loaddefs-generate)
+ (loaddefs-generate default-directory file)
+ (let ((generated-autoload-file file))
+ (update-directory-autoloads default-directory)))))
+
(defun helm-find-files-action-transformer (actions candidate)
"Action transformer for `helm-source-find-files'."
(let ((str-at-point (with-helm-current-buffer
@@ -4589,7 +4604,8 @@ Arg FILE is the real part of candidate, a filename with
no props."
. ,(lambda (_)
(async-byte-recompile-directory
helm-ff-default-directory)))
- ("Load File(s) `M-L'" . helm-find-files-load-files))
+ ("Load File(s) `M-L'" . helm-find-files-load-files)
+ ("Update directory autoloads" .
helm-ff-update-directory-autoloads))
2))
((string-match (concat (regexp-opt load-suffixes) "\\'") candidate)
(helm-append-at-nth
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] elpa/helm 20bb1dd9b8: Add update-directory-autoloads action to HFF,
ELPA Syncer <=