branch: elpa/helm commit 6bf5f5a20f062ce56312044e972bf49f457578dc Author: Thierry Volpiatto <thie...@posteo.net> Commit: Thierry Volpiatto <thie...@posteo.net>
Move helm-locate-lib-get-summary to helm-lib --- helm-elisp.el | 22 +--------------------- helm-lib.el | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/helm-elisp.el b/helm-elisp.el index fc0ec9ceef..a9c0377050 100644 --- a/helm-elisp.el +++ b/helm-elisp.el @@ -906,7 +906,7 @@ a string, i.e. the `symbol-name' of any existing symbol." (defvar helm-locate-library-doc-cache (make-hash-table :test 'equal)) (defun helm-locate-library-scan-list () (cl-loop for dir in load-path - with load-suffixes = (find-library-suffixes);'(".el") + with load-suffixes = (find-library-suffixes) when (file-directory-p dir) nconc (directory-files dir nil (concat (regexp-opt (get-load-suffixes)) "\\'")))) @@ -942,26 +942,6 @@ a string, i.e. the `symbol-name' of any existing symbol." :action (helm-actions-from-type-file)) :buffer "*helm locate library*")) -(defun helm-locate-lib-get-summary (file) - (let* ((shell-file-name "sh") - (shell-command-switch "-c") - (cmd "%s %s | head -n1 | awk 'match($0,\"%s\",a) {print a[2]}'\ - | awk -F ' -*-' '{print $1}'") - (regexp "^;;;(.*) --- (.*)$") - (output (replace-regexp-in-string - "\n" "" - (with-temp-buffer - (call-process-shell-command - (format cmd - (if (string-suffix-p ".gz" file) - "gzip -c -q -d" "cat") - (shell-quote-argument file) - regexp) - nil t nil) - (buffer-string))))) - (if (string= output "") - "Not documented" - output))) ;;; Modify variables from Helm ;; diff --git a/helm-lib.el b/helm-lib.el index 34e61b870c..b076faadff 100644 --- a/helm-lib.el +++ b/helm-lib.el @@ -1719,6 +1719,27 @@ Directories expansion is not supported." (format ".*\\.\\(%s\\)$" (replace-regexp-in-string "," "\\\\|" (match-string 2 wc))))) + +(defun helm-locate-lib-get-summary (file) + (let* ((shell-file-name "sh") + (shell-command-switch "-c") + (cmd "%s %s | head -n1 | awk 'match($0,\"%s\",a) {print a[2]}'\ + | awk -F ' -*-' '{print $1}'") + (regexp "^;;;(.*) --- (.*)$") + (output (replace-regexp-in-string + "\n" "" + (with-temp-buffer + (call-process-shell-command + (format cmd + (if (string-suffix-p ".gz" file) + "gzip -c -q -d" "cat") + (shell-quote-argument file) + regexp) + nil t nil) + (buffer-string))))) + (if (string= output "") + "Not documented" + output))) ;;; helm internals ;;