From cf6e1d8fe514c485d2e1b1b4f82fce84a5a71f57 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 21 May 2025 14:44:58 +0200 Subject: [PATCH] update helm --- bba.org | 2 +- .../emacs-helm.sh | 2 +- .../helm-adaptive.el | 2 +- .../helm-autoloads.el | 84 ++- .../helm-bookmark.el | 114 ++- .../helm-buffers.el | 108 ++- .../helm-color.el | 12 +- .../helm-command.el | 39 +- .../helm-dabbrev.el | 2 +- .../helm-easymenu.el | 2 +- .../helm-elisp.el | 113 +-- .../helm-epa.el | 24 +- .../helm-eshell.el | 2 +- .../helm-eval.el | 32 +- .../helm-external.el | 4 +- .../helm-fd.el | 11 +- .../helm-files.el | 666 +++++++++++------- .../helm-find.el | 35 +- .../helm-font.el | 14 +- .../helm-for-files.el | 123 +++- .../helm-global-bindings.el | 2 +- .../helm-grep.el | 19 +- .../helm-help.el | 138 ++-- .../helm-id-utils.el | 2 +- .../helm-imenu.el | 166 ++--- .../helm-info.el | 95 ++- .../helm-locate.el | 100 ++- .../helm-man.el | 2 +- .../helm-misc.el | 73 +- .../helm-mode.el | 397 ++++++++--- .../helm-net.el | 41 +- .../helm-occur.el | 10 +- .../helm-packages.el | 31 +- .../helm-pkg.el | 10 +- .../helm-regexp.el | 2 +- .../helm-ring.el | 4 +- .../helm-semantic.el | 0 .../helm-sys.el | 42 +- .../helm-tags.el | 2 +- .../helm-types.el | 39 +- .../helm-utils.el | 7 +- .../helm-x-files.el | 2 +- elpa/helm-20250515.548/helm-x-icons.el | 161 +++++ .../helm.el | 8 +- .../helm-core-autoloads.el | 13 + .../helm-core-pkg.el | 10 +- .../helm-core.el | 170 +++-- .../helm-lib.el | 248 +++---- .../helm-multi-match.el | 4 +- .../helm-source.el | 20 +- .../helm-descbinds-autoloads.el | 0 .../helm-descbinds-pkg.el | 6 +- .../helm-descbinds.el | 7 +- elpa/helm-org-20240922.603/helm-org-pkg.el | 10 - .../helm-org-autoloads.el | 0 elpa/helm-org-20250405.1720/helm-org-pkg.el | 10 + .../helm-org.el | 22 +- .../helm-projectile-autoloads.el | 2 + .../helm-projectile-pkg.el | 10 +- .../helm-projectile.el | 183 +++-- 60 files changed, 2224 insertions(+), 1235 deletions(-) rename elpa/{helm-20241224.1937 => helm-20250515.548}/emacs-helm.sh (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-adaptive.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-autoloads.el (92%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-bookmark.el (91%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-buffers.el (93%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-color.el (94%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-command.el (90%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-dabbrev.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-easymenu.el (98%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-elisp.el (92%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-epa.el (95%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-eshell.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-eval.el (87%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-external.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-fd.el (92%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-files.el (93%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-find.el (82%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-font.el (96%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-for-files.el (68%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-global-bindings.el (98%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-grep.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-help.el (95%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-id-utils.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-imenu.el (76%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-info.el (75%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-locate.el (85%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-man.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-misc.el (87%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-mode.el (89%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-net.el (93%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-occur.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-packages.el (95%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-pkg.el (66%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-regexp.el (98%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-ring.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-semantic.el (100%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-sys.el (92%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-tags.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-types.el (91%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-utils.el (99%) rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm-x-files.el (99%) create mode 100644 elpa/helm-20250515.548/helm-x-icons.el rename elpa/{helm-20241224.1937 => helm-20250515.548}/helm.el (91%) rename elpa/{helm-core-20241225.641 => helm-core-20250514.1025}/helm-core-autoloads.el (93%) rename elpa/{helm-core-20241225.641 => helm-core-20250514.1025}/helm-core-pkg.el (54%) rename elpa/{helm-core-20241225.641 => helm-core-20250514.1025}/helm-core.el (98%) rename elpa/{helm-core-20241225.641 => helm-core-20250514.1025}/helm-lib.el (92%) rename elpa/{helm-core-20241225.641 => helm-core-20250514.1025}/helm-multi-match.el (99%) rename elpa/{helm-core-20241225.641 => helm-core-20250514.1025}/helm-source.el (99%) rename elpa/{helm-descbinds-20240216.1154 => helm-descbinds-20250204.451}/helm-descbinds-autoloads.el (100%) rename elpa/{helm-descbinds-20240216.1154 => helm-descbinds-20250204.451}/helm-descbinds-pkg.el (71%) rename elpa/{helm-descbinds-20240216.1154 => helm-descbinds-20250204.451}/helm-descbinds.el (98%) delete mode 100644 elpa/helm-org-20240922.603/helm-org-pkg.el rename elpa/{helm-org-20240922.603 => helm-org-20250405.1720}/helm-org-autoloads.el (100%) create mode 100644 elpa/helm-org-20250405.1720/helm-org-pkg.el rename elpa/{helm-org-20240922.603 => helm-org-20250405.1720}/helm-org.el (97%) rename elpa/{helm-projectile-20231023.1425 => helm-projectile-20250218.1525}/helm-projectile-autoloads.el (97%) rename elpa/{helm-projectile-20231023.1425 => helm-projectile-20250218.1525}/helm-projectile-pkg.el (53%) rename elpa/{helm-projectile-20231023.1425 => helm-projectile-20250218.1525}/helm-projectile.el (88%) diff --git a/bba.org b/bba.org index 82f9e26e..0ae9bf52 100644 --- a/bba.org +++ b/bba.org @@ -2454,7 +2454,7 @@ Some links you might check out: (if (>= emacs-major-version 24) (progn (add-to-list 'load-path - "~/.emacs.d/elpa/helm-20241217.746") + "~/.emacs.d/elpa/helm-20250515.548") (require 'helm) (helm-mode 1) (global-set-key (kbd "M-y") 'helm-show-kill-ring) diff --git a/elpa/helm-20241224.1937/emacs-helm.sh b/elpa/helm-20250515.548/emacs-helm.sh similarity index 99% rename from elpa/helm-20241224.1937/emacs-helm.sh rename to elpa/helm-20250515.548/emacs-helm.sh index 8f50f968..9bd07fde 100755 --- a/elpa/helm-20241224.1937/emacs-helm.sh +++ b/elpa/helm-20250515.548/emacs-helm.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh -## Copyright (C) 2012 ~ 2023 Thierry Volpiatto +## Copyright (C) 2012 ~ 2025 Thierry Volpiatto ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-adaptive.el b/elpa/helm-20250515.548/helm-adaptive.el similarity index 99% rename from elpa/helm-20241224.1937/helm-adaptive.el rename to elpa/helm-20250515.548/helm-adaptive.el index 98be39a1..137f6f1e 100644 --- a/elpa/helm-20241224.1937/helm-adaptive.el +++ b/elpa/helm-20250515.548/helm-adaptive.el @@ -3,7 +3,7 @@ ;; Original Author: Tamas Patrovics ;; Copyright (C) 2007 Tamas Patrovics -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-autoloads.el b/elpa/helm-20250515.548/helm-autoloads.el similarity index 92% rename from elpa/helm-20241224.1937/helm-autoloads.el rename to elpa/helm-20250515.548/helm-autoloads.el index eac18855..d075b31e 100644 --- a/elpa/helm-20241224.1937/helm-autoloads.el +++ b/elpa/helm-20250515.548/helm-autoloads.el @@ -46,6 +46,8 @@ Useful when you have a old or corrupted ;;; Generated autoloads from helm-bookmark.el +(autoload 'helm-bookmark-import-eww-bookmarks "helm-bookmark" "\ +Import EWW bookmarks into bookmark-alist." t) (autoload 'helm-bookmarks "helm-bookmark" "\ Preconfigured `helm' for bookmarks." t) (autoload 'helm-filtered-bookmarks "helm-bookmark" "\ @@ -123,8 +125,6 @@ In non interactives calls DEFAULT argument should be provided as a string, i.e. the `symbol-name' of any existing symbol. (fn DEFAULT)" t) -(autoload 'helm-manage-advice "helm-elisp" "\ -Preconfigured `helm' to disable/enable function advices." t) (autoload 'helm-locate-library "helm-elisp" "\ Preconfigured helm to locate elisp libraries. @@ -236,7 +236,7 @@ either customize it (see the info node `Easy Customization') or call the function `helm-ff-icon-mode'.") (custom-autoload 'helm-ff-icon-mode "helm-files" nil) (autoload 'helm-ff-icon-mode "helm-files" "\ -Display icons from `all-the-icons' package in HFF when enabled. +Display icons from `helm-x-icons-provider' package in HFF when enabled. This is a global minor mode. If called interactively, toggle the `Helm-Ff-Icon mode' mode. If the prefix argument is positive, enable @@ -264,6 +264,8 @@ Delete all thumb files that are no more associated with an existing image file in `helm-ff-image-dired-thumbnails-cache'." t) (autoload 'helm-projects-history "helm-files" "\ Jump to project already visisted with `helm-browse-project'. +Prefix arg allows browsing files recursively under a project not handled +by git or hg, otherwise it has no effect. (fn &optional ARG)" t) (autoload 'helm-browse-project "helm-files" "\ @@ -335,6 +337,11 @@ Called with a prefix arg force reloading cache. ;;; Generated autoloads from helm-for-files.el +(autoload 'helm-highlight-files "helm-for-files" "\ +A basic transformer for helm files sources. +Colorize only symlinks, directories and files. + +(fn FILES SOURCE)") (autoload 'helm-for-files "helm-for-files" "\ Preconfigured `helm' for opening files. Run all sources defined in `helm-for-files-preferred-list'." t) @@ -427,14 +434,28 @@ With a prefix argument \\[universal-argument], set REFRESH to non-nil. Optional parameter REFRESH, when non-nil, re-evaluates -`helm-default-info-index-list'. If the variable has been -customized, set it to its saved value. If not, set it to its -standard value. See `custom-reevaluate-setting' for more. +`helm-default-info-index-list' and clears caches (see below). +If the variable has been customized, set it to its saved value. +If not, set it to its standard value. See +`custom-reevaluate-setting' for more. REFRESH is useful when new Info files are installed. If `helm-default-info-index-list' has not been customized, the new Info files are made available. +When `completions-detailed' or `helm-completions-detailed' is non +nil, a description of Info files is provided. The Info files are +partially cached in the variables `helm-info--files-cache' and +`helm-info--files-docs-cache'. TIP: You can make these vars +persistent for faster start with the psession package, using +\\[psession-make-persistent-variable]. + +NOTE: The caches affect as well `info-dislpay-manual' when +`helm-mode' is enabled and `completions-detailed' is non nil. +When new Info files are installed, for example a library update +changed Info dir node entry, you can reset the caches with +a prefix arg. + (fn &optional REFRESH)" t) (autoload 'helm-info-at-point "helm-info" "\ Preconfigured `helm' for searching info at point." t) @@ -521,7 +542,9 @@ Preconfigured helm for stumpwm commands." t) (autoload 'helm-minibuffer-history "helm-misc" "\ Preconfigured `helm' for `minibuffer-history'." t) (autoload 'helm-outline "helm-misc" "\ -Basic helm navigation tool for outline buffers." t) +Basic helm navigation tool for outline buffers. + +(fn &optional ARG)" t) (register-definition-prefixes "helm-misc" '("helm-")) @@ -635,7 +658,7 @@ Keys description: - GET-LINE: Specify the :get-line slot of `helm-source-in-buffer', has no effect when CANDIDATES-IN-BUFFER is nil. - + - MATCH-PART: Allow matching only one part of candidate. See match-part documentation in `helm-source'. @@ -650,7 +673,7 @@ Keys description: - COERCE: See coerce in `helm-source'. - RAW-CANDIDATE: Do not unquote the unknown candidate coming from helm-pattern - when non nil. + when non nil. - GROUP: See group in `helm-source'. @@ -710,6 +733,44 @@ Keys description: `helm-read-file-name-mode-line-string'. (fn PROMPT &key (NAME \"Read File Name\") INITIAL-INPUT (BUFFER \"*Helm file completions*\") TEST NORET (CASE-FOLD helm-file-name-case-fold-search) PRESELECT HISTORY MUST-MATCH (FUZZY t) DEFAULT MARKED-CANDIDATES ALL-MARKED (CANDIDATE-NUMBER-LIMIT helm-ff-candidate-number-limit) NOMARK (ALISTP t) (PERSISTENT-ACTION-IF \\='helm-find-files-persistent-action-if) (PERSISTENT-HELP \"Hit1 Expand Candidate, Hit2 or (C-u) Find file\") (MODE-LINE helm-read-file-name-mode-line-string))") +(autoload 'helm-dynamic-completion "helm-mode" "\ +Build a completion function for `helm-pattern' in COLLECTION. + +Only the elements of COLLECTION that satisfy PREDICATE are considered. + +Argument POINT is the same as in `completion-all-completions' and +is meaningful only when using some kind of `completion-at-point'. + +The return value is a list of completions that may be sorted by +the sort function provided by the completion-style in +use (emacs-27 only), otherwise (emacs-26) the sort function has +to be provided if needed either with an FCT function in source or +by passing the sort function with METADATA +E.g.: \\='((metadata (display-sort-function . foo))). +Candidates can be modified by passing an affixation-function in METADATA. + +If you don't want the sort fn provided by style to kick +in (emacs-27) you can use as metadata value the symbol `nosort'. + +Example: + + (helm :sources (helm-build-sync-source \"test\" + :candidates (helm-dynamic-completion + \\='(foo bar baz foab) + \\='symbolp) + :match-dynamic t) + :buffer \"*helm test*\") + +When argument NOMODE is non nil don't use `completion-styles' as +specified in `helm-completion-styles-alist' for specific modes. + +When STYLES is specified use these `completion-styles', see +`helm--prepare-completion-styles'. + +Also `helm-completion-style' settings have no effect here, +`emacs' being used inconditionally as value. + +(fn COLLECTION PREDICATE &optional POINT METADATA NOMODE STYLES)") (defvar helm-mode nil "\ Non-nil if Helm mode is enabled. See the `helm-mode' command @@ -996,6 +1057,11 @@ disabled. ;;; Generated autoloads from helm-x-files.el (register-definition-prefixes "helm-x-files" '("helm-")) + + +;;; Generated autoloads from helm-x-icons.el + +(register-definition-prefixes "helm-x-icons" '("helm-x-icons-")) ;;; End of scraped data diff --git a/elpa/helm-20241224.1937/helm-bookmark.el b/elpa/helm-20250515.548/helm-bookmark.el similarity index 91% rename from elpa/helm-20241224.1937/helm-bookmark.el rename to elpa/helm-20250515.548/helm-bookmark.el index cec930de..10c90ba7 100644 --- a/elpa/helm-20241224.1937/helm-bookmark.el +++ b/elpa/helm-20250515.548/helm-bookmark.el @@ -1,6 +1,6 @@ ;;; helm-bookmark.el --- Helm for Emacs regular Bookmarks. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -26,16 +26,13 @@ (require 'helm-info) (require 'helm-adaptive) (require 'helm-net) +(require 'helm-x-icons) (declare-function helm-browse-project "helm-files" (arg)) (declare-function addressbook-bookmark-edit "ext:addressbook-bookmark.el" (bookmark)) -(declare-function all-the-icons-fileicon "ext:all-the-icons.el") -(declare-function all-the-icons-icon-for-file"ext:all-the-icons.el") -(declare-function all-the-icons-octicon "ext:all-the-icons.el") -(declare-function all-the-icons-match-to-alist "ext:all-the-icons.el") -(declare-function all-the-icons-faicon "ext:all-the-icons.el") +(declare-function eww-read-bookmarks "eww") -(defvar all-the-icons-dir-icon-alist) +(defvar eww-bookmarks) (defgroup helm-bookmark nil @@ -66,7 +63,7 @@ Don't use `setq' to set this." :type 'boolean :set (lambda (var val) - (if (require 'all-the-icons nil t) + (if (require helm-x-icons-provider nil t) (set var val) (set var nil)))) @@ -240,10 +237,10 @@ will be honored." (list (or (and (not (string= helm-pattern "")) helm-pattern) "Enter a bookmark name to record"))) - :action '(("Set bookmark" . (lambda (candidate) - (if (string= helm-pattern "") - (message "No bookmark name given for record") - (bookmark-set candidate)))))) + :action `(("Set bookmark" . ,(lambda (candidate) + (if (string= helm-pattern "") + (message "No bookmark name given for record") + (bookmark-set candidate)))))) "See (info \"(emacs)Bookmarks\").") @@ -274,6 +271,11 @@ BOOKMARK is a bookmark name or a bookmark record." (eq (bookmark-get-handler bookmark) 'bookmarkp-jump-w3m) (eq (bookmark-get-handler bookmark) 'bmkp-jump-w3m))) +(defun helm-bookmark-eww-bookmark-p (bookmark) + "Return non-nil if BOOKMARK is an Eww bookmark. +BOOKMARK is a bookmark name or a bookmark record." + (eq (bookmark-get-handler bookmark) 'eww-bookmark-jump)) + (defun helm-bookmark-woman-bookmark-p (bookmark) "Return non-nil if BOOKMARK is a Woman bookmark. BOOKMARK is a bookmark name or a bookmark record." @@ -348,7 +350,8 @@ BOOKMARK is a bookmark name or a bookmark record." helm-bookmark-image-bookmark-p helm-bookmark-file-p helm-bookmark-helm-find-files-p - helm-bookmark-addressbook-p) + helm-bookmark-addressbook-p + helm-bookmark-eww-bookmark-p) never (funcall pred bookmark))) (defun helm-bookmark-filter-setup-alist (fn) @@ -460,10 +463,39 @@ If `browse-url-browser-function' is set to something else than (defvar helm-source-bookmark-images (helm-source-bookmark-images-builder)) +;;; EWW bookmarks +;; +(defun helm-bookmark-normalize-eww-bmks () + (unless eww-bookmarks (eww-read-bookmarks)) + (cl-loop for (_url url _title title _time _time) in eww-bookmarks do + (unless (bookmark-get-bookmark title t) + (push (list title (cons 'location url) + '(imported . t) + '(handler . eww-bookmark-jump)) + bookmark-alist) + (cl-incf bookmark-alist-modification-count)))) + +;;;###autoload +(defun helm-bookmark-import-eww-bookmarks () + "Import EWW bookmarks into bookmark-alist." + (interactive) + (when (y-or-n-p "Really import eww-bookmarks into bookmark-alist?") + (bookmark-maybe-load-default-file) + (helm-bookmark-normalize-eww-bmks))) + +(defun helm-bookmark-eww-setup-alist () + "Specialized filter function for Eww bookmarks." + (helm-bookmark-filter-setup-alist 'helm-bookmark-eww-bookmark-p)) + +(defun helm-source-bookmark-eww-builder () + (helm-bookmark-build-source "Bookmark EWW" #'helm-bookmark-eww-setup-alist)) + +(defvar helm-source-bookmark-eww (helm-source-bookmark-eww-builder)) + ;;; Woman Man ;; (defun helm-bookmark-man-setup-alist () - "Specialized filter function for bookmarks w3m." + "Specialized filter function for Man pages bookmarks." (helm-bookmark-filter-setup-alist 'helm-bookmark-woman-man-bookmark-p)) (defun helm-source-bookmark-man-builder () @@ -549,11 +581,9 @@ If `browse-url-browser-function' is set to something else than (define-key map (kbd "C-x C-d") #'helm-bookmark-run-browse-project) map)) -;; Same as `helm-source-filtered-bookmarks' but override actions and keymap -;; specifically for helm-find-files bookmarks. -(defclass helm-bookmark-override-inheritor (helm-source) ()) +(defclass helm-bookmark-find-files-class (helm-source-filtered-bookmarks) ()) -(cl-defmethod helm--setup-source ((source helm-bookmark-override-inheritor)) +(cl-defmethod helm--setup-source ((source helm-bookmark-find-files-class)) ;; Ensure `helm-source-in-buffer' method is called. (cl-call-next-method) (setf (slot-value source 'action) @@ -562,15 +592,12 @@ If `browse-url-browser-function' is set to something else than ;; We don't want those actions in helm-find-files bookmarks. unless (memq action '(helm-bookmark-jump-other-frame helm-bookmark-jump-other-window - helm-bookmark-jump-other-tab)) + helm-bookmark-jump-other-tab + bookmark-set)) collect (cons name action)) '(("Browse project" . helm-bookmark-browse-project)) 1)) (setf (slot-value source 'keymap) helm-bookmark-find-files-map)) -(defclass helm-bookmark-find-files-class (helm-source-filtered-bookmarks - helm-bookmark-override-inheritor) - ()) - (defun helm-source-bookmark-helm-find-files-builder () (helm-bookmark-build-source "Bookmark helm-find-files sessions" @@ -620,6 +647,7 @@ If `browse-url-browser-function' is set to something else than for isabook = (string= (bookmark-prop-get i 'type) "addressbook") for isinfo = (eq handlerp 'Info-bookmark-jump) + for iseww = (eq handlerp 'eww-bookmark-jump) for loc = (bookmark-location i) for len = (string-width i) for trunc = (if (and helm-bookmark-show-location @@ -629,21 +657,22 @@ If `browse-url-browser-function' is set to something else than i) for icon = (when helm-bookmark-use-icon (cond ((and isfile hff) - (helm-aif (or (all-the-icons-match-to-alist + (helm-aif (or (helm-x-icons-match-to-alist (helm-basename (helm-basedir isfile t)) - all-the-icons-dir-icon-alist) - (all-the-icons-match-to-alist + 'dir) + (helm-x-icons-match-to-alist (helm-basename isfile) - all-the-icons-dir-icon-alist)) + 'dir)) (apply (car it) (cdr it)) - (all-the-icons-octicon "file-directory"))) - (isw3m (all-the-icons-faicon "firefox")) - ((and isfile isinfo) (all-the-icons-octicon "info")) + (helm-x-icons-generic "file-directory"))) + ((or isw3m iseww) + (helm-x-icons-generic "firefox")) + ((and isfile isinfo) (helm-x-icons-generic "info")) ((or iswoman isman) - (all-the-icons-fileicon "man-page")) + (helm-x-icons-generic "man-page")) ((or isgnus ismu4e) - (all-the-icons-octicon "mail-read")) - (isfile (all-the-icons-icon-for-file (helm-basename isfile))))) + (helm-x-icons-generic "mail-read")) + (isfile (helm-x-icons-icon-for-file (helm-basename isfile))))) ;; Add a * if bookmark have annotation if (and isannotation (not (string-equal isannotation ""))) do (setq trunc (concat helm-bookmark-annotation-sign @@ -660,6 +689,10 @@ If `browse-url-browser-function' is set to something else than isw3m (propertize trunc 'face 'helm-bookmark-w3m 'help-echo isfile)) + ( ;; eww buffers + iseww + (propertize trunc 'face 'helm-bookmark-w3m + 'help-echo isfile)) ( ;; gnus buffers isgnus (propertize trunc 'face 'helm-bookmark-gnus @@ -794,7 +827,6 @@ consecutive words from the buffer into the new bookmark name." now-map) nil 'bookmark-history old)))) (bookmark-set-name old newname) - (setq bookmark-current-bookmark newname) (helm-bookmark-maybe-save-bookmark) newname))) (defun helm-bookmark-rename-marked (_candidate) @@ -839,6 +871,17 @@ E.g. prepended with *." (dolist (i (helm-marked-candidates)) (bookmark-delete (helm-bookmark-get-bookmark-from-name i) 'batch))) + +(defun helm-bookmark-get-defaults () + "Get default bookmark names at point for `bookmark-set'." + (let* (bookmark-current-bookmark no-defaults + (record (condition-case _err + (bookmark-make-record) + (error (setq no-defaults t))))) + ;; Not sure `bookmark-make-record' set 'defaults prop in older Emacs. + (or (bookmark-prop-get record 'defaults) + (unless no-defaults + (list (buffer-name helm-current-buffer)))))) ;;; bookmark annotations ;; @@ -917,8 +960,7 @@ if external addressbook-bookmark package is installed." (helm :sources helm-bookmark-default-filtered-sources :prompt "Search Bookmark: " :buffer "*helm filtered bookmarks*" - :default (list (thing-at-point 'symbol) - (buffer-name helm-current-buffer)))) + :default (helm-bookmark-get-defaults))) (provide 'helm-bookmark) diff --git a/elpa/helm-20241224.1937/helm-buffers.el b/elpa/helm-20250515.548/helm-buffers.el similarity index 93% rename from elpa/helm-20241224.1937/helm-buffers.el rename to elpa/helm-20250515.548/helm-buffers.el index 1852fd4c..6cfc6575 100644 --- a/elpa/helm-20241224.1937/helm-buffers.el +++ b/elpa/helm-20250515.548/helm-buffers.el @@ -1,6 +1,6 @@ ;;; helm-buffers.el --- helm support for buffers. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -25,14 +25,12 @@ (require 'helm-regexp) (require 'helm-help) (require 'helm-occur) +(require 'helm-x-icons) (declare-function helm-comp-read "helm-mode") (declare-function helm-browse-project "helm-files") (declare-function helm-ff-switch-to-shell "helm-files") -(declare-function all-the-icons-icon-for-file "ext:all-the-icons.el") -(declare-function all-the-icons-octicon "ext:all-the-icons.el") -(defvar all-the-icons-mode-icon-alist) (defvar dired-buffers) (defvar org-directory) (defvar helm-ff-default-directory) @@ -103,7 +101,7 @@ of this source is accessible and properly loaded." (defcustom helm-buffers-end-truncated-string ;; `truncate-string-ellipsis', the function is not available in 27.1 - ;; See issue#2673. + ;; See issue#2673. (if (char-displayable-p ?…) "…" "...") "The string to display at end of truncated buffer names." :type 'string) @@ -178,7 +176,7 @@ you want to keep the recentest order when narrowing candidates." Don't use `setq' to set this." :type 'boolean :set (lambda (var val) - (if (require 'all-the-icons nil t) + (if (require helm-x-icons-provider nil t) (set var val) (set var nil)))) @@ -216,6 +214,11 @@ Don't use `setq' to set this." "Face used for modified buffers." :group 'helm-buffers-faces) +(defface helm-indirect-buffer + `((t :foreground "DimGray" :background "black")) + "Face used for indirect buffers." + :group 'helm-buffers-faces) + (defface helm-buffer-size `((((background dark)) ,@(and (>= emacs-major-version 27) '(:extend t)) @@ -459,14 +462,19 @@ The list is reordered with `helm-buffer-list-reorder-fn'." (let* ((buf-fname (buffer-file-name (get-buffer buf-name))) (ext (if buf-fname (helm-file-name-extension buf-fname) "")) (bmode (with-current-buffer buf-name major-mode)) + (icon-alist (helm-x-icons-resolve-alist 'mode)) (icon (when helm-buffers-show-icons - (helm-aif (assq bmode all-the-icons-mode-icon-alist) - (apply (cadr it) (cddr it)) + (helm-aif (and (not (eq type 'indirect)) + (assq bmode icon-alist)) + (and helm-x-icons-provider + (apply (cadr it) (cddr it))) (cond ((eq type 'dired) - (all-the-icons-octicon "file-directory")) + (helm-x-icons-generic "file-directory")) + ((eq type 'indirect) + (helm-x-icons-generic "clone")) (buf-fname - (all-the-icons-icon-for-file buf-name)) - (t (all-the-icons-octicon "star" :v-adjust 0.0)))))) + (helm-x-icons-icon-for-file buf-name)) + (t (helm-x-icons-generic "star" :v-adjust 0.0)))))) (buf-name (propertize buf-name 'face face1 'help-echo help-echo 'type type))) @@ -526,7 +534,7 @@ The list is reordered with `helm-buffer-list-reorder-fn'." (helm-buffer--show-details name name-prefix file-name size mode dir 'helm-buffer-file 'helm-buffer-process nil details 'filebuf) - (cond + (helm-acond (;; A dired buffer. (rassoc buf dired-buffers) (helm-buffer--show-details @@ -554,6 +562,18 @@ The list is reordered with `helm-buffer-list-reorder-fn'." (helm-buffer--show-details name name-prefix file-name size mode dir 'helm-buffer-file 'helm-buffer-process nil details 'filebuf)) + ;; Indirect buffer.=>DimGray + ((buffer-base-buffer buf) + (let ((face (if (or (buffer-modified-p it) + (with-current-buffer it + (and helm-buffers-tick-counter + (/= helm-buffers-tick-counter + (buffer-modified-tick))))) + 'helm-buffer-modified + 'helm-indirect-buffer))) + (helm-buffer--show-details + name name-prefix dir size mode dir + face 'helm-buffer-process nil details 'indirect))) ;; A non-file, modified buffer See bug#1917 ((with-current-buffer name (and helm-buffers-tick-counter @@ -842,7 +862,8 @@ If REGEXP-FLAG is given use `query-replace-regexp'." (defun helm-revert-buffer (candidate) (with-current-buffer candidate - (helm-aif (buffer-file-name) + (helm-aif (or (buffer-file-name) + (buffer-file-name (buffer-base-buffer))) (and (file-exists-p it) (revert-buffer t t))))) (defun helm-revert-marked-buffers (_ignore) @@ -869,7 +890,9 @@ If REGEXP-FLAG is given use `query-replace-regexp'." (cl-assert marked nil "No buffers need to be saved") (cl-loop for buf in marked do (with-current-buffer (get-buffer buf) - (when (buffer-file-name) (save-buffer)))) + (when (or (buffer-file-name) + (buffer-file-name (buffer-base-buffer))) + (save-buffer)))) (when helm-marked-candidates (helm-unmark-all)) (helm-force-update (regexp-quote preselect))))) @@ -939,7 +962,7 @@ If REGEXP-FLAG is given use `query-replace-regexp'." 'helm-grep-buffers) (helm-make-command-from-action helm-buffer-run-zgrep - "Run Grep action from `helm-source-buffers-list'." + "Run Zgrep action from `helm-source-buffers-list'." 'helm-zgrep-buffers) (helm-make-command-from-action helm-buffer-run-query-replace-regexp @@ -1018,8 +1041,14 @@ vertically." (helm-delete-current-selection)))) (defun helm-buffers--quote-truncated-buffer (buffer) + "Quote the truncated buffer-name of BUFFER. +buffer-name is truncated according to `helm-buffer-max-length' minus the length +of icon if one." (let ((bufname (and (bufferp buffer) - (buffer-name buffer)))) + (buffer-name buffer))) + (maxlen (if helm-buffers-show-icons + (- helm-buffer-max-length 2) + helm-buffer-max-length))) (when (and bufname (file-remote-p (with-current-buffer bufname default-directory))) @@ -1028,32 +1057,37 @@ vertically." (regexp-quote (if (and helm-buffer-max-length helm-buffer-details-flag) - (helm-substring-by-width - bufname helm-buffer-max-length - "") + (helm-substring-by-width bufname maxlen "") bufname))))) (defun helm-buffers-persistent-kill (_buffer) - (let ((marked (helm-marked-candidates)) - (sel (helm-get-selection)) - (msg "Buffer `%s' modified, please save it before kill")) - (unwind-protect - (cl-loop for b in marked - do (if (and (buffer-file-name b) (buffer-modified-p b)) - (message msg (buffer-name b)) - ;; We need to preselect each marked because - ;; helm-buffers-persistent-kill-1 is deleting - ;; current selection. - (helm-preselect - (format "^%s" - (helm-buffers--quote-truncated-buffer b))) - (helm-buffers-persistent-kill-1 b) - (message nil) - (helm--remove-marked-and-update-mode-line b))) - (with-helm-buffer + (let* ((marked (helm-marked-candidates)) + (msg "Buffer `%s' modified, please save it before kill") + ;; After marking, selection should be after the last marked unless user + ;; has not moved, if deleting current, use current selection after + ;; having deleted. + (sel (and (cdr marked) (helm-get-selection)))) + (with-helm-buffer + (unwind-protect + (dolist (b marked) + (if (and (buffer-file-name b) (buffer-modified-p b)) + (progn (message msg (buffer-name b)) (sit-for 1)) + ;; We need to preselect each marked because + ;; helm-buffers-persistent-kill-1 is deleting + ;; current selection. + (helm-preselect + (format "^[[:multibyte:] ]*%s" + (helm-buffers--quote-truncated-buffer b))) + (helm-buffers-persistent-kill-1 b) + (helm--remove-marked-and-update-mode-line b))) (setq helm-marked-candidates nil helm-visible-mark-overlays nil)) - (helm-force-update (helm-buffers--quote-truncated-buffer sel))))) + (helm-force-update (format "^[[:multibyte:] ]*%s" + (helm-buffers--quote-truncated-buffer + ;; Ensure user has not moved selection on one + ;; of marked. + (or (and (buffer-live-p sel) sel) + (helm-get-selection)))))))) (defun helm-buffers-list-persistent-action (candidate) (let ((current (window-buffer helm-persistent-action-display-window))) diff --git a/elpa/helm-20241224.1937/helm-color.el b/elpa/helm-20250515.548/helm-color.el similarity index 94% rename from elpa/helm-20241224.1937/helm-color.el rename to elpa/helm-20250515.548/helm-color.el index 03c9307d..8a0b6e89 100644 --- a/elpa/helm-20241224.1937/helm-color.el +++ b/elpa/helm-20250515.548/helm-color.el @@ -1,6 +1,6 @@ ;;; helm-color.el --- colors and faces -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -49,12 +49,12 @@ (intern (car (split-string candidate))) 'helm-describe-face)) :persistent-help "Describe face" - :action '(("Customize" - . (lambda (line) - (customize-face (intern (car (split-string line)))))) + :action `(("Customize" + . ,(lambda (line) + (customize-face (intern (car (split-string line)))))) ("Copy name" - . (lambda (line) - (kill-new (car (split-string line " " t))))))) + . ,(lambda (line) + (kill-new (car (split-string line " " t))))))) "See (info \"(emacs)Faces\")") ;;; Colors browser diff --git a/elpa/helm-20241224.1937/helm-command.el b/elpa/helm-20250515.548/helm-command.el similarity index 90% rename from elpa/helm-20241224.1937/helm-command.el rename to elpa/helm-20250515.548/helm-command.el index e5af2fcc..ae276a13 100644 --- a/elpa/helm-20241224.1937/helm-command.el +++ b/elpa/helm-20250515.548/helm-command.el @@ -1,6 +1,6 @@ ;;; helm-command.el --- Helm execute-exended-command. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -59,6 +59,17 @@ This value can be toggled with "When nil, do not sort helm-M-x's commands history." :type 'boolean) +(defcustom helm-M-x-exclude-unusable-commands-in-mode t + "When non nil exclude commands not usable in current buffer. +This will exclude only commands defined with `interactive' MODES argument, for +other commands, they will be displayed even if unusable as long as they satisfies +`commandp'. +NOTE: As `interactive' MODES argument is relatively recent, not all commands are +using it when they should, so do not expect ALL unuseful commands to be excluded +in `helm-M-x'. Also in Emacsen with a version of `interactive' not handling +MODES, this will have no effect. Regardless of this Helm commands unrelated to +Helm will never appear in `helm-M-x' whatever the value of this var is." + :type 'boolean) ;;; Faces ;; @@ -320,8 +331,8 @@ Arg HISTORY default to `extended-command-history'." :fuzzy-match helm-M-x-fuzzy-match))) (prompt (concat (helm-acase helm-M-x-prefix-argument (- "-") - ((guard* (and (consp it) (car it))) - (if (eq guard 4) "C-u " (format "%d " guard))) + ((dst* (l &rest args)) + (if (eq l 4) "C-u " (format "%d " l))) ((guard* (integerp it)) (format "%d " it))) "M-x "))) (setq helm-M-x--timer (run-at-time 1 0.1 #'helm-M-x--notify-prefix-arg)) @@ -401,6 +412,20 @@ Save COMMAND to `extended-command-history'." (helm-mode 1)) (read-extended-command))))) +(defun helm-M-x--mode-predicate (symbol mj-mode lmm-modes) + "Check if SYMBOL is suitable for current buffer. +MJ-MODE is used to pass major-mode and LMM-MODES to pass local-minor-modes. +This predicate honors commands defined with the `interactive' MODES argument." + (let* ((sym (helm-symbolify symbol)) + (modes (command-modes sym))) + (and (commandp sym) + (if modes + (or (memq mj-mode modes) + (cl-loop for m in modes thereis + (or (memq m lmm-modes) + (memq m global-minor-modes)))) + t)))) + ;;;###autoload (defun helm-M-x (_arg) "Preconfigured `helm' for Emacs commands. @@ -420,7 +445,13 @@ You can get help on each command by persistent action." (list current-prefix-arg))) (if (or defining-kbd-macro executing-kbd-macro) (helm-M-x--vanilla-M-x) - (helm-M-x-read-extended-command obarray))) + (let ((lmm-modes (buffer-local-value 'local-minor-modes (current-buffer))) + (mj-mode major-mode)) + (helm-M-x-read-extended-command + obarray (if (and (fboundp 'command-modes) + helm-M-x-exclude-unusable-commands-in-mode) + (lambda (sym) (helm-M-x--mode-predicate sym mj-mode lmm-modes)) + #'commandp))))) (put 'helm-M-x 'interactive-only 'command-execute) (provide 'helm-command) diff --git a/elpa/helm-20241224.1937/helm-dabbrev.el b/elpa/helm-20250515.548/helm-dabbrev.el similarity index 99% rename from elpa/helm-20241224.1937/helm-dabbrev.el rename to elpa/helm-20250515.548/helm-dabbrev.el index b7061ce2..ef522feb 100644 --- a/elpa/helm-20241224.1937/helm-dabbrev.el +++ b/elpa/helm-20250515.548/helm-dabbrev.el @@ -1,6 +1,6 @@ ;;; helm-dabbrev.el --- Helm implementation of dabbrev. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-easymenu.el b/elpa/helm-20250515.548/helm-easymenu.el similarity index 98% rename from elpa/helm-20241224.1937/helm-easymenu.el rename to elpa/helm-20250515.548/helm-easymenu.el index 32debf65..03b7d166 100644 --- a/elpa/helm-20241224.1937/helm-easymenu.el +++ b/elpa/helm-20250515.548/helm-easymenu.el @@ -1,6 +1,6 @@ ;;; helm-easymenu.el --- Helm easymenu definitions. -*- lexical-binding: t -*- -;; Copyright (C) 2015 ~ 2020 Thierry Volpiatto +;; Copyright (C) 2015 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-elisp.el b/elpa/helm-20250515.548/helm-elisp.el similarity index 92% rename from elpa/helm-20241224.1937/helm-elisp.el rename to elpa/helm-20250515.548/helm-elisp.el index 4219119d..3ad1ea36 100644 --- a/elpa/helm-20241224.1937/helm-elisp.el +++ b/elpa/helm-20250515.548/helm-elisp.el @@ -1,6 +1,6 @@ ;;; helm-elisp.el --- Elisp symbols completion for helm. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -415,22 +415,26 @@ the same time to variable and a function." for sym = (if (string-match "\\`:[[:alpha:]]+:\\'" c) c (intern-soft c)) for annot = (helm-acase sym - ((guard* (stringp it)) " ") - ((guard* (commandp it)) " ") - ((guard* (class-p it)) " ") - ((guard* (cl-generic-p it)) " ") - ((guard* (fboundp it)) " ") - ((guard* (keywordp it)) " ") - ((guard* (boundp it)) " ") - ((guard* (facep it)) " ") - ((guard* (helm-group-p it)) " ") + ((guard* (stringp it)) + (propertize " " 'face 'font-lock-regexp-face)) + ((guard* (commandp it)) + (propertize " " 'face 'font-lock-function-name-face)) + ((guard* (class-p it)) + (propertize " " 'face 'font-lock-type-face)) + ((guard* (cl-generic-p it)) + (propertize " " 'face 'font-lock-function-name-face)) + ((guard* (fboundp it)) + (propertize " " 'face 'font-lock-function-name-face)) + ((guard* (keywordp it)) + (propertize " " 'face 'font-lock-keyword-face)) + ((guard* (boundp it)) + (propertize " " 'face 'font-lock-variable-name-face)) + ((guard* (facep it)) + (propertize " " 'face 'font-lock-variable-name-face)) + ((guard* (helm-group-p it)) + (propertize " " 'face 'font-lock-type-face)) (t " ")) - collect (cons (concat (helm-aand - (propertize - annot 'face 'helm-completions-annotations) - (propertize " " 'display it)) - c) - c) + collect (cons (concat (propertize " " 'display annot) c) c) into lst finally return (sort lst #'helm-generic-sort-fn))) @@ -628,9 +632,9 @@ is only used to test DEFAULT." . ,(lambda (candidate) (let ((sym (helm-symbolify candidate))) (set sym standard-value))))))) - '(("Customize variable" . - (lambda (candidate) - (customize-option (helm-symbolify candidate))))))) + `(("Customize variable" + . ,(lambda (candidate) + (customize-option (helm-symbolify candidate))))))) ((and val (with-helm-current-buffer (ring-p (symbol-value sym)))) (append actions '(("Clean ring" . helm-apropos-clean-ring)))) @@ -853,74 +857,6 @@ a string, i.e. the `symbol-name' of any existing symbol." :preselect (and default (concat "^\\_<" (regexp-quote default) "\\_>")) :truncate-lines t))) - -;;; Advices -;; -;; -(defvar ad-advised-functions) -(defvar ad-advice-classes) -(declare-function ad-make-single-advice-docstring "advice") -(declare-function ad-get-advice-info-field "advice") -(declare-function ad-advice-set-enabled "advice") -(declare-function ad-advice-set-enabled "advice") -(declare-function ad-advice-enabled "advice") - -(defvar helm-source-advice - (helm-build-sync-source "Function Advice" - :init (lambda () (require 'advice)) - :candidates 'helm-advice-candidates - :action (helm-make-actions "Toggle Enable/Disable" 'helm-advice-toggle) - :persistent-action 'helm-advice-persistent-action - :nomark t - :multiline t - :persistent-help "Toggle describe function / C-u C-j: Toggle advice")) - -(defun helm-advice-candidates () - (cl-loop for fname in ad-advised-functions - for function = (intern fname) - append - (cl-loop for class in ad-advice-classes append - (cl-loop for advice in (ad-get-advice-info-field function class) - for enabled = (ad-advice-enabled advice) - collect - (cons (format - "%s %s %s" - (if enabled "Enabled " "Disabled") - (propertize fname 'face 'font-lock-function-name-face) - (ad-make-single-advice-docstring advice class nil)) - (list function class advice)))))) - -(defun helm-advice-persistent-action (func-class-advice) - (if current-prefix-arg - (helm-advice-toggle func-class-advice) - (describe-function (car func-class-advice)))) - -(defun helm-advice-toggle (func-class-advice) - (cl-destructuring-bind (function _class advice) func-class-advice - (cond ((ad-advice-enabled advice) - (ad-advice-set-enabled advice nil) - (message "Disabled")) - (t - (ad-advice-set-enabled advice t) - (message "Enabled"))) - (ad-activate function) - (and helm-in-persistent-action - (helm-advice-update-current-display-string)))) - -(defun helm-advice-update-current-display-string () - (helm-edit-current-selection - (let ((newword (cond ((looking-at "Disabled") "Enabled") - ((looking-at "Enabled") "Disabled")))) - (when newword - (delete-region (point) (progn (forward-word 1) (point))) - (insert newword))))) - -;;;###autoload -(defun helm-manage-advice () - "Preconfigured `helm' to disable/enable function advices." - (interactive) - (helm :sources 'helm-source-advice :buffer "*helm advice*")) - ;;; Locate elisp library ;; @@ -951,6 +887,7 @@ new libraries are found, however when a library update its headers and the description change you can reset the caches with a prefix arg." (interactive "P") + (require 'helm-mode) (let (done) (when arg (setq helm--locate-library-cache nil) @@ -984,7 +921,7 @@ a prefix arg." for disp = (and path (if (and doc (or completions-detailed helm-completions-detailed)) - (helm-aand (propertize doc 'face 'font-lock-warning-face) + (helm-aand (propertize doc 'face 'helm-completions-detailed) (propertize " " 'display (concat sep it)) (concat bn it)) bn)) diff --git a/elpa/helm-20241224.1937/helm-epa.el b/elpa/helm-20250515.548/helm-epa.el similarity index 95% rename from elpa/helm-20241224.1937/helm-epa.el rename to elpa/helm-20250515.548/helm-epa.el index 5df8aa2c..4e938b8d 100644 --- a/elpa/helm-20241224.1937/helm-epa.el +++ b/elpa/helm-20250515.548/helm-epa.el @@ -1,6 +1,6 @@ ;;; helm-epa.el --- helm interface for epa/epg -*- lexical-binding: t; -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -178,12 +178,12 @@ (keys (helm-marked-candidates))) (message "Deleting gpg keys..") (condition-case error - (epg-delete-keys context keys) + (epg-delete-keys context keys) (error (epa-display-error context) (signal (car error) (cdr error)))) (message "Deleting gpg keys done"))) - + (defun helm-epa-encrypt-file (_candidate) "Select a file to encrypt with key CANDIDATE." (let* ((file (helm-read-file-name "Encrypt file: ")) @@ -201,7 +201,7 @@ (with-no-warnings (setf (epg-context-armor context) t)) (condition-case error - (kill-new (epg-export-keys-to-string context keys)) + (kill-new (epg-export-keys-to-string context keys)) (error (epa-display-error context) (signal (car error) (cdr error)))))) @@ -214,16 +214,16 @@ (save-excursion (goto-char (point-min)) (if (search-forward mail-header-separator nil t) - (forward-line)) + (forward-line)) (setq epa-last-coding-system-specified - (or coding-system-for-write - (select-safe-coding-system (point) (point-max)))) + (or coding-system-for-write + (select-safe-coding-system (point) (point-max)))) (let ((verbose current-prefix-arg)) (setq start (point) end (point-max) mode (if verbose - (epa--read-signature-type) - 'clear)))) + (epa--read-signature-type) + 'clear)))) ;; TODO Make non-interactive functions to replace epa-sign-region ;; and epa-encrypt-region and inline them. (with-no-warnings @@ -237,12 +237,12 @@ (save-excursion (goto-char (point-min)) (when (search-forward mail-header-separator nil t) - (forward-line)) + (forward-line)) (setq start (point) end (point-max)) (setq epa-last-coding-system-specified - (or coding-system-for-write - (select-safe-coding-system start end)))) + (or coding-system-for-write + (select-safe-coding-system start end)))) ;; Don't let some read-only text stop us from encrypting. (let ((inhibit-read-only t) (keys (helm-epa-collect-keys-from-candidates cands)) diff --git a/elpa/helm-20241224.1937/helm-eshell.el b/elpa/helm-20250515.548/helm-eshell.el similarity index 99% rename from elpa/helm-20241224.1937/helm-eshell.el rename to elpa/helm-20250515.548/helm-eshell.el index fae99c35..332c745f 100644 --- a/elpa/helm-20241224.1937/helm-eshell.el +++ b/elpa/helm-20250515.548/helm-eshell.el @@ -1,6 +1,6 @@ ;;; helm-eshell.el --- pcomplete and eshell completion for helm. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-eval.el b/elpa/helm-20250515.548/helm-eval.el similarity index 87% rename from elpa/helm-20241224.1937/helm-eval.el rename to elpa/helm-20250515.548/helm-eval.el index b7c7d9c3..c03b67ad 100644 --- a/elpa/helm-20241224.1937/helm-eval.el +++ b/elpa/helm-20250515.548/helm-eval.el @@ -1,6 +1,6 @@ ;;; helm-eval.el --- eval expressions from helm. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -106,14 +106,14 @@ Should take one arg: the string to display." (error "Error")))) :nohighlight t :keymap helm-eval-expression-map - :action '(("Copy result to kill-ring" . (lambda (candidate) - (kill-new - (replace-regexp-in-string - "\n" "" candidate)) - (message "Result copied to kill-ring"))) - ("copy sexp to kill-ring" . (lambda (_candidate) - (kill-new helm-input) - (message "Sexp copied to kill-ring")))))) + :action `(("Copy result to kill-ring" . ,(lambda (candidate) + (kill-new + (replace-regexp-in-string + "\n" "" candidate)) + (message "Result copied to kill-ring"))) + ("copy sexp to kill-ring" . ,(lambda (_candidate) + (kill-new helm-input) + (message "Sexp copied to kill-ring")))))) (defun helm-eval-new-line-and-indent () (interactive) @@ -174,13 +174,13 @@ Should take one arg: the string to display." result)) (error (cdr err))))) :nohighlight t - :action '(("Copy result to kill-ring" . (lambda (candidate) - (kill-new candidate) - (message "Result \"%s\" copied to kill-ring" - candidate))) - ("Copy operation to kill-ring" . (lambda (_candidate) - (kill-new helm-input) - (message "Calculation copied to kill-ring")))))) + :action `(("Copy result to kill-ring" . ,(lambda (candidate) + (kill-new candidate) + (message "Result \"%s\" copied to kill-ring" + candidate))) + ("Copy operation to kill-ring" . ,(lambda (_candidate) + (kill-new helm-input) + (message "Calculation copied to kill-ring")))))) ;;;###autoload (defun helm-eval-expression (arg) diff --git a/elpa/helm-20241224.1937/helm-external.el b/elpa/helm-20250515.548/helm-external.el similarity index 99% rename from elpa/helm-20241224.1937/helm-external.el rename to elpa/helm-20250515.548/helm-external.el index 320e6f0b..81c3de27 100644 --- a/elpa/helm-20241224.1937/helm-external.el +++ b/elpa/helm-20250515.548/helm-external.el @@ -1,6 +1,6 @@ ;;; helm-external.el --- Run Externals commands within Emacs with helm completion. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -253,7 +253,7 @@ commands with `helm-external-commands-list'." :data (helm-external-commands-list-1 'sort))) :buffer "*helm externals commands*" :prompt "RunProgram: ") - ;; Remove from history no more valid executables. + ;; Remove from history no more valid executables. (setq helm-external-command-history (cl-loop for i in helm-external-command-history when (executable-find i) collect i))) diff --git a/elpa/helm-20241224.1937/helm-fd.el b/elpa/helm-20250515.548/helm-fd.el similarity index 92% rename from elpa/helm-20241224.1937/helm-fd.el rename to elpa/helm-20250515.548/helm-fd.el index 9ec5c895..0a08000b 100644 --- a/elpa/helm-20241224.1937/helm-fd.el +++ b/elpa/helm-20250515.548/helm-fd.el @@ -1,6 +1,6 @@ ;;; helm-fd.el --- helm interface for fd command line tool. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -125,7 +125,14 @@ (defun helm-fd-fct (candidates _source) "The filtered-candidate-transformer function for helm-fd." (cl-loop for i in candidates - collect (ansi-color-apply i))) + for fname = (ansi-color-apply i) + if helm-ff-icon-mode collect + (let* ((abs (expand-file-name fname default-directory)) + (icon (if (file-directory-p abs) + (helm-x-icons-generic "file-directory") + (helm-x-icons-icon-for-file (helm-basename fname))))) + (cons (concat icon fname) fname)) + else collect fname)) (defun helm-fd-1 (directory) "Run fd shell command on DIRECTORY with helm interface." diff --git a/elpa/helm-20241224.1937/helm-files.el b/elpa/helm-20250515.548/helm-files.el similarity index 93% rename from elpa/helm-20241224.1937/helm-files.el rename to elpa/helm-20250515.548/helm-files.el index dfe0272c..3ad0b897 100644 --- a/elpa/helm-20241224.1937/helm-files.el +++ b/elpa/helm-20250515.548/helm-files.el @@ -1,6 +1,6 @@ ;;; helm-files.el --- helm file browser and related. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ (require 'filenotify) (require 'image-mode) (require 'image-dired) +(require 'helm-x-icons) (declare-function find-library-name "find-func.el" (library)) (declare-function w32-shell-execute "ext:w32fns.c" (operation document &optional parameters show-flag)) @@ -87,16 +88,17 @@ (declare-function dired-async-processes "ext:dired-async.el") (declare-function dired-async-mode-line-message "ext:dired-async.el") (declare-function dired-async--modeline-mode "ext:dired-async.el") -(declare-function all-the-icons-icon-for-file "ext:all-the-icons.el") -(declare-function all-the-icons-octicon "ext:all-the-icons.el") -(declare-function all-the-icons-match-to-alist "ext:all-the-icons.el") -(declare-function all-the-icons-material "ext:all-the-icons.el") (declare-function helm-adaptive-sort "ext:helm-adaptive.el") (declare-function wfnames-setup-buffer "ext:wfnames.el") (declare-function svg-lib-progress-bar "ext:svg-lib") (declare-function svg-lib-tag "ext:svg-lib") +(declare-function helm-epa-success-message "helm-epa") +(declare-function helm-epa-collect-id-from-candidates "helm-epa") +(declare-function helm-epa-collect-keys-from-candidates "helm-epa") +(declare-function async-byte-compile-file "async-bytecomp.el") +(declare-function async-byte-recompile-directory "async-bytecomp.el") +(declare-function dnd-begin-drag-files "dnd.el") -(defvar all-the-icons-dir-icon-alist) (defvar term-char-mode-point-at-process-mark) (defvar term-char-mode-buffer-read-only) (defvar recentf-list) @@ -112,6 +114,7 @@ (defvar helm-fd-executable) (defvar wfnames-buffer) (defvar Info-current-file) +(defvar generated-autoload-file) ;;; Internal vars ;; @@ -242,7 +245,7 @@ Should not be used among other sources.") (define-key map (kbd "C-c C-a") 'helm-ff-run-mail-attach-files) (define-key map (kbd "C-c p") 'helm-ff-run-print-file) (define-key map (kbd "C-c /") 'helm-ff-run-find-sh-command) - (define-key map (kbd "C-/") 'helm-ff-run-fd) + (define-key map (kbd "C-/") 'helm-ff-run-fd) ;; Next 2 have no effect if candidate is not an image file. (define-key map (kbd "M-l") 'helm-ff-rotate-left-persistent) (define-key map (kbd "M-r") 'helm-ff-rotate-right-persistent) @@ -270,24 +273,6 @@ Should not be used among other sources.") map) "Keymap for `helm-find-files'.") -(defvar helm-find-files-dummy-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map helm-map) - (define-key map (kbd "M-T") 'helm-ff-run-touch-files) - (define-key map (kbd "C-c r") 'helm-ff-run-find-file-as-root) - (define-key map (kbd "C-l") 'helm-find-files-up-one-level) - (define-key map (kbd "C-_") 'helm-ff-undo) - (define-key map (kbd "C-r") 'helm-find-files-down-last-level) - (define-key map (kbd "C-") 'helm-ff-run-toggle-auto-update) - (define-key map (kbd "C-c ") 'helm-ff-run-toggle-auto-update) - (helm-define-key-with-subkeys map (kbd "DEL") ?\d 'helm-ff-delete-char-backward - '((C-backspace . helm-ff-run-toggle-auto-update) - ([C-c DEL] . helm-ff-run-toggle-auto-update)) - nil 'helm-ff-delete-char-backward--exit-fn) - map) - "The map used for `helm-find-files-dummy-source'. -It is the source handling new file or directory in `helm-find-files'.") - (defvar helm-read-file-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-map) @@ -382,9 +367,19 @@ printers for you." (defcustom helm-ff-transformer-show-only-basename t "Show only basename of candidates in `helm-find-files'. This can be toggled at anytime from `helm-find-files' with \ -\\\\[helm-ff-run-toggle-basename]." +\\\\[helm-ff-run-toggle-basename]. Note +that even when non nil, the dotted directories on top i.e. \".\" +and \"..\" are still displayed as full path when +`helm-ff-show-dot-file-path' is non nil." :type 'boolean) +(defcustom helm-ff-show-dot-file-path nil + "Show full path of dotted directories when non nil." + :type 'boolean + :set (lambda (var val) + (set-default var val) + (clrhash helm-ff--list-directory-cache))) + (defcustom helm-ff-signal-error-on-dot-files t "Signal error when file is `.' or `..' on file deletion when non-nil. Default is non-nil. @@ -851,6 +846,7 @@ want to use it, helm is still providing " async" ""))) 'helm-ff-delete-files "Touch File(s) `M-T'" 'helm-ff-touch-files + "Encrypt file(s)" 'helm-ff-encrypt-files "Copy file(s) `M-C, C-u to follow'" 'helm-find-files-copy (lambda () (and (executable-find "rsync") @@ -863,7 +859,7 @@ want to use it, helm is still providing "Relsymlink file(s) `M-Y, C-u to follow'" 'helm-find-files-relsymlink "Hardlink file(s) `M-H, C-u to follow'" 'helm-find-files-hardlink "Compress file(s) to archive `M-c'" 'helm-find-files-compress-to - "Compress or uncompress file(s) `M-z'" 'helm-ff-compress-marked-files + "Compress or uncompress file(s) `M-Z'" 'helm-ff-compress-marked-files "Change mode on file(s) `M-M'" 'helm-ff-chmod "Find file other window `C-c o'" 'helm-find-files-other-window "Find file other frame `C-c C-o'" 'find-file-other-frame @@ -899,8 +895,8 @@ If your system have no file notification package available turn this to nil to avoid error messages when using `helm-find-files'." :type 'boolean :set (lambda (var val) - (set-default var val) - (unless (symbol-value var) + (set-default var val) + (unless (symbol-value var) (cl-loop for dir being the hash-keys of helm-ff--file-notify-watchers do (remhash dir helm-ff--list-directory-cache))))) @@ -937,7 +933,7 @@ Note that image files are always followed even if their extensions is present in this list." :type '(repeat string)) -(defcustom helm-ff-nohighlight-matches t +(defcustom helm-ff-nohighlight-matches nil "Highlight matches in `helm-find-files' when nil." :type 'boolean :initialize 'custom-initialize-changed @@ -953,6 +949,16 @@ present in this list." (defcustom helm-ff-dim-prompt-on-update t "When non nil dim prompt while updating." :type 'boolean) + +(defcustom helm-ff-drag-mouse-1-default-action 'copy + "Default action when dragging files. +Possible values are `copy', `move' or `link'. +Currently supported value is `copy' when dropping to a dired buffer, `move' is +working only when dropping on an external application (only thunar tested)." + :type '(choice + (const :tag "Copy" copy) + (const :tag "Move" move) + (const :tag "Link" link))) ;;; Faces ;; @@ -988,8 +994,13 @@ present in this list." :group 'helm-files-faces) (defface helm-ff-dotted-directory - `((t ,@(and (>= emacs-major-version 27) '(:extend t)) - :foreground "black" :background "DimGray")) + `((((class color) (min-colors 88) (background dark)) + ,@(and (>= emacs-major-version 27) '(:extend t)) + :foreground "black" :background "DimGray") + (((class color) (min-colors 88) (background light)) + ,@(and (>= emacs-major-version 27) '(:extend t)) + :foreground "black" :background "LightGray") + (t :inherit default)) "Face used for dotted directories in `helm-find-files'." :group 'helm-files-faces) @@ -1026,7 +1037,8 @@ present in this list." (defface helm-ff-nofile `((t ,@(and (>= emacs-major-version 27) '(:extend t)) :inherit helm-ff-file)) - "Face used for file names in `helm-find-files'." + "Face used for non-files file names in `helm-find-files'. +Used when showing tramp host completions." :group 'helm-files-faces) (defface helm-ff-truename @@ -1909,7 +1921,7 @@ this working." (setq cmd-line (format command mapfiles)) ; See [1] (setq cmd-line (format "%s %s" command mapfiles))) (eshell-command cmd-line)) - + ;; Run eshell-command sequencially on EACH marked files. ;; To work with tramp handler we have to call ;; COMMAND on basename of each file, using @@ -1973,7 +1985,7 @@ this working." ;; we can just stick the new command at the end of the current ;; one, and everything will happen as it should (setcdr (last (cdr eshell-current-command)) - (list `(let ((here (and (eobp) (point)))) + (list `(let ((here (and (eobp) (point)))) ,(and input `(insert-and-inherit ,(concat input "\n"))) (if here @@ -1985,7 +1997,7 @@ this working." (insert "command: \"" input "\"\n"))) (setq eshell-current-command command) (let* ((delim (catch 'eshell-incomplete - (eshell-resume-eval))) + (eshell-resume-eval))) (val (car-safe delim))) ;; If the return value of `eshell-resume-eval' is wrapped in a ;; list, it indicates that the command was run asynchronously. @@ -2138,6 +2150,27 @@ prefix arg shell buffer doesn't exists, create it and switch to it." (length failures) (mapconcat (lambda (f) (format "- %s\n" f)) failures ""))))) +(defun helm-ff-encrypt-files (_candidate) + "Encrypt marked files." + (require 'epg) (require 'epa) (require 'helm-epa) + (let* ((mkds (helm-marked-candidates :with-wildcard t)) + (recipients (helm :sources (helm-build-sync-source + "Select recipient for encryption: " + :persistent-action 'ignore + :candidates 'helm-epa-get-key-list + :action (lambda (_candidate) + (helm-marked-candidates)) + :must-match t) + :buffer "*helm-ff epg keys*")) + (keys (and recipients (helm-epa-collect-keys-from-candidates recipients))) + (ids (and recipients (helm-epa-collect-id-from-candidates recipients)))) + (when recipients ; may be aborted by quit. + (cl-loop for f in mkds + do (epa-encrypt-file f recipients)) + (helm-epa-success-message (concat (format "%s File(s) encrypted" (length mkds)) + " with key(s):\n %s") + keys ids)))) + (helm-make-command-from-action helm-ff-run-touch-files "Used to interactively run touch file action from keyboard." 'helm-ff-touch-files) @@ -2188,7 +2221,7 @@ prefix arg shell buffer doesn't exists, create it and switch to it." when (file-directory-p r) ;; We can use this as long as this filtering function ;; is called after `helm-ff-fct' otherwise candidates - ;; may not be cons cell at first call [1]. + ;; may not be cons cell at first call [1]. collect (cons d r)) candidates)) @@ -3034,7 +3067,9 @@ hitting C-j on \"..\"." (with-helm-window (when (re-search-forward (format helm-ff-last-expanded-candidate-regexp - (concat (regexp-quote presel) "$")) + ;; The space at eol may contain a display property + ;; e.g. "-> symlink truename". + (concat (regexp-quote presel) " ?$")) nil t) (forward-line 0) (helm-mark-current-line))) @@ -3077,7 +3112,7 @@ when `helm-pattern' is equal to \"~/\"." ;; Try to shut up persistent tramp error with adb method when ;; adding tilde to path. (tramp-tolerate-tilde (equal (file-remote-p pat 'method) - tramp-adb-method)) + tramp-adb-method)) (completed-p (helm-aand (expand-file-name (substitute-in-file-name pat)) (string= (file-name-as-directory it) @@ -3398,33 +3433,6 @@ debugging purpose." ;; Tramp methods completion. (string-match helm-ff-tramp-method-regexp pattern))) -(defun helm-ff--tramp-postfixed-p (str) - "Return non nil when tramp path STR is complete." - ;; E.g.: - ;; (helm-ff--tramp-postfixed-p "/ssh:foo") - ;; => nil - ;; (helm-ff--tramp-postfixed-p "/ssh:foo:") - ;; => 10 - ;; (helm-ff--tramp-postfixed-p "/ssh:foo|sudo:") - ;; => nil - ;; (helm-ff--tramp-postfixed-p "/ssh:foo|sudo::") - ;; => 16 - (let ((methods (helm-ff--get-tramp-methods)) - result) - (save-match-data - (with-temp-buffer - (save-excursion (insert str)) - (helm-awhile (search-forward ":" nil t) - (if (save-excursion - (forward-char -1) - (or (looking-back "[/|]" (1- (point))) - (looking-back - (mapconcat (lambda (m) (format "[/|]%s" m)) methods "\\|") - (pos-bol)))) - (setq result nil) - (setq result it))))) - result)) - (defun helm-ff--tramp-multihops-p (name) (cl-loop for m in (helm-ff--get-tramp-methods) thereis (string-match (format "\\`\\(/%s:.*[|]\\).*" m) name))) @@ -3463,7 +3471,7 @@ debugging purpose." "Handle tramp filenames in `helm-pattern'." (let* ((methods (helm-ff--get-tramp-methods)) ;; Returns the position of last ":" entered. - (postfixed (helm-ff--tramp-postfixed-p pattern)) + (postfixed (file-remote-p pattern)) (reg "\\`/\\([^[/:]+\\|[^/]+]\\):.*:") cur-method tramp-name) (when (string-match "\\`/\\(-\\):" pattern) @@ -3542,8 +3550,7 @@ debugging purpose." (string= path "@@TRAMP@@") ;; An empty pattern (string= path "") - (and (string-match-p ":\\'" path) - (helm-ff--tramp-postfixed-p path)) + (file-remote-p path) ;; Check if base directory of PATH is valid. (helm-aif (file-name-directory path) ;; If PATH is a valid directory IT=PATH, @@ -3615,7 +3622,7 @@ debugging purpose." ;; Check here if directory is accessible (not working on Windows). ((and (file-directory-p path) (not (file-readable-p path))) ;; Prefix error message with @@@@ for safety - ;; (some files may match file-error See bug#2400) + ;; (some files may match file-error See bug#2400) (list (cons (format "@@@@file-error: Opening directory permission denied `%s'" path) path))) ;; A fast expansion of PATH is made only if `helm-ff-auto-update-flag' @@ -3703,21 +3710,22 @@ Add a `helm-ff-dir' property on each fname ending with \"/\"." This is used for tramp adb backend. Add a `helm-ff-dir' property on each fname ending with \"/\"." - (cl-loop with files = (helm-file-name-all-completions-internal directory) - for f in (sort files (or sort-method 'string-lessp)) - for split = (split-string f "->" t) - for fname = (replace-regexp-in-string " $" "" (car split)) - for truename = (cadr split) - collect (cond ((string-match "/\\'" fname) - (propertize (helm--dir-file-name fname directory) - 'helm-ff-dir t)) - (truename - (propertize (expand-file-name - (substring fname 0 (1- (length fname))) - directory) - 'helm-ff-sym truename)) - (t (propertize (expand-file-name fname directory) - 'helm-ff-file t))))) + (let ((inhibit-message t)) + (cl-loop with files = (helm-file-name-all-completions-internal directory) + for f in (sort files (or sort-method 'string-lessp)) + for split = (split-string f "->" t) + for fname = (replace-regexp-in-string " $" "" (car split)) + for truename = (cadr split) + collect (cond ((string-match "/\\'" fname) + (propertize (helm--dir-file-name fname directory) + 'helm-ff-dir t)) + (truename + (propertize (expand-file-name + (substring fname 0 (1- (length fname))) + directory) + 'helm-ff-sym truename)) + (t (propertize (expand-file-name fname directory) + 'helm-ff-file t)))))) (defun helm-list-dir-external (dir &optional sort-method) "List directory DIR with external shell command as backend. @@ -3770,7 +3778,7 @@ later in the transformer." ;; bug#2542. ;; Store here associations of (truename . symlink) when opening a ;; symlinked directory, then add the watch to the truename; When the -;; watcher ring on the truename remove the symlinked directory from cache. +;; watcher ring on the truename remove the symlinked directory from cache. (defvar helm-ff--list-directory-links nil) (defun helm-ff-directory-files (directory &optional force-update) @@ -3804,7 +3812,7 @@ in cache." (file-error (prog1 ;; Prefix error message with @@@@ for safety - ;; (some files may match file-error See bug#2400) + ;; (some files may match file-error See bug#2400) (list (format "@@@@%s:%s" (car err) (mapconcat 'identity (cdr err) " "))) @@ -3880,7 +3888,7 @@ Remove as well all related file-notify watchers. This is meant to run in `tramp-cleanup-connection-hook'." (cl-loop for key being the hash-keys in helm-ff--list-directory-cache - when (equal (file-remote-p key 'method) (cadr vec)) + when (equal (file-remote-p key 'method) (cadr vec)) do (remhash key helm-ff--list-directory-cache)) (cl-loop for key being the hash-keys in helm-ff--file-notify-watchers when (equal (file-remote-p key 'method) (cadr vec)) @@ -4142,8 +4150,8 @@ returned prefixed with its icon or unchanged." (if helm-ff-icon-mode (helm-acase (match-string 1 disp) ("mailto:" - (all-the-icons-octicon "mail")) - (t (all-the-icons-octicon "link-external"))) + (helm-x-icons-generic "mail")) + (t (helm-x-icons-generic "link-external"))) (propertize " " 'display (propertize "[@]" 'face 'helm-ff-prefix)))) @@ -4153,8 +4161,8 @@ returned prefixed with its icon or unchanged." (setq prefix-new (if helm-ff-icon-mode (if (string-match "/\\'" disp) - (all-the-icons-material "create_new_folder") - (all-the-icons-material "note_add")) + (helm-x-icons-generic "create_new_folder") + (helm-x-icons-generic "note_add")) (propertize " " 'display (propertize "[+]" 'face 'helm-ff-prefix)))) @@ -4250,7 +4258,8 @@ If SKIP-BORING-CHECK is non nil don't filter boring files." ;; Filename with cntrl chars e.g. foo^J (replace-regexp-in-string "[[:cntrl:]]" "?" - (if (or reverse urlp) file basename)))) + (if (or reverse urlp (and dot helm-ff-show-dot-file-path)) + file basename)))) (len (length disp)) (backup (backup-file-name-p disp))) (when (string-match "/\\'" file) @@ -4278,7 +4287,7 @@ If SKIP-BORING-CHECK is non nil don't filter boring files." (helm-acond (;; Dot directories . and .. dot (cons (helm-ff-prefix-filename - (propertize file 'face 'helm-ff-dotted-directory) + (propertize disp 'face 'helm-ff-dotted-directory) file) file)) ;; Directories. @@ -4335,7 +4344,7 @@ If SKIP-BORING-CHECK is non nil don't filter boring files." (file-error ;; Possible error not happening during listing ;; but when calling file-attributes see error - ;; with sshfs bug#2405 + ;; with sshfs bug#2405 (message "%s:%s" (car err) (cdr err)) nil))) (type (car attr)) x-bit) @@ -4354,13 +4363,13 @@ If SKIP-BORING-CHECK is non nil don't filter boring files." ;; A dotted directory symlinked. ((and dot (stringp type)) (cons (helm-ff-prefix-filename - (propertize file 'face 'helm-ff-dotted-symlink-directory) + (propertize disp 'face 'helm-ff-dotted-symlink-directory) file) file)) ;; A dotted directory. (dot (cons (helm-ff-prefix-filename - (propertize file 'face 'helm-ff-dotted-directory) + (propertize disp 'face 'helm-ff-dotted-directory) file) file)) ;; Backup files. @@ -4381,9 +4390,14 @@ If SKIP-BORING-CHECK is non nil don't filter boring files." (add-face-text-property 0 len-abbrev 'helm-ff-truename t abbrev) ;; Colorize extension only on truename. (add-face-text-property 0 len 'helm-ff-symlink nil disp) - ;; As we use match-on-real we can use this safely, - ;; abbrev will not be matched. - (cons (concat (helm-ff-prefix-filename disp file) " -> " abbrev) + (cons (concat (helm-ff-prefix-filename disp file) + ;; Displaying this in a space with display prop + ;; allows retrieving the candidate with + ;; `helm-ff-retrieve-last-expanded'. If we put + ;; the display prop on the whole candidate + ;; `helm-fuzzy-highlight-matches' don't match + ;; properly. + (propertize " " 'display (concat " -> " abbrev))) file))) ;; A directory. ((eq t type) @@ -4427,17 +4441,17 @@ If SKIP-BORING-CHECK is non nil don't filter boring files." file)))))))) (defun helm-ff-get-icon (disp file) - "Get icon from all-the-icons for FILE. + "Get icon from `helm-x-icons-provider' for FILE. Arg DISP is the display part of the candidate. Arg FILE is the real part of candidate, a filename with no props." (when helm-ff-icon-mode (let ((icon (helm-acond (;; Non symlink directories. (helm-ff--is-dir-from-disp disp) - (helm-aif (all-the-icons-match-to-alist + (helm-aif (helm-x-icons-match-to-alist (helm-basename file) - all-the-icons-dir-icon-alist) + 'dir) (apply (car it) (cdr it)) - (all-the-icons-octicon "file-directory"))) + (helm-x-icons-generic "file-directory"))) (;; All files, symlinks may be symlink directories. (helm-ff--is-file-from-disp disp) ;; Detect symlink directories. We must call @@ -4447,41 +4461,113 @@ Arg FILE is the real part of candidate, a filename with no props." (if (and (memq it '(helm-ff-symlink helm-ff-dotted-symlink-directory)) (file-directory-p file)) - (all-the-icons-octicon "file-symlink-directory") - (all-the-icons-icon-for-file (helm-basename file))))))) + (helm-x-icons-generic "file-symlink-directory") + (helm-x-icons-icon-for-file (helm-basename file))))))) (when icon (concat icon " "))))) (defun helm-ff--is-dir-from-disp (disp) "Return the face used for candidate when candidate is a directory." - (cl-loop with faces = (helm-mklist (get-text-property 0 'face disp)) - for face in '(helm-ff-directory helm-ff-dotted-directory) - thereis (memq face faces))) + (helm-aand (get-text-property 0 'face disp) + (memq it '(helm-ff-directory helm-ff-dotted-directory)) + (car it))) (defun helm-ff--is-file-from-disp (disp) "Return the face used for file's candidate or dotted-symlink dirs." - (cl-loop with faces = (helm-mklist (get-text-property 0 'face disp)) - for face in '(helm-ff-file - helm-ff-suid - helm-ff-executable - helm-ff-socket - helm-ff-pipe - helm-ff-symlink - helm-ff-dotted-symlink-directory - helm-ff-backup-file) - when (memq face faces) - return face)) + (helm-aand (get-text-property 0 'face disp) + (memq it '(helm-ff-file + helm-ff-suid + helm-ff-executable + helm-ff-socket + helm-ff-pipe + helm-ff-symlink + helm-ff-dotted-symlink-directory + helm-ff-backup-file + helm-ls-git-untracked-face)) + (car it))) ;;;###autoload (define-minor-mode helm-ff-icon-mode - "Display icons from `all-the-icons' package in HFF when enabled." + "Display icons from `helm-x-icons-provider' package in HFF when enabled." :global t :group 'helm-files (when helm-ff-icon-mode - (unless (require 'all-the-icons nil t) + (unless (require helm-x-icons-provider nil t) (setq helm-ff-icon-mode nil) - (message "All The Icons package is not installed"))) + (message "No suitable Icons package found"))) (clrhash helm-ff--list-directory-cache)) +;;; Action transformer +;; +(defun helm-ff--in-backup-directory () + (when backup-directory-alist + (cl-loop for (_p . f) in backup-directory-alist + thereis (file-equal-p f helm-ff-default-directory)))) + +(defun helm-ff-restore-backups (_candidate) + (let ((mkd (helm-marked-candidates)) + (copied 0) + ovw) + (cl-dolist (file mkd) + (let (dest) + (when (string-match "\\(?:\\`\\([!]\\)[^!]*\\1.*\\)\\|\\(?:~\\'\\)" + (helm-basename file)) + (setq dest (helm-aand (replace-regexp-in-string + "\\.~[[:digit:]]*~?" + "" (helm-basename file)) + (helm-ff--normalize-backup-name it) + (if (string-match "\\`/" it) + it + ;; If basename doesn't contain now + ;; "/", that's mean it was a backup file + ;; stored in current directory, just + ;; expand it to this directory. + (expand-file-name it helm-ff-default-directory)))) + (if (and (file-exists-p dest) (null ovw)) + (helm-acase (helm-read-answer + (format "Overwrite `%s' (answer [y,n,!,q])? " dest) + '("y" "n" "!" "q")) + ("y" (cl-incf copied) (copy-file file dest t t t t)) + ("n" (ignore)) + ("!" (setq ovw t) (cl-incf copied) (copy-file file dest t t t t)) + ("q" (setq copied nil) (cl-return (message "Abort restoring files")))) + (cl-incf copied) + (copy-file file dest t t t t))))) + (when (numberp copied) + (message "(%s/%s) files copied" copied (length mkd))))) + +(defun helm-ff--normalize-backup-name (fname) + "Normalize backup FNAME to its original name." + ;; When Emacs build a backup filename for the backup directory it + ;; replace "/" by "!" in the basedir of file and double the "!" in + ;; the basename, this is done by `make-backup-file-name-1'. We want + ;; to replace only the "!" in the basedir part of FNAME. + (with-temp-buffer + (insert fname) + (goto-char (point-min)) + (save-excursion + (when (looking-at "!") (replace-match "/")) + (while (re-search-forward "[^!]\\([!]\\)[^!]" nil t) + (replace-match "/" nil nil nil 1))) + (let ((count 0) rep) + (while (re-search-forward "!" nil t) + (cl-incf count)) + (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 @@ -4490,6 +4576,11 @@ Arg FILE is the real part of candidate, a filename with no props." (when (file-regular-p candidate) (setq actions (helm-append-at-nth actions '(("Checksum File" . helm-ff-checksum)) 4))) + (when (file-exists-p (expand-file-name + (format "#%s#" (helm-basename candidate)) + (helm-basedir candidate))) + (setq actions (helm-append-at-nth + actions '(("Recover file" . recover-file)) 4))) (cond ((and (file-exists-p candidate) (string-match helm-ff--trash-directory-regexp (helm-basedir (expand-file-name candidate))) @@ -4508,16 +4599,31 @@ Arg FILE is the real part of candidate, a filename with no props." ((string-match (image-file-name-regexp) candidate) (helm-append-at-nth actions - '(("Rotate image right `M-r'" . helm-ff-rotate-image-right) - ("Rotate image left `M-l'" . helm-ff-rotate-image-left) - ("Start slideshow with marked" . helm-ff-start-slideshow-on-marked)) + (helm-make-actions + "Rotate image right `M-r'" 'helm-ff-rotate-image-right + "Rotate image left `M-l'" 'helm-ff-rotate-image-left + "Start slideshow with marked" 'helm-ff-start-slideshow-on-marked + (lambda () + (and (fboundp 'image-dired-wallpaper-set) + (display-graphic-p) + "Change wall paper")) + 'image-dired-wallpaper-set) 3)) ((string-match "\\.el\\'" candidate) (helm-append-at-nth actions - '(("Byte compile lisp file(s) `M-B, C-u to load'" + `(("Byte compile lisp file(s) `M-B, C-u to load'" . helm-find-files-byte-compile) - ("Load File(s) `M-L'" . helm-find-files-load-files)) + ("Byte compile file(s) async" + . ,(lambda (_candidate) + (cl-loop for file in (helm-marked-candidates) + do (async-byte-compile-file file)))) + ("Byte recompile directory async" + . ,(lambda (_) + (async-byte-recompile-directory + helm-ff-default-directory))) + ("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 @@ -4528,6 +4634,12 @@ Arg FILE is the real part of candidate, a filename with no props." (file-exists-p candidate)) (helm-append-at-nth actions '(("Browse url file" . browse-url-of-file)) 2)) + ((and (helm-ff--in-backup-directory) + (cl-loop for file in (helm-marked-candidates) + always (string-match "\\(?:\\`\\([!]\\)[^!]*\\1.*\\)\\|\\(?:~\\'\\)" + (helm-basename file)))) + (helm-append-at-nth + actions '(("Restore backup file(s)" . helm-ff-restore-backups)) 1)) (t actions)))) ;;; Trashing files @@ -4659,7 +4771,7 @@ with `helm-ff-trash-list'." (cl-defun helm-ff-trash-list (&optional (trash-dir nil strash-dir)) "Return an alist of trashed files basename and dest name. Assume the trash system in use is freedesktop compatible, see - + This function is intended to be used from a trash directory i.e. it use `helm-ff-default-directory', but it may be used elsewhere by specifying the trash directory with TRASH-DIR arg." @@ -4868,7 +4980,7 @@ This affects directly file CANDIDATE." (ext (file-name-extension candidate))) (and file (or image (not (member ext helm-ff-follow-blacklist-file-exts)))))) - + (cl-defun helm-find-files-persistent-action-if (candidate) "Open subtree CANDIDATE without quitting helm. If CANDIDATE is not a directory expand CANDIDATE filename. @@ -5005,17 +5117,6 @@ file." (cons (lambda (_candidate) (funcall insert-in-minibuffer (concat candidate "#/"))) 'never-split)) - ;; File doesn't exists and basename starts with ".." or " ", - ;; Start a recursive search for directories. - ((and (not (file-exists-p candidate)) - (not (file-remote-p candidate)) - (string-match-p "\\`\\([.]\\|\\s-\\)\\{2\\}[^/]+" - (helm-basename candidate))) - ;; As soon as the final "/" is added the job is passed - ;; to `helm-ff-auto-expand-to-home-or-root'. - (cons (lambda (_candidate) - (funcall insert-in-minibuffer (concat candidate "/"))) - 'never-split)) ;; File is not existing and have no basedir, typically when ;; user hit C-k (minibuffer is empty) and then write foo and ;; hit C-j. This make clear that when no basedir, helm will @@ -5248,7 +5349,7 @@ Special commands: (cons disp img)) else collect (cons disp img)) ;; Ensure this is done AFTER previous clause otherwise thumb files will - ;; never be created if they don't already exist. + ;; never be created if they don't already exist. (cl-pushnew helm-ff-default-directory helm-ff--thumbnailed-directories :test 'equal)) candidates)) @@ -5288,7 +5389,6 @@ Special commands: (when helm-ff--show-thumbnails (message "Loading thumbnails...") (with-helm-after-update-hook - (sit-for 1) (message "Loading thumbnails done"))) (when (and (null helm-ff--show-thumbnails) (member helm-ff-default-directory @@ -5335,23 +5435,28 @@ image file in `helm-ff-image-dired-thumbnails-cache'." (helm :sources (helm-make-source "Recursive directories" 'helm-locate-subdirs-source + :header-name + (lambda (name) + (format "%s from `%s'" + name + (abbreviate-file-name helm-ff-default-directory))) :basedir (if (string-match-p "\\`es" helm-locate-recursive-dirs-command) directory (shell-quote-argument directory)) :subdir (shell-quote-argument input) :candidate-transformer - `((lambda (candidates) - (cl-loop for c in candidates - when (and (file-directory-p c) - (null (helm-boring-directory-p - c helm-boring-file-regexp-list)) - (string-match-p ,(regexp-quote input) - (helm-basename c))) - collect (propertize c 'face 'helm-ff-dirs))) + `(,(lambda (candidates) + (cl-loop for c in candidates + when (and (file-directory-p c) + (null (helm-boring-directory-p + c helm-boring-file-regexp-list)) + (string-match-p (regexp-quote input) + (helm-basename c))) + collect (propertize c 'face 'helm-ff-dirs))) helm-w32-pathname-transformer - (lambda (candidates) - (helm-ff-sort-candidates-1 candidates ,input))) + ,(lambda (candidates) + (helm-ff-sort-candidates-1 candidates input))) :persistent-action 'ignore :action (lambda (c) (helm-set-pattern @@ -5487,69 +5592,81 @@ Show the first `helm-ff-history-max-length' elements of helm-ff-history)))) (put 'helm-find-files-history 'helm-only t) -(defvar helm-ff-drag-mouse-1-default-action 'copy - "Default action when dragging files. -Possible values are `copy', `rsync' or `rename'.") - -(defvar helm-ff-drag-and-drop-default-directory nil - "Default directory where to drop files on a drag-and-drop action. -It is used when no suitable directory is found at drop place, -generally when dropping outside of an emacs frame. -You want generally to set this to your home desktop directory.") - -(defun helm-ff-drag-mouse-1-fn (event) - "Drag-and-drop function for `helm-find-files'. -Allows dropping marked files to another frame or window. -When dropping to another frame (i.e. not the selected one where helm -is running), you are asked for which directory you want to drop to when frame -displays more than one window. -When no suitable place to drop is found ask to drop to -`helm-ff-drag-and-drop-default-directory' if set." +;; The `helm-drag-mouse-1-fn' for helm-find-files, it is bound to +;; in `helm--bind-mouse-for-selection'. +;; See https://freedesktop.org/wiki/Specifications/XDND/ +;; and (info "(elisp) Drag and Drop") for more infos. +(defun helm-ff-mouse-drag (event) + "Drag-and-drop marked files at EVENT. + +It is the drag-an-drop function of dired adapted for helm-find-files." (interactive "e") - (cl-assert (memq helm-ff-drag-mouse-1-default-action - '(copy rsync rename))) - (let* ((win-or-frame (posn-window (event-end event))) - (target-frame (when (framep win-or-frame) - (car (mouse-pixel-position)))) - (target (with-selected-window - (if target-frame - (frame-selected-window target-frame) - win-or-frame) - default-directory)) - (windows (and target-frame - (remove (helm-window) - (window-list target-frame 1))))) - (when windows - (setq target - (helm-acond ((cdr windows) - (x-popup-menu - t (list "Choose target" - (cons "" - (cl-loop for win in windows - for dir = (with-selected-window - win default-directory) - collect (cons dir dir)))))) - ((and (eql (window-buffer (car windows)) - helm-current-buffer) - helm-ff-drag-and-drop-default-directory) - (x-popup-menu - t (list "Choose target" - (cons "" - (list (cons it it)))))) - ((car windows) - (with-selected-window it default-directory))))) - (if (memq helm-ff-drag-mouse-1-default-action '(copy rsync)) - (helm-find-files-do-action - helm-ff-drag-mouse-1-default-action target) - (helm-run-after-exit - #'helm-find-files-do-action - helm-ff-drag-mouse-1-default-action target)))) + (when mark-active (deactivate-mark)) + (let ((action helm-ff-drag-mouse-1-default-action)) + (save-excursion + (with-selected-window (posn-window (event-end event)) + (goto-char (posn-point (event-end event)))) + (track-mouse + (let ((beginning-position (mouse-pixel-position)) + new-event) + (catch 'track-again + (setq new-event (read-event)) + (if (not (eq (event-basic-type new-event) 'mouse-movement)) + (when (eq (event-basic-type new-event) 'mouse-1) + (push new-event unread-command-events)) + (let ((current-position (mouse-pixel-position))) + ;; If the mouse didn't move far enough, don't + ;; inadvertently trigger a drag. + (when (and (eq (car current-position) (car beginning-position)) + (ignore-errors + (and (> 3 (abs (- (cadr beginning-position) + (cadr current-position)))) + (> 3 (abs (- (caddr beginning-position) + (caddr current-position))))))) + (throw 'track-again nil))) + ;; We can get an error if there's by some chance no file + ;; name at point. + (condition-case error + (let ((files (with-helm-window (helm-marked-candidates)))) + (dnd-begin-drag-files files nil action t)) + (error (when (eq (event-basic-type new-event) 'mouse-1) + (push new-event unread-command-events)) + ;; Errors from `dnd-begin-drag-files' should be + ;; treated as user errors, since they should + ;; only occur when the user performs an invalid + ;; action, such as trying to create a link to + ;; a remote file. + (user-error (cadr error))))))))))) +(put 'helm-ff-mouse-drag 'helm-only t) + +(defvar helm-dnd-protocol-alist + '(("^file:///" . helm-dnd-handle-local-file) + ("^file://" . helm-dnd-handle-file) + ("^file:" . helm-dnd-handle-local-file)) + "The functions to call when dropping to helm-buffer. +Prevent dropping to helm buffer when user starts a drag-and-drop action +and release the mouse in this same buffer.") + +(defun helm-dnd-handle-local-file (_uri _action) + "Prevent dropping files to helm buffer." + (user-error "Can't drop files in helm buffer")) +(defun helm-dnd-handle-file (_uri _action) + "Prevent dropping files to helm buffer." + (user-error "Can't drop files in helm buffer")) + +;; This is used to advice `x-dnd-handle-drag-n-drop-event'. +(defun helm-ff--restore-frame (&rest _args) + (let ((hframe (window-frame (helm-window)))) + (if (eql (selected-frame) hframe) + (select-window (active-minibuffer-window)) + (select-frame hframe)))) (defun helm-find-files-1 (fname &optional preselect) "Find FNAME filename with PRESELECT filename preselected. Use it for non-interactive calls of `helm-find-files'." (require 'tramp) + (require 'dnd) ;; Resolve FNAME now outside of helm. ;; [FIXME] When `helm-find-files-1' is used directly from lisp ;; and FNAME is an abbreviated path, for some reasons @@ -5571,8 +5688,12 @@ Use it for non-interactive calls of `helm-find-files'." ;; Ensure not being prompted for password each time we ;; navigate to a directory. (password-cache t)) - (helm-set-local-variable 'helm-follow-mode-persistent nil - 'helm-drag-mouse-1-fn 'helm-ff-drag-mouse-1-fn) + (helm-set-local-variable 'helm-follow-mode-persistent nil) + (when (fboundp 'dnd-begin-drag-files) + (helm-set-local-variable 'helm-drag-mouse-1-fn 'helm-ff-mouse-drag + 'dnd-protocol-alist + (append helm-dnd-protocol-alist dnd-protocol-alist)) + (advice-add 'x-dnd-handle-drag-n-drop-event :after #'helm-ff--restore-frame)) (unless helm-source-find-files (setq helm-source-find-files (helm-make-source "Find Files" 'helm-source-ffiles))) @@ -5605,7 +5726,8 @@ Use it for non-interactive calls of `helm-find-files'." :prompt "Find files or url: " :buffer "*helm find files*") (helm-ff--update-resume-after-hook nil t) - (setq helm-ff-default-directory nil)))) + (setq helm-ff-default-directory nil) + (advice-remove 'x-dnd-handle-drag-n-drop-event 'helm-ff--restore-frame)))) (defvar helm-find-files-dummy-source (helm-build-dummy-source "New file or directory" @@ -5615,12 +5737,38 @@ Use it for non-interactive calls of `helm-find-files'." (list (helm-ff-filter-candidate-one-by-one helm-pattern nil t)))) :all-marked t :keymap 'helm-find-files-map - :action 'helm-find-files-actions)) + :action 'helm-find-files-actions + :action-transformer 'helm-find-files-dummy-action-transformer)) + +(defun helm-find-files-dummy-action-transformer (actions candidate) + "Action transformer for `helm-find-files-dummy-source'." + (let (cand-no-linum linum) + (cond ((and helm--url-regexp + (not (string-match-p helm--url-regexp candidate)) + (string-match "\\(:[[:digit:]]+:?\\)\\'" candidate) + (file-exists-p + (setq cand-no-linum (replace-match "" t t candidate 1)))) + (setq linum (replace-regexp-in-string + ":" "" (match-string 1 candidate))) + (helm-append-at-nth + actions + `(("Find file to line number" + . ,(lambda (_candidate) + (find-file cand-no-linum) + (helm-goto-line (string-to-number linum) t)))) + 1)) + (t actions)))) (defun helm-ff--update-resume-after-hook (sources &optional nohook) "Meant to be used in `helm-resume-after-hook'. When NOHOOK is non-nil run inconditionally, otherwise only when source is `helm-source-find-files'." + ;; When using the action `helm-find-files-load-files' on helm-files.el, + ;; `helm-source-find-files' is reseted to nil hence error when calling + ;; `helm-set-attr' outside helm => "no buffer named *helm*". + (unless helm-source-find-files + (setq helm-source-find-files (helm-make-source + "Find Files" 'helm-source-ffiles))) (when (or nohook (string= "Find Files" (assoc-default 'name (car sources)))) (helm-set-attr 'resume `(lambda () @@ -6114,15 +6262,15 @@ Return the \"files\" subdirectory of trash directory. When `helm-trash-default-directory' is set use it as trash directory." (let* ((xdg-data-dir (or helm-trash-default-directory - (directory-file-name - (expand-file-name "Trash" - (or (getenv "XDG_DATA_HOME") - "~/.local/share"))))) + (directory-file-name + (expand-file-name "Trash" + (or (getenv "XDG_DATA_HOME") + "~/.local/share"))))) (trash-files-dir (expand-file-name "files" xdg-data-dir))) ;; Just return nil if the Trash directory is not yet created. It will be ;; created later by `delete-directory'. (and (file-exists-p trash-files-dir) trash-files-dir))) - + (cl-defun helm-ff-file-already-trashed (file &optional (trash-alist nil strash-alist)) "Return FILE when it is already in trash. @@ -6218,17 +6366,8 @@ is nil." (let ((helm--reading-passwd-or-string t) (file-attrs (file-attributes file)) (trash (or trash (helm-ff--delete-by-moving-to-trash file))) - (delete-by-moving-to-trash trash) - (already-trashed - (and trash (helm-ff-file-already-trashed - file helm-ff--trashed-files)))) - (cond (already-trashed - ;; We use message here to avoid exiting loop when - ;; deleting more than one file. - (message "User error: `%s' is already trashed" file) - (sit-for 1.5) - (cl-return 'skip)) - ((and (eq (nth 0 file-attrs) t) ; a not empty directory. + (delete-by-moving-to-trash trash)) + (cond ((and (eq (nth 0 file-attrs) t) ; a not empty directory. (directory-files file t directory-files-no-dot-files-regexp)) (if (or helm-ff-allow-recursive-deletes trash) (delete-directory file 'recursive trash) @@ -6333,22 +6472,18 @@ directories are always deleted with no warnings." (let* ((files (helm-marked-candidates :with-wildcard t)) (trash (helm-ff--delete-by-moving-to-trash (car files))) (prmt (if trash "Trash" "Delete")) - buffers callback already-trashed + buffers callback ;; Workaround emacs-26 bug with tramp see ;; https://github.com/jwiegley/emacs-async/issues/80. (async-quiet-switch "-q")) - (cl-loop with trash-alist = (and trash (helm-ff-trash-list (helm-trash-directory))) - for f in files + (cl-loop for f in files for buf = (helm-file-buffers f) - for trashed = (helm-ff-file-already-trashed f trash-alist) for dot-file-p = (helm-ff-dot-file-p f) when (and helm-ff-signal-error-on-dot-files dot-file-p) do (cl-return (error "Error: Cannot operate on `.' or `..'")) when buf - do (setq buffers (nconc buf buffers)) - when trashed - do (push trashed already-trashed)) + do (setq buffers (nconc buf buffers))) (setq callback (lambda (result) (unless (dired-async-processes 'helm-delete-async) (helm-ff--delete-async-modeline-mode -1)) @@ -6392,11 +6527,7 @@ directories are always deleted with no warnings." (let ((result 0)) (dolist (file ',files result) (condition-case err - (cond ((and ,trash - (cl-loop for f in ',already-trashed - thereis (file-equal-p f file))) - (error (format "`%s' is already trashed" file))) - ((eq (nth 0 (file-attributes file)) t) + (cond ((eq (nth 0 (file-attributes file)) t) (delete-directory file 'recursive ,trash) (setq result (1+ result))) (t (delete-file file ,trash) @@ -6548,11 +6679,11 @@ list." (helm-aif (slot-value source 'candidate-transformer) (setf (slot-value source 'candidate-transformer) (append (helm-mklist it) - (list (lambda (candidates) - (cl-loop for c in candidates - when (and (not (string= c "")) - (file-exists-p c)) - collect c))))))) + `(,(lambda (candidates) + (cl-loop for c in candidates + when (and (not (string= c "")) + (file-exists-p c)) + collect c))))))) (defun helm-find-files-in-file-build-source (file) (helm-make-source @@ -6636,7 +6767,7 @@ be existing directories." (dired-async--modeline-mode -1)) (run-with-idle-timer 0.1 nil - (lambda () + (lambda () (dired-async-mode-line-message "Mcp done, %s %s of %s done, %s files skipped" 'dired-async-message @@ -6682,13 +6813,18 @@ be existing directories." ;; and we don't want to introduce duplicates. (add-to-history 'file-name-history (abbreviate-file-name - (expand-file-name sel)))))))) + (expand-file-name + ;; See comments in `helm-recentf-source' + ;; about bug#2709. + (substring-no-properties sel))))))))) (add-hook 'helm-exit-minibuffer-hook 'helm-files-save-file-name-history) (defvar helm-source-file-name-history (helm-build-sync-source "File Name History" :candidates 'file-name-history :persistent-action #'ignore + ;; See comments in `helm-recentf-source' about bug#2709. + :coerce 'substring-no-properties :filtered-candidate-transformer #'helm-file-name-history-transformer :action 'helm-type-file-actions)) @@ -6727,7 +6863,7 @@ be existing directories." (propertize c 'face 'helm-history-deleted)))) when disp collect (cons (if helm-ff-icon-mode - (concat (all-the-icons-icon-for-file + (concat (helm-x-icons-icon-for-file (helm-basename elm)) " " disp) disp) @@ -6868,10 +7004,7 @@ Use FD as backend." "Run `helm-grep' AG from `helm-browse-project'." 'helm-browse-project-ag) -(defclass helm-browse-project-override-inheritor (helm-type-file) ()) - -(defclass helm-browse-project-source (helm-source-in-buffer - helm-browse-project-override-inheritor) +(defclass helm-browse-project-source (helm-source-in-buffer helm-type-file) ((root-dir :initarg :root-dir :initform nil :custom 'file) @@ -6891,7 +7024,7 @@ Use FD as backend." "Class to define a source in `helm-browse-project' handling non VC handled directories.") -(cl-defmethod helm--setup-source :after ((source helm-browse-project-override-inheritor)) +(cl-defmethod helm--setup-source :after ((source helm-browse-project-source)) (let ((actions (slot-value source 'action))) (setf (slot-value source 'action) (helm-append-at-nth @@ -6924,15 +7057,30 @@ VC handled directories.") ;;;###autoload (defun helm-projects-history (&optional arg) - "Jump to project already visisted with `helm-browse-project'." + "Jump to project already visisted with `helm-browse-project'. +Prefix arg allows browsing files recursively under a project not handled +by git or hg, otherwise it has no effect." (interactive "P") + (setq helm-browse-project-history + (cl-loop for p in helm-browse-project-history + when (file-directory-p p) + collect p)) (helm :sources (helm-build-sync-source "Project history" :candidates helm-browse-project-history - :action (lambda (candidate) - (with-helm-default-directory candidate - (helm-browse-project - (or arg helm-current-prefix-arg))))) + :action (helm-make-actions + "Browse project" + (lambda (candidate) + (with-helm-default-directory candidate + (helm-browse-project + (or arg helm-current-prefix-arg)))) + "Remove project(s)" + (lambda (_candidate) + (let ((mkd (helm-marked-candidates))) + (cl-loop for c in mkd do + (setq helm-browse-project-history + (delete c helm-browse-project-history))) + (message "%s projects removed" (length mkd)))))) :buffer "*helm browse project history*")) ;;;###autoload diff --git a/elpa/helm-20241224.1937/helm-find.el b/elpa/helm-20250515.548/helm-find.el similarity index 82% rename from elpa/helm-20241224.1937/helm-find.el rename to elpa/helm-20250515.548/helm-find.el index bdf6d8ac..26005339 100644 --- a/elpa/helm-20241224.1937/helm-find.el +++ b/elpa/helm-20250515.548/helm-find.el @@ -1,6 +1,6 @@ ;;; helm-find.el --- helm interface for find command. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -37,6 +37,18 @@ I.e. use the -path/ipath arguments of find instead of :group 'helm-files :type 'boolean) +(defcustom helm-find-show-full-path-fn #'identity + "Function used in transformer to show the full path of candidate. +You may want to show the relative path or the abbreviated path instead of the +full path. The basename is accessible with +\\\\[helm-ff-run-toggle-basename], so no need to use a function +that display the basename of candidate here." + :group 'helm-files + :type '(choice + (const :tag "Display absolute path" identity) + (const :tag "Display relative path" file-relative-name) + (const :tag "Display abbreviated path" abbreviate-file-name))) + (defvar helm-find-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-generic-files-map) @@ -65,17 +77,16 @@ I.e. use the -path/ipath arguments of find instead of (helm-aif (file-remote-p default-directory) (concat it i) i)) for type = (car (file-attributes abs)) - for disp = (if (and helm-ff-transformer-show-only-basename - (not (string-match "[.]\\{1,2\\}$" i))) - (helm-basename abs) abs) - collect (cond ((eq t type) - (cons (propertize disp 'face 'helm-ff-directory) - abs)) - ((stringp type) - (cons (propertize disp 'face 'helm-ff-symlink) - abs)) - (t (cons (propertize disp 'face 'helm-ff-file) - abs)))))) + for fname = (if (and helm-ff-transformer-show-only-basename + (not (string-match "[.]\\{1,2\\}$" i))) + (helm-basename abs) + (funcall helm-find-show-full-path-fn abs)) + for disp = (helm-acase type + ('t (propertize fname 'face 'helm-ff-directory)) + ((guard* (stringp it)) + (propertize fname 'face 'helm-ff-symlink)) + (otherwise (propertize fname 'face 'helm-ff-file))) + collect (cons (helm-ff-prefix-filename disp abs) abs)))) (defun helm-find--build-cmd-line () (require 'find-cmd) diff --git a/elpa/helm-20241224.1937/helm-font.el b/elpa/helm-20250515.548/helm-font.el similarity index 96% rename from elpa/helm-20241224.1937/helm-font.el rename to elpa/helm-20250515.548/helm-font.el index 9d43ffae..6e3cef5d 100644 --- a/elpa/helm-20241224.1937/helm-font.el +++ b/elpa/helm-20250515.548/helm-font.el @@ -1,6 +1,6 @@ ;;; helm-font --- Font and ucs selection for Helm -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -78,12 +78,12 @@ ;; Save current font so it can be restored in cleanup (setq helm-previous-font (cdr (assq 'font (frame-parameters))))) :candidates 'helm-xfonts-cache - :action '(("Copy font to kill ring" . (lambda (elm) - (kill-new elm))) - ("Set font" . (lambda (elm) - (kill-new elm) - (set-frame-font elm 'keep-size) - (message "Font copied to kill ring")))) + :action `(("Copy font to kill ring" . ,(lambda (elm) + (kill-new elm))) + ("Set font" . ,(lambda (elm) + (kill-new elm) + (set-frame-font elm 'keep-size) + (message "Font copied to kill ring")))) :cleanup (lambda () ;; Restore previous font (set-frame-font helm-previous-font 'keep-size)) diff --git a/elpa/helm-20241224.1937/helm-for-files.el b/elpa/helm-20250515.548/helm-for-files.el similarity index 68% rename from elpa/helm-20241224.1937/helm-for-files.el rename to elpa/helm-20250515.548/helm-for-files.el index 0d55db92..e5c3beef 100644 --- a/elpa/helm-20241224.1937/helm-for-files.el +++ b/elpa/helm-20250515.548/helm-for-files.el @@ -1,6 +1,6 @@ ;;; helm-for-files.el --- helm-for-files and related. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -21,6 +21,8 @@ (require 'helm-external) (require 'helm-bookmark) +(defvar recentf-list) + (defcustom helm-multi-files-toggle-locate-binding "C-c p" "Default binding to switch back and forth locate in `helm-multi-files'." :group 'helm-files @@ -97,6 +99,7 @@ Be aware that a nil value will make tramp display very slow." ;; ;; (defvar helm-recentf--basename-flag nil) +(defvar helm-recentf-cache nil) (defun helm-recentf-pattern-transformer (pattern) (let ((pattern-no-flag (replace-regexp-in-string " -b" "" pattern))) @@ -118,13 +121,23 @@ Be aware that a nil value will make tramp display very slow." (defclass helm-recentf-source (helm-source-sync helm-type-file) ((init :initform (lambda () (require 'recentf) - (when helm-turn-on-recentf (recentf-mode 1)))) - (candidates :initform (lambda () recentf-list)) + (when helm-turn-on-recentf (recentf-mode 1)) + ;; Use a copy of not recentf-list itself but the of its + ;; elements to not corrupt them with text props. + (setq helm-recentf-cache (helm-copy-sequence recentf-list)))) + (candidates :initform 'helm-recentf-cache) (pattern-transformer :initform 'helm-recentf-pattern-transformer) (match-part :initform (lambda (candidate) (if (or helm-ff-transformer-show-only-basename helm-recentf--basename-flag) (helm-basename candidate) candidate))) + ;; When real candidate is equal to display it gets corrupted with the text + ;; properties added by the transformer, so ensure to strip out properties + ;; before passing the candidate to action otherwise recentf will save the + ;; candidate passed to find-file with the properties and corrupt + ;; recentf-list. This happen when abbreviate-file-name is passed to a + ;; candidate with no leading "~" e.g. "/foo" bug#2709. + (coerce :initform 'substring-no-properties) (migemo :initform t) (persistent-action :initform 'helm-ff-kill-or-find-buffer-fname))) @@ -153,25 +166,37 @@ small.") :fuzzy-match val))))) -;;; Files in current dir +;;; Transformer for helm-type-file ;; ;; -(defun helm-highlight-files (files _source) +(defvar helm-sources-for-files-no-basename '("Recentf" "File Cache")) + +;; Function `helm-highlight-files' is used in type `helm-type-file'. Ensure that +;; the definition is available for clients, should they need it. +;; See https://github.com/bbatsov/helm-projectile/issues/184. +;;;###autoload +(defun helm-highlight-files (files source) "A basic transformer for helm files sources. Colorize only symlinks, directories and files." (cl-loop with mp-fn = (or (assoc-default 'match-part (helm-get-current-source)) 'identity) + with sname = (helm-get-attr 'name source) for i in files - for disp = (if (and helm-ff-transformer-show-only-basename - (not (helm-ff-dot-file-p i)) - (not (and helm--url-regexp - (string-match helm--url-regexp i))) - (not (string-match helm-ff-url-regexp i))) + for disp = (if (or (and (not helm-ff-show-dot-file-path) + (helm-ff-dot-file-p i)) + (and helm-ff-transformer-show-only-basename + (not (member sname + helm-sources-for-files-no-basename)) + (not (helm-ff-dot-file-p i)) + (not (and helm--url-regexp + (string-match helm--url-regexp i))) + (not (string-match helm-ff-url-regexp i)))) (helm-basename i) (abbreviate-file-name i)) for isremote = (or (file-remote-p i) (helm-file-on-mounted-network-p i)) - ;; Call file-attributes only if: + ;; file-attributes is too slow on remote files, + ;; so call it only if: ;; - file is not remote ;; - helm-for-files--tramp-not-fancy is nil and file is remote AND ;; connected. (Bug#1679) @@ -180,32 +205,47 @@ Colorize only symlinks, directories and files." (file-remote-p i nil t))) (car (file-attributes i))) collect - (cond ((and (null type) isremote) (cons disp i)) - ((stringp type) - (cons (propertize disp - 'face 'helm-ff-symlink - 'match-part (funcall mp-fn disp) - 'help-echo (expand-file-name i)) - i)) - ((eq type t) - (cons (propertize disp - 'face 'helm-ff-directory - 'match-part (funcall mp-fn disp) - 'help-echo (expand-file-name i)) - i)) - (t (let* ((ext (helm-file-name-extension disp)) - (disp (propertize disp - 'face 'helm-ff-file - 'match-part (funcall mp-fn disp) - 'help-echo (expand-file-name i)))) + (cond (;; No fancy display on remote files with basic predicates. + (and (null type) isremote) (cons disp i)) + (;; Symlinks + (stringp type) + (add-text-properties 0 (length disp) `(face helm-ff-symlink + match-part ,(funcall mp-fn disp) + help-echo ,(expand-file-name i)) + disp) + (cons (helm-ff-prefix-filename disp i) i)) + (;; Dotted dirs + (and (eq type t) (helm-ff-dot-file-p i)) + (add-text-properties 0 (length disp) `(face helm-ff-dotted-directory + match-part ,(funcall mp-fn disp) + help-echo ,(expand-file-name i)) + disp) + (cons (helm-ff-prefix-filename disp i) i)) + (;; Dirs + (eq type t) + (add-text-properties 0 (length disp) `(face helm-ff-directory + match-part ,(funcall mp-fn disp) + help-echo ,(expand-file-name i)) + disp) + (cons (helm-ff-prefix-filename disp i) i)) + (t ;; Files. + (add-text-properties 0 (length disp) `(face helm-ff-file + match-part ,(funcall mp-fn disp) + help-echo ,(expand-file-name i)) + disp) + (helm-aif (helm-file-name-extension disp) (when (condition-case _err - (string-match (format "\\.\\(%s\\)$" ext) disp) + (string-match (format "\\.\\(%s\\)\\'" it) disp) (invalid-regexp nil)) (add-face-text-property (match-beginning 1) (match-end 1) - 'helm-ff-file-extension nil disp)) - (cons disp i)))))) + 'helm-ff-file-extension t disp))) + (cons (helm-ff-prefix-filename disp i) i))))) + +;;; Files in current dir +;; +;; (defclass helm-files-in-current-dir-source (helm-source-sync helm-type-file) ((candidates :initform (lambda () (with-helm-current-buffer @@ -218,11 +258,24 @@ Colorize only symlinks, directories and files." helm-recentf--basename-flag) (helm-basename candidate) candidate))) (fuzzy-match :initform t) + (popup-info :initform (lambda (candidate) + (unless (helm-ff-dot-file-p candidate) + (helm-file-attributes + candidate + :dired t :human-size t :octal nil)))) (migemo :initform t))) +(cl-defmethod helm--setup-source :after ((source helm-files-in-current-dir-source)) + (helm-aif (slot-value source 'filtered-candidate-transformer) + (setf (slot-value source 'filtered-candidate-transformer) + (append '(helm-ff-sort-candidates) (helm-mklist it))))) + (defvar helm-source-files-in-current-dir (helm-make-source "Files from Current Directory" - 'helm-files-in-current-dir-source)) + 'helm-files-in-current-dir-source + :header-name (lambda (_name) + (format "Files from `%s'" + (abbreviate-file-name (helm-default-directory)))))) ;;;###autoload (defun helm-for-files () @@ -275,7 +328,8 @@ searching for is already found." (when (and helm-locate-fuzzy-match (not (string-match-p "\\s-" helm-pattern))) - (helm-redisplay-buffer))))) + (helm-redisplay-buffer)))) + 'helm-ff-transformer-show-only-basename nil) (let ((sources (remove 'helm-source-locate helm-for-files-preferred-list)) (helm-locate-command (if helm-locate-fuzzy-match @@ -291,7 +345,6 @@ searching for is already found." 'helm-multi-files-toggle-to-locate)) (unwind-protect (helm :sources sources - :ff-transformer-show-only-basename nil :buffer "*helm multi files*" :truncate-lines helm-buffers-truncate-lines) (define-key helm-map (kbd helm-multi-files-toggle-locate-binding) diff --git a/elpa/helm-20241224.1937/helm-global-bindings.el b/elpa/helm-20250515.548/helm-global-bindings.el similarity index 98% rename from elpa/helm-20241224.1937/helm-global-bindings.el rename to elpa/helm-20250515.548/helm-global-bindings.el index 824f2ca0..f24dc7b6 100644 --- a/elpa/helm-20241224.1937/helm-global-bindings.el +++ b/elpa/helm-20250515.548/helm-global-bindings.el @@ -1,6 +1,6 @@ ;;; helm-global-bindings.el --- Bind global helm commands -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-grep.el b/elpa/helm-20250515.548/helm-grep.el similarity index 99% rename from elpa/helm-20241224.1937/helm-grep.el rename to elpa/helm-20250515.548/helm-grep.el index f3547091..6bd54d58 100644 --- a/elpa/helm-20241224.1937/helm-grep.el +++ b/elpa/helm-20250515.548/helm-grep.el @@ -1,6 +1,6 @@ ;;; helm-grep.el --- Helm Incremental Grep. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -298,7 +298,7 @@ value used in `helm-grep-ag-command'. Note also that by default the \"--\" option is always used, you don't need to add it here. - + You probably don't need to use this unless you know what you are doing." :type '(repeat string)) @@ -830,6 +830,7 @@ If N is positive go forward otherwise go backward." (interactive) (with-helm-window (helm-goto-next-or-prec-file 1))) +(put 'helm-goto-next-file 'helm-only t) (helm-make-command-from-action helm-grep-run-default-action "Run grep default action from `helm-do-grep-1'." @@ -930,11 +931,11 @@ RESET non-nil means rewind to the first match. This is the `next-error-function' for `helm-grep-mode'." (interactive "p") (goto-char (cond (reset (point-min)) - ((and (< argp 0) helm-current-error) + ((and (< argp 0) helm-current-error) (line-beginning-position)) - ((and (> argp 0) helm-current-error) + ((and (> argp 0) helm-current-error) (line-end-position)) - ((point)))) + ((point)))) (let ((fun (if (> argp 0) #'next-single-property-change #'previous-single-property-change))) @@ -1040,10 +1041,12 @@ Special commands: (defun helm-gm-next-file () (interactive) (helm-goto-next-or-prec-file 1)) +(put 'helm-gm-next-file 'helm-only t) (defun helm-gm-precedent-file () (interactive) (helm-goto-next-or-prec-file -1)) +(put 'helm-gm-precedent-file 'helm-only t) (defun helm-grep-mode-jump () (interactive) @@ -1643,7 +1646,7 @@ returns if available with current AG version." (cmd-line (helm-grep-ag-prepare-cmd-line ;; NOTE Encode directory name and pattern, ;; or it may not work with Chinese and maybe other non-utf8 - ;; characters on MSWindows systems issue#2677 and issue#2678. + ;; characters on MSWindows systems issue#2677 and issue#2678. (encode-coding-string helm-pattern locale-coding-system) (or (file-remote-p directory 'localname) (encode-coding-string directory locale-coding-system)) @@ -1706,7 +1709,9 @@ returns if available with current AG version." (defun helm-grep-ag-search-results (_candidate) "Launch a new helm session on the current results. Allow narrowing the grep ag results to a specific file or pattern without -continuing calling grep ag." +continuing calling grep ag, i.e. once called, what you type in minibuffer will be +searched with helm match functions in all the candidates found previously by +grep ag." (with-helm-buffer (let* ((src (helm-get-current-source)) (candidates (nthcdr 1 (split-string diff --git a/elpa/helm-20241224.1937/helm-help.el b/elpa/helm-20250515.548/helm-help.el similarity index 95% rename from elpa/helm-20241224.1937/helm-help.el rename to elpa/helm-20250515.548/helm-help.el index 02c1426c..45b4c52d 100644 --- a/elpa/helm-20241224.1937/helm-help.el +++ b/elpa/helm-20250515.548/helm-help.el @@ -1,6 +1,6 @@ ;;; helm-help.el --- Help messages for Helm. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -199,7 +199,7 @@ You can save these buffers with \\\\[helm-buffer-save-persisten If you want to save all these buffers, you can mark them with \\[helm-buffers-mark-similar-buffers] and save them with \\[helm-buffer-save-persistent]. You can also do this in one step with \\[helm-buffer-run-save-some-buffers]. Note that you will not be asked for confirmation. - + *** Meaning of colors and prefixes for buffers Remote buffers are prefixed with '@'. @@ -208,6 +208,7 @@ Indianred2 => Buffer exists but its file has been deleted. Orange => Buffer is modified and not saved to disk. Italic => A non-file buffer. Yellow => Tramp archive buffer. +DimGray => Indirect buffer. ** Commands \\ @@ -322,6 +323,10 @@ It will then behave slighly differently depending of Called with a prefix arg open menu unconditionally. +*** Show information on files (permissions etc...) + +Turn on `helm-popup-tip-mode'. + *** Filter out files or directories You can show files or directories only with respectively @@ -340,7 +345,7 @@ again with fuzzy sorting and no more with sorting methods previously selected. You can use these sort functions only on files or directory, see [[Filter out files or directories][Filter out files or directories]]. - + *** Find file at point Helm uses `ffap' partially or completely to find file at point depending on the @@ -529,7 +534,7 @@ Same but the cache is refreshed. **** You can start a recursive search with \"locate\", \"find\" or [[https://github.com/sharkdp/fd][Fd]] -See \"Note\" in the [[Recursive completion on subdirectories][section on subdirectories]]. +See \"NOTE\" in the [[Recursive completion on subdirectories][section on subdirectories]]. Using \"locate\", you can enable the local database with a prefix argument. If the local database doesn't already exists, you will be prompted for its creation. @@ -544,39 +549,37 @@ locate search with this pattern. If you want Helm to automatically do this, add NOTE: On Windows use Everything with its command line ~es~ as a replacement of locate. See [[https://github.com/emacs-helm/helm/wiki/Locate#windows][Locate on Windows]] -**** Recursive completion on subdirectories - -Starting from the directory you are currently browsing, it is possible to have -completion of all directories underneath. Say you are at \"/home/you/foo/\" and -you want to go to \"/home/you/foo/bar/baz/somewhere/else\", simply type -\"/home/you/foo/..else\" and hit `\\[helm-execute-persistent-action]' or enter -the final \"/\". Helm will then list all possible directories under \"foo\" -matching \"else\". +If your system use plocate as backend and you have no results when searching, +see [[Recursive completion on subdirectories][section on subdirectories]]. -Note: Completion on subdirectories uses \"locate\" as backend, you can configure -the command with `helm-locate-recursive-dirs-command'. Because this completion -uses an index, the directory tree displayed may be out-of-date and not reflect -the latest change until you update the index (using \"updatedb\" for \"locate\"). +**** Recursive completion on subdirectories -If for some reason you cannot use an index, the \"find\" command from -\"findutils\" can be used instead. It will be slower though. You need to pass -the basedir as first argument of \"find\" and the subdir as the value for -'-(i)regex' or '-(i)name' with the two format specs that are mandatory in -`helm-locate-recursive-dirs-command'. +Starting from the directory you are currently browsing, it is +possible to have completion of all directories underneath. Say +you are at \"/home/you/foo/\" and you want to go to +\"/home/you/foo/bar/baz/somewhere/else\", simply type +\"/home/you/foo/..else\" and enter the final \"/\". Helm will +then list all possible directories under \"foo\" matching +\"else\". -Examples: -- \"find %s -type d -name '*%s*'\" -- \"find %s -type d -regex .*%s.*$\" +You can use either find, locate or fdfind as backend, see the variable +`helm-locate-recursive-dirs-command', the default is to use find as backend. -[[https://github.com/sharkdp/fd][Fd]] command is now also -supported which is regexp based and very fast. Here is the command -line to use: +NOTE: When using `locate' as backend which uses an index, the +directory tree displayed may be out-of-date and not reflect the +latest change until you update the index (using \"updatedb\" for +\"locate\"). -- \"fd --hidden --type d .*%s.*$ %s\" +On recent systems plocate is used instead of mlocate and the +corresponding updatedb command doesn't index anymore user +directories, see the option PRUNE_BIND_MOUNTS in the updatedb man +page. -You can use also a glob based search, in this case use the --glob option: +If a locale db file is found under current directory it will be +used instead of the global updatedb index. -- \"fd --hidden --type d --glob '*%s*' %s\" +To create a locale db file under current directory, use `C-u C-u +C-x C-f' from helm-find-files. *** Insert filename at point or complete filename at point @@ -878,6 +881,41 @@ automatically \"-e 'ssh -p 2222'\" to the rsync command line unless you have specified yourself the \"-e\" option by editing rsync command line with a prefix arg (see above). +*** Drag and drop files from Helm + +When mouse support is enabled in Helm (which is the default, see +`helm-allow-mouse') you can drag and drop files to `default-directory' +of the buffer you drag-and-drop in or in an external application. + +By default Helm copy files when using drag-and-drop, you can customize +`helm-ff-drag-mouse-1-default-action' to modify this, however note that +other actions than `copy' are not supported when dropping in dired buffers +as of now, it works when dropping in external apps like Thunar though. + +Also drag-and-drop is not working when trying to drop in a window that +is in another desktop, in this case use the following solution. + +To drag-and-drop to external applications you can also use the +external application [[https://github.com/mwh/dragon][Dragon]] and use it as follow: + +#+begin_src elisp + (defun helm-ff-dragon (files) + \"Create a small window with FILES ready to drag and drop. +Use this to drop files on externals applications or desktop. +Dropping on emacs buffers with this is not supported. + +Needs `dragon' executable: https://github.com/mwh/dragon.\" + (interactive (list (helm-marked-candidates))) + (cl-assert (executable-find \"dragon\") nil \"Dragon executable not found\") + (apply #'call-process \"dragon\" nil nil nil \"--all\" \"--and-exit\" files)) + (define-key helm-find-files-map (kbd \"C-c m\") 'helm-ff-dragon) +#+end_src + +Tip: From the Dragon window, you can move your mouse to an other desktop +where the external application you want to drag-and-drop is. + +NOTE: Drag-and-dropping from elsewhere to Helm is forbidden. + *** Access files on Android phones from Helm Since Android doesn't provide anymore mass storage for USB, it is @@ -1066,7 +1104,7 @@ of candidates soon after. If you enter \":\" directly after \"/\" or \"|\" you will have completion on tramp methods, hitting `\\[helm-execute-persistent-action]' or `right' on a method will insert it in minibuffer. - + When connection fails, be sure to delete your TRAMP connection with M-x `helm-delete-tramp-connection' before retrying. @@ -1134,12 +1172,13 @@ this will prevent splitting the name and create multiple files. *** Change mode on files (chmod) -When running `\\\\[helm-ff-run-chmod]' on -marked files, you can enter the new mode in prompt but you can -also use the first marked file as model to use it as default. -For example you can mark a file with mode 777 and mark other -files with mode 664, press 'RET' and answer 'y', all marked files -will be changed to 777. +When running `\\\\[helm-ff-run-chmod]' on marked +files, you can enter the new mode in prompt but you can also use the +first marked file as model to use it as default. For example you can +mark a file with mode 777 and mark other files with mode 664, press +'RET' and answer 'y', all marked files will be changed to 777. To see +the default mode and eventually edit it use 'M-n'. You can use numeric +mode or letters, see 'chmod' man page for more infos. NOTE: Another way to change modes on files in helm-find-files is running `\\\\[helm-ff-run-switch-to-shell]' and use 'chmod' directly. @@ -1764,6 +1803,10 @@ match regexp (i.e. \"helm\" will match \"helm\" but \"hlm\" will *not* match NOTE: On Windows use Everything with its command line ~es~ as a replacement of locate. See [[https://github.com/emacs-helm/helm/wiki/Locate#windows][Locate on Windows]] +On recent systems, the updatedb command doesn't +index anymore user directories, see the option PRUNE_BIND_MOUNTS +in the updatedb man page. + *** Browse project When the current directory is not under version control, don't forget to refresh @@ -2032,9 +2075,22 @@ leaving Helm. (defvar helm-bookmark-help-message "* Helm bookmark name -When `helm-bookmark-use-icon' is non nil and `all-the-icons' -package is installed icons before candidates will be displayed. - +** Tips + +*** Display bookmarks with Icons + +When `helm-bookmark-use-icon' is non nil and you have a +`helm-x-icons-provider' either `all-the-icons' or `nerd-icons' package +is installed icons before candidates will be displayed. + +*** Reset bookmark position + +When using `helm-filtered-bookmarks' you can modify your bookmark +position by resetting it, to do this, jump to your bookmark, move point +to the new location, then call again `helm-filtered-bookmarks' and find +your current bookmark, yank its name in minibuffer with `\\\\[helm-yank-selection]' +switch to the \"Set bookmark\" source and hit RET. + ** Commands \\ |Keys|Description @@ -2068,7 +2124,7 @@ But you can also pass an argument or more after \"candidate_file\" like this: **** Use placeholders in extra arguments -placeholder for file without extension: \\@ +placeholder for file without extension: \\@ placeholder for incremental number: \\# \"candidate_file\" will be added at \"%s\" and \\@ but without extension. diff --git a/elpa/helm-20241224.1937/helm-id-utils.el b/elpa/helm-20250515.548/helm-id-utils.el similarity index 99% rename from elpa/helm-20241224.1937/helm-id-utils.el rename to elpa/helm-20250515.548/helm-id-utils.el index 315ef22c..01469762 100644 --- a/elpa/helm-20241224.1937/helm-id-utils.el +++ b/elpa/helm-20250515.548/helm-id-utils.el @@ -1,6 +1,6 @@ ;;; helm-id-utils.el --- Helm interface for id-utils. -*- lexical-binding: t -*- -;; Copyright (C) 2015 ~ 2020 Thierry Volpiatto +;; Copyright (C) 2015 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-imenu.el b/elpa/helm-20250515.548/helm-imenu.el similarity index 76% rename from elpa/helm-20241224.1937/helm-imenu.el rename to elpa/helm-20250515.548/helm-imenu.el index 529d75df..1073134f 100644 --- a/elpa/helm-20241224.1937/helm-imenu.el +++ b/elpa/helm-20250515.548/helm-imenu.el @@ -1,6 +1,6 @@ ;;; helm-imenu.el --- Helm interface for Imenu -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -23,15 +23,14 @@ (require 'imenu) (require 'helm-utils) (require 'helm-help) +(require 'helm-x-icons) (defvar all-the-icons-default-adjust) (defvar all-the-icons-scale-factor) +(defvar nerd-icons-default-adjust) +(defvar nerd-icons-scale-factor) (declare-function which-function "which-func") -(declare-function all-the-icons-material "ext:all-the-icons.el") -(declare-function all-the-icons-octicon "ext:all-the-icons.el") -(declare-function all-the-icons-faicon "ext:all-the-icons.el") -(declare-function all-the-icons-wicon "ext:all-the-icons.el") (defgroup helm-imenu nil @@ -100,100 +99,100 @@ Don't use `setq' to set this." :group 'helm-imenu :type 'boolean :set (lambda (var val) - (if (require 'all-the-icons nil t) + (if (require helm-x-icons-provider nil t) (set var val) (set var nil)))) (defcustom helm-imenu-use-icon nil - "Display an icon from all-the-icons package when non nil. + "Display an icon from `helm-x-icons-provider' package when non nil. Don't use `setq' to set this." :group 'helm-imenu :type 'boolean :set (lambda (var val) - (if (require 'all-the-icons nil t) + (if (require helm-x-icons-provider nil t) (set var val) (set var nil)))) (defcustom helm-imenu-icon-type-alist - '(("Array" . (all-the-icons-material "crop" :face font-lock-builtin-face)) - ("Arrays" . (all-the-icons-material "crop" :face font-lock-builtin-face)) - ("Boolean" . (all-the-icons-material "crop" :face font-lock-builtin-face)) - ("Booleans" . (all-the-icons-material "crop" :face font-lock-builtin-face)) - ("Class" . (all-the-icons-octicon "package" :face font-lock-type-face)) - ("Classes" . (all-the-icons-octicon "package" :face font-lock-type-face)) - ("Color" . (all-the-icons-material "color_lens" :face font-lock-builtin-face)) - ("Colors" . (all-the-icons-material "color_lens" :face font-lock-builtin-face)) - ("Constant" . (all-the-icons-material "crop" :face font-lock-builtin-face)) - ("Constants" . (all-the-icons-material "crop" :face font-lock-builtin-face)) - ("Constructor" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Constructors" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Enum Member" . (all-the-icons-octicon "three-bars" :face font-lock-type-face)) - ("Enum Members" . (all-the-icons-octicon "three-bars" :face font-lock-type-face)) - ("Enum" . (all-the-icons-faicon "cog" :face font-lock-type-face)) - ("Enums" . (all-the-icons-faicon "cog" :face font-lock-type-face)) - ("Event" . (all-the-icons-wicon "lightning" :face font-lock-builtin-face)) - ("Events" . (all-the-icons-wicon "lightning" :face font-lock-builtin-face)) - ("Field" . (all-the-icons-octicon "three-bars" :face font-lock-type-face)) - ("Fields" . (all-the-icons-octicon "three-bars" :face font-lock-type-face)) - ("File" . (all-the-icons-faicon "file" :face font-lock-variable-name-face)) - ("Files" . (all-the-icons-faicon "file" :face font-lock-variable-name-face)) - ("Folder" . (all-the-icons-faicon "folder" :face font-lock-variable-name-face)) - ("Folders" . (all-the-icons-faicon "folder" :face font-lock-variable-name-face)) - ("Interface" . (all-the-icons-octicon "package" :face font-lock-builtin-face)) - ("Interfaces" . (all-the-icons-octicon "package" :face font-lock-builtin-face)) - ("Keyword" . (all-the-icons-octicon "key" :face font-lock-builtin-face)) - ("Keywords" . (all-the-icons-octicon "key" :face font-lock-builtin-face)) - ("Method" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Methods" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Defun" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Defuns" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Fn" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Fns" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Function" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Functions" . (all-the-icons-faicon "cube" :face font-lock-function-name-face)) - ("Misc" . (all-the-icons-faicon "globe" :face font-lock-function-name-face)) - ("Miscs" . (all-the-icons-faicon "globe" :face font-lock-function-name-face)) - ("Module" . (all-the-icons-faicon "angle-double-right" :face font-lock-builtin-face)) - ("Modules" . (all-the-icons-faicon "angle-double-right" :face font-lock-builtin-face)) - ("Numeric" . (all-the-icons-material "crop" :face font-lock-builtin-face)) - ("Numerics" . (all-the-icons-material "crop" :face font-lock-builtin-face)) - ("Object" . (all-the-icons-faicon "angle-double-right" :face font-lock-builtin-face)) - ("Objects" . (all-the-icons-faicon "angle-double-right" :face font-lock-builtin-face)) - ("Operator" . (all-the-icons-faicon "calculator" :face font-lock-builtin-face)) - ("Operators" . (all-the-icons-faicon "calculator" :face font-lock-builtin-face)) - ("Property" . (all-the-icons-octicon "book" :face font-lock-variable-name-face)) - ("Properties" . (all-the-icons-octicon "book" :face font-lock-variable-name-face)) - ("Reference" . (all-the-icons-octicon "book" :face font-lock-variable-name-face)) - ("References" . (all-the-icons-octicon "book" :face font-lock-variable-name-face)) - ("Snippet" . (all-the-icons-material "border_style" :face font-lock-variable-name-face)) - ("Snippets" . (all-the-icons-material "border_style" :face font-lock-variable-name-face)) - ("String" . (all-the-icons-material "text_fields" :face font-lock-variable-name-face)) - ("Strings" . (all-the-icons-material "text_fields" :face font-lock-variable-name-face)) - ("Struct" . (all-the-icons-faicon "cog" :face font-lock-type-face)) - ("Structs" . (all-the-icons-faicon "cog" :face font-lock-type-face)) - ("Text" . (all-the-icons-material "text_fields" :face font-lock-variable-name-face)) - ("Texts" . (all-the-icons-material "text_fields" :face font-lock-variable-name-face)) - ("Top level" . (all-the-icons-faicon "globe" :face font-lock-function-name-face)) - ("Trait" . (all-the-icons-octicon "package" :face font-lock-builtin-face)) - ("Traits" . (all-the-icons-octicon "package" :face font-lock-builtin-face)) - ("Type" . (all-the-icons-faicon "cog" :face font-lock-type-face)) - ("Types" . (all-the-icons-faicon "cog" :face font-lock-type-face)) - ("Type Parameter" . (all-the-icons-material "code" :face font-lock-type-face)) - ("Type Parameters" . (all-the-icons-material "code" :face font-lock-type-face)) - ("Unit" . (all-the-icons-faicon "bar-chart" :face font-lock-builtin-face)) - ("Units" . (all-the-icons-faicon "bar-chart" :face font-lock-builtin-face)) - ("Value" . (all-the-icons-faicon "cog" :face font-lock-type-face)) - ("Values" . (all-the-icons-faicon "cog" :face font-lock-type-face)) - ("Variable" . (all-the-icons-octicon "book" :face font-lock-variable-name-face)) - ("Variables" . (all-the-icons-octicon "book":face font-lock-variable-name-face))) + '(("Array" . (helm-x-icons-generic "crop" :face font-lock-builtin-face)) + ("Arrays" . (helm-x-icons-generic "crop" :face font-lock-builtin-face)) + ("Boolean" . (helm-x-icons-generic "crop" :face font-lock-builtin-face)) + ("Booleans" . (helm-x-icons-generic "crop" :face font-lock-builtin-face)) + ("Class" . (helm-x-icons-generic "package" :face font-lock-type-face)) + ("Classes" . (helm-x-icons-generic "package" :face font-lock-type-face)) + ("Color" . (helm-x-icons-generic "color_lens" :face font-lock-builtin-face)) + ("Colors" . (helm-x-icons-generic "color_lens" :face font-lock-builtin-face)) + ("Constant" . (helm-x-icons-generic "crop" :face font-lock-builtin-face)) + ("Constants" . (helm-x-icons-generic "crop" :face font-lock-builtin-face)) + ("Constructor" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Constructors" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Enum Member" . (helm-x-icons-generic "three-bars" :face font-lock-type-face)) + ("Enum Members" . (helm-x-icons-generic "three-bars" :face font-lock-type-face)) + ("Enum" . (helm-x-icons-generic "cog" :face font-lock-type-face)) + ("Enums" . (helm-x-icons-generic "cog" :face font-lock-type-face)) + ("Event" . (helm-x-icons-generic "lightning" :face font-lock-builtin-face)) + ("Events" . (helm-x-icons-generic "lightning" :face font-lock-builtin-face)) + ("Field" . (helm-x-icons-generic "three-bars" :face font-lock-type-face)) + ("Fields" . (helm-x-icons-generic "three-bars" :face font-lock-type-face)) + ("File" . (helm-x-icons-generic "file" :face font-lock-variable-name-face)) + ("Files" . (helm-x-icons-generic "file" :face font-lock-variable-name-face)) + ("Folder" . (helm-x-icons-generic "folder" :face font-lock-variable-name-face)) + ("Folders" . (helm-x-icons-generic "folder" :face font-lock-variable-name-face)) + ("Interface" . (helm-x-icons-generic "package" :face font-lock-builtin-face)) + ("Interfaces" . (helm-x-icons-generic "package" :face font-lock-builtin-face)) + ("Keyword" . (helm-x-icons-generic "key" :face font-lock-builtin-face)) + ("Keywords" . (helm-x-icons-generic "key" :face font-lock-builtin-face)) + ("Method" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Methods" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Defun" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Defuns" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Fn" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Fns" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Function" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Functions" . (helm-x-icons-generic "cube" :face font-lock-function-name-face)) + ("Misc" . (helm-x-icons-generic "globe" :face font-lock-function-name-face)) + ("Miscs" . (helm-x-icons-generic "globe" :face font-lock-function-name-face)) + ("Module" . (helm-x-icons-generic "angle-double-right" :face font-lock-builtin-face)) + ("Modules" . (helm-x-icons-generic "angle-double-right" :face font-lock-builtin-face)) + ("Numeric" . (helm-x-icons-generic "crop" :face font-lock-builtin-face)) + ("Numerics" . (helm-x-icons-generic "crop" :face font-lock-builtin-face)) + ("Object" . (helm-x-icons-generic "angle-double-right" :face font-lock-builtin-face)) + ("Objects" . (helm-x-icons-generic "angle-double-right" :face font-lock-builtin-face)) + ("Operator" . (helm-x-icons-generic "calculator" :face font-lock-builtin-face)) + ("Operators" . (helm-x-icons-generic "calculator" :face font-lock-builtin-face)) + ("Property" . (helm-x-icons-generic "book" :face font-lock-variable-name-face)) + ("Properties" . (helm-x-icons-generic "book" :face font-lock-variable-name-face)) + ("Reference" . (helm-x-icons-generic "book" :face font-lock-variable-name-face)) + ("References" . (helm-x-icons-generic "book" :face font-lock-variable-name-face)) + ("Snippet" . (helm-x-icons-generic "border_style" :face font-lock-variable-name-face)) + ("Snippets" . (helm-x-icons-generic "border_style" :face font-lock-variable-name-face)) + ("String" . (helm-x-icons-generic "text_fields" :face font-lock-variable-name-face)) + ("Strings" . (helm-x-icons-generic "text_fields" :face font-lock-variable-name-face)) + ("Struct" . (helm-x-icons-generic "cog" :face font-lock-type-face)) + ("Structs" . (helm-x-icons-generic "cog" :face font-lock-type-face)) + ("Text" . (helm-x-icons-generic "text_fields" :face font-lock-variable-name-face)) + ("Texts" . (helm-x-icons-generic "text_fields" :face font-lock-variable-name-face)) + ("Top level" . (helm-x-icons-generic "globe" :face font-lock-function-name-face)) + ("Trait" . (helm-x-icons-generic "package" :face font-lock-builtin-face)) + ("Traits" . (helm-x-icons-generic "package" :face font-lock-builtin-face)) + ("Type" . (helm-x-icons-generic "cog" :face font-lock-type-face)) + ("Types" . (helm-x-icons-generic "cog" :face font-lock-type-face)) + ("Type Parameter" . (helm-x-icons-generic "code" :face font-lock-type-face)) + ("Type Parameters" . (helm-x-icons-generic "code" :face font-lock-type-face)) + ("Unit" . (helm-x-icons-generic "bar-chart" :face font-lock-builtin-face)) + ("Units" . (helm-x-icons-generic "bar-chart" :face font-lock-builtin-face)) + ("Value" . (helm-x-icons-generic "cog" :face font-lock-type-face)) + ("Values" . (helm-x-icons-generic "cog" :face font-lock-type-face)) + ("Variable" . (helm-x-icons-generic "book" :face font-lock-variable-name-face)) + ("Variables" . (helm-x-icons-generic "book":face font-lock-variable-name-face))) "An alist of types associated with a sexp returning an icon. The sexp should be an `all-the-icons' function with its args." :type '(alist :key-type string :value-type sexp) :group 'helm-imenu) (defcustom helm-imenu-default-type-sexp - '(all-the-icons-faicon "globe" :face font-lock-function-name-face) + '(helm-x-icons-generic "globe" :face font-lock-function-name-face) "Default sexp to use when no type for an object is found." :type 'sexp :group 'helm-imenu) @@ -432,9 +431,10 @@ The sexp should be an `all-the-icons' function with its args." The icon is found in `helm-imenu-icon-type-alist', if not `helm-imenu-default-type-sexp' is evaled to provide a default icon." (let ((all-the-icons-scale-factor 1.0) - (all-the-icons-default-adjust 0.0)) - (or (helm-aand (assoc-default - type helm-imenu-icon-type-alist) + (all-the-icons-default-adjust 0.0) + (nerd-icons-scale-factor 1.0) + (nerd-icons-default-adjust 0.0)) + (or (helm-aand (assoc-default type helm-imenu-icon-type-alist) (apply (car it) (cdr it))) (apply (car helm-imenu-default-type-sexp) (cdr helm-imenu-default-type-sexp))))) diff --git a/elpa/helm-20241224.1937/helm-info.el b/elpa/helm-20250515.548/helm-info.el similarity index 75% rename from elpa/helm-20241224.1937/helm-info.el rename to elpa/helm-20250515.548/helm-info.el index 681b11ca..df0fd7b3 100644 --- a/elpa/helm-20241224.1937/helm-info.el +++ b/elpa/helm-20250515.548/helm-info.el @@ -1,6 +1,6 @@ ;;; helm-info.el --- Browse info index with helm -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ (declare-function ring-ref "ring") (defvar Info-history) (defvar Info-directory-list) +(defvar helm-completions-detailed) ;; `Info-minibuf-history' is not declared in Emacs, see emacs bug/58786. (when (and (> emacs-major-version 28) (not (boundp 'Info-minibuf-history))) @@ -144,6 +145,7 @@ If line have a node use the node, otherwise use directly first name found." (filtered-candidate-transformer :initform (lambda (candidates _source) + (require 'helm-mode) (cl-loop for line in candidates when (string-match helm-info--node-regexp line) do (progn @@ -153,7 +155,7 @@ If line have a node use the node, otherwise use directly first name found." nil line) (helm-add-face-text-properties (match-beginning 2) (match-end 2) - 'font-lock-warning-face + 'helm-completions-detailed nil line)) collect line))) (display-to-real :initform #'helm-info-display-to-real) @@ -239,15 +241,68 @@ helm-info-." (funcall helm-info-function) (ring-insert helm-info-searched candidate)))) +(defvar helm-info--files-cache nil) +(defvar helm-info--files-doc-cache (make-hash-table :test 'equal)) + +(defun helm-info-file-doc (file) + "Return dir entry from the Info FILE." + (or + (with-temp-buffer + (ignore-errors (info-insert-file-contents file)) + (goto-char (point-min)) + (when (re-search-forward "^START-INFO-DIR-ENTRY$" nil t) + (forward-line 1) + (when (re-search-forward + "^\\*[[:space:]]+\\([^:]+\\):[[:space:]]+([^)]+)\\.[[:space:]]+\\(.+\\)" + (pos-eol) t) + (format-message "%s: %s" (match-string 1) (match-string 2))))) + "No summary")) + (defun helm-def-source--info-files () "Return a Helm source for Info files." + (require 'helm-mode) (helm-build-sync-source "Helm Info" :candidates (lambda () (copy-sequence helm-default-info-index-list)) :candidate-number-limit 999 :candidate-transformer (lambda (candidates) - (sort candidates #'string-lessp)) + (let ((candidates (sort candidates #'string-lessp)) + (longest (apply #'max (mapcar #'length candidates))) + done) + (cl-loop with reporter = (unless done + (make-progress-reporter + "Scanning libraries..." + 0 (length candidates))) + for c in candidates + for count from 0 + for sep = (helm-make-separator c longest) + for file = (or + (assoc-default c helm-info--files-cache) + (helm-aif (Info-find-file c t) + (prog1 it + (push (cons c it) helm-info--files-cache)))) + for doc = (and file + (or completions-detailed + helm-completions-detailed) + (or (gethash file helm-info--files-doc-cache) + (puthash file (helm-info-file-doc file) + helm-info--files-doc-cache))) + for disp = (and file + (if (and doc + (or completions-detailed + helm-completions-detailed)) + (helm-aand (propertize + doc 'face + 'helm-completions-detailed) + (propertize + " " 'display (concat sep it)) + (concat c it)) + c)) + when disp + collect (cons disp c) + when reporter do (progress-reporter-update reporter count) + finally do (setq done t)))) :nomark t :action '(("Search index" . helm-info-search-index)))) @@ -259,18 +314,34 @@ With a prefix argument \\[universal-argument], set REFRESH to non-nil. Optional parameter REFRESH, when non-nil, re-evaluates -`helm-default-info-index-list'. If the variable has been -customized, set it to its saved value. If not, set it to its -standard value. See `custom-reevaluate-setting' for more. +`helm-default-info-index-list' and clears caches (see below). +If the variable has been customized, set it to its saved value. +If not, set it to its standard value. See +`custom-reevaluate-setting' for more. REFRESH is useful when new Info files are installed. If `helm-default-info-index-list' has not been customized, the new -Info files are made available." +Info files are made available. + +When `completions-detailed' or `helm-completions-detailed' is non +nil, a description of Info files is provided. The Info files are +partially cached in the variables `helm-info--files-cache' and +`helm-info--files-docs-cache'. TIP: You can make these vars +persistent for faster start with the psession package, using +\\[psession-make-persistent-variable]. + +NOTE: The caches affect as well `info-dislpay-manual' when +`helm-mode' is enabled and `completions-detailed' is non nil. +When new Info files are installed, for example a library update +changed Info dir node entry, you can reset the caches with +a prefix arg." (interactive "P") (let ((default (unless (ring-empty-p helm-info-searched) (ring-ref helm-info-searched 0)))) (when refresh - (custom-reevaluate-setting 'helm-default-info-index-list)) + (custom-reevaluate-setting 'helm-default-info-index-list) + (setq helm-info--files-cache nil) + (clrhash helm-info--files-doc-cache)) (helm :sources (helm-def-source--info-files) :buffer "*helm Info*" :preselect (and default @@ -289,10 +360,10 @@ Info files are made available." (helm-build-sync-source "Info Pages" :init #'helm-info-pages-init :candidates (lambda () helm-info--pages-cache) - :action '(("Show with Info" . - (lambda (node-str) - (info (replace-regexp-in-string - "^[^:]+: " "" node-str))))) + :action `(("Show with Info" + . ,(lambda (node-str) + (info (replace-regexp-in-string + "^[^:]+: " "" node-str))))) :requires-pattern 2) "Helm source for Info pages.") diff --git a/elpa/helm-20241224.1937/helm-locate.el b/elpa/helm-20250515.548/helm-locate.el similarity index 85% rename from elpa/helm-20241224.1937/helm-locate.el rename to elpa/helm-20250515.548/helm-locate.el index 2e811753..7e5aea07 100644 --- a/elpa/helm-20241224.1937/helm-locate.el +++ b/elpa/helm-20250515.548/helm-locate.el @@ -1,6 +1,6 @@ ;;; helm-locate.el --- helm interface for locate. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -72,7 +72,7 @@ The last option must be the one preceding pattern i.e \"-r\" or The option \"-N\" may not be available on old locate versions, it is needed on latest systems as locate send quoted filenames, it is BTW enabled by default, if this option is not recognized on your system, remove it. - + You will be able to pass other options such as \"-b\" or \"l\" during Helm invocation after entering pattern only when multi matching, not when fuzzy matching. @@ -114,17 +114,40 @@ When set, allow browsing recursively files in all directories of this list with `helm-projects-find-files'." :type '(repeat string)) -(defcustom helm-locate-recursive-dirs-command "locate -i -e -A --regex '^%s' '%s.*$'" +(defcustom helm-locate-recursive-dirs-command "find %s -type d -regex .*%s.*$" "Command used for recursive directories completion in `helm-find-files'. For Windows and `es' use something like \"es -r ^%s.*%s.*$\" The two format specs are mandatory. -If for some reasons you can't use locate because your filesystem -doesn't have a database, you can use find command from findutils -but be aware that it will be much slower. See `helm-find-files' -embedded help for more infos." +We were using locate command as default in the past like this: + + \"locate -i -e -A --regex '^%s' '%s.*$'\" + +But in most distributions updatedb is not indexing user dirs +among others (see PRUNE_BIND_MOUNTS in updatedb.conf man page). +However if you use a local db file, it will be used instead of +the global updatedb cache and will be very fast. + +So we use now the find shell command by default which is available on most +distributions and doesn't suffer of these indexing problems. It +is however slower than locate. Here the possible values you can +use: + + \"find %s -type d -regex .*%s.*$\" + \"find %s -type d -name '*%s*'\" + +You can use also the \"fdfind\" command which may be slow at first call because +it creates an index, but is then very fast on subsequent calls, here is the +command you can use: + + \"fdfind --hidden --type d --glob '*%s*' %s\" + +NOTE: The \"fdfind\" executable name may change on some systems, +it can be \"fd\" or whatever. + +See `helm-find-files' embedded help for more infos." :type 'string :group 'helm-files) @@ -354,9 +377,7 @@ See also `helm-locate'." Sort is done on basename of CANDIDATES." (helm-fuzzy-matching-default-sort-fn-1 candidates nil t)) -(defclass helm-locate-override-inheritor (helm-type-file) ()) - -(defclass helm-locate-source (helm-source-async helm-locate-override-inheritor) +(defclass helm-locate-source (helm-source-async helm-type-file) ((init :initform 'helm-locate-initial-setup) (candidates-process :initform 'helm-locate-init) (requires-pattern :initform 3) @@ -366,7 +387,7 @@ Sort is done on basename of CANDIDATES." (redisplay :initform (progn helm-locate-fuzzy-sort-fn)))) ;; Override helm-type-file class keymap. -(cl-defmethod helm--setup-source :after ((source helm-locate-override-inheritor)) +(cl-defmethod helm--setup-source :after ((source helm-locate-source)) (setf (slot-value source 'keymap) helm-locate-map) (setf (slot-value source 'group) 'helm-locate)) @@ -405,8 +426,11 @@ Sort is done on basename of CANDIDATES." candidate directory)) 0) - (error "Failed to create locatedb file `%s'" candidate))))) - (cl-loop for p in helm-locate-project-list + (error "Failed to create locatedb file `%s'" candidate)))) + (projects (cl-loop for p in helm-locate-project-list + when (file-directory-p p) + collect p))) + (cl-loop for p in projects for db = (expand-file-name helm-ff-locate-db-filename (file-name-as-directory p)) @@ -428,21 +452,39 @@ Sort is done on basename of CANDIDATES." (group :initform 'helm-locate))) (defun helm-locate-init-subdirs () - (with-temp-buffer - (call-process-shell-command - (if (string-match-p "\\`fd" helm-locate-recursive-dirs-command) - (format helm-locate-recursive-dirs-command - ;; fd pass path at end. - (helm-get-attr 'subdir) (helm-get-attr 'basedir)) - (format helm-locate-recursive-dirs-command - (if (string-match-p "\\`es" helm-locate-recursive-dirs-command) - ;; Fix W32 paths. - (replace-regexp-in-string - "/" "\\\\\\\\" (helm-get-attr 'basedir)) - (helm-get-attr 'basedir)) - (helm-get-attr 'subdir))) - nil t nil) - (buffer-string))) + (let ((cmd (helm-acase helm-locate-recursive-dirs-command + (;; Fd + (guard* (string-match-p "\\`fd" it)) + ;; fd pass path at end. + (format it (helm-get-attr 'subdir) (helm-get-attr 'basedir))) + (;; Es + (guard* (string-match-p "\\`es" it)) + (format it (replace-regexp-in-string + "/" "\\\\\\\\" (helm-get-attr 'basedir)) + (helm-get-attr 'subdir))) + (;; Locate + (guard* (string-match-p "\\`locate" it)) + ;; Try to use a locale DB if some. + (let* ((db (locate-dominating-file + (helm-get-attr 'basedir) + helm-ff-locate-db-filename)) + (lcmd (if (and db (not (string-match-p "-d" it))) + (mapconcat + #'identity + (helm-append-at-nth + (split-string it) + (format "-d %s" + (expand-file-name + helm-ff-locate-db-filename db)) + 1) + " ") + it))) + (format lcmd (helm-get-attr 'basedir) (helm-get-attr 'subdir)))) + ;; Find + (t (format it (helm-get-attr 'basedir) (helm-get-attr 'subdir)))))) + (with-temp-buffer + (call-process-shell-command cmd nil t nil) + (buffer-string)))) ;;;###autoload (defun helm-projects-find-files (update) @@ -452,7 +494,7 @@ With a prefix arg refresh the database in each project." (helm-locate-set-command) (cl-assert (and (string-match-p "\\`locate" helm-locate-command) (executable-find "updatedb")) - nil "Unsupported locate version") + nil "Unsupported locate program") (let ((dbs (helm-locate-find-dbs-in-projects update))) (if dbs (helm-locate-with-db dbs) diff --git a/elpa/helm-20241224.1937/helm-man.el b/elpa/helm-20250515.548/helm-man.el similarity index 99% rename from elpa/helm-20241224.1937/helm-man.el rename to elpa/helm-20250515.548/helm-man.el index 6d20314d..06b18103 100644 --- a/elpa/helm-20241224.1937/helm-man.el +++ b/elpa/helm-20250515.548/helm-man.el @@ -1,6 +1,6 @@ ;;; helm-man.el --- Man and woman UI -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-misc.el b/elpa/helm-20250515.548/helm-misc.el similarity index 87% rename from elpa/helm-20241224.1937/helm-misc.el rename to elpa/helm-20250515.548/helm-misc.el index 97a88ce3..53d0505b 100644 --- a/elpa/helm-20241224.1937/helm-misc.el +++ b/elpa/helm-20250515.548/helm-misc.el @@ -1,6 +1,6 @@ ;;; helm-misc.el --- Various functions for helm -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -43,8 +43,8 @@ :type 'string) (defcustom helm-timezone-actions - '(("Set timezone env (TZ)" . (lambda (candidate) - (setenv "TZ" candidate)))) + `(("Set timezone env (TZ)" . ,(lambda (candidate) + (setenv "TZ" candidate)))) "Actions for helm-timezone." :group 'helm-misc :type '(alist :key-type string :value-type function)) @@ -176,22 +176,6 @@ :action 'helm-timezone-actions :filtered-candidate-transformer 'helm-time-zone-transformer)) -;;; Commands -;; -(defun helm-call-interactively (cmd-or-name) - "Execute CMD-OR-NAME as Emacs command. -It is added to `extended-command-history'. -`helm-current-prefix-arg' is used as the command's prefix argument." - (setq extended-command-history - (cons (helm-stringify cmd-or-name) - (delete (helm-stringify cmd-or-name) extended-command-history))) - (let ((current-prefix-arg helm-current-prefix-arg) - (cmd (helm-symbolify cmd-or-name))) - (if (stringp (symbol-function cmd)) - (execute-kbd-macro (symbol-function cmd)) - (setq this-command cmd) - (call-interactively cmd)))) - ;;; Minibuffer History ;; ;; @@ -392,32 +376,33 @@ Default action change TZ environment variable locally to emacs." (insert elm))) ;;;###autoload -(defun helm-outline () +(defun helm-outline (&optional arg) "Basic helm navigation tool for outline buffers." - (interactive) - (helm :sources (helm-build-sync-source "helm outline" - :candidates - (lambda () - (with-helm-current-buffer - (save-excursion - (goto-char (point-min)) - (cl-loop while (re-search-forward outline-regexp nil t) - for beg = (match-beginning 0) - for end = (progn - (outline-end-of-heading) (point)) - collect - (cons (buffer-substring beg end) beg))))) - :action (lambda (pos) - (helm-goto-char pos) - (helm-highlight-current-line))) - :preselect (save-excursion - (when (condition-case _err - (outline-back-to-heading) - (error nil)) - (regexp-quote - (buffer-substring - (point) (progn (outline-end-of-heading) (point)))))) - :buffer "*helm outline*")) + (interactive "P") + (let ((outline-regexp (if arg (read-regexp "Outline regexp") outline-regexp))) + (helm :sources (helm-build-sync-source "helm outline" + :candidates + (lambda () + (with-helm-current-buffer + (save-excursion + (goto-char (point-min)) + (cl-loop while (re-search-forward outline-regexp nil t) + for beg = (match-beginning 0) + for end = (progn + (outline-end-of-heading) (point)) + collect + (cons (buffer-substring beg end) beg))))) + :action (lambda (pos) + (helm-goto-char pos) + (helm-highlight-current-line))) + :preselect (save-excursion + (when (condition-case _err + (outline-back-to-heading) + (error nil)) + (regexp-quote + (buffer-substring + (point) (progn (outline-end-of-heading) (point)))))) + :buffer "*helm outline*"))) (provide 'helm-misc) diff --git a/elpa/helm-20241224.1937/helm-mode.el b/elpa/helm-20250515.548/helm-mode.el similarity index 89% rename from elpa/helm-20241224.1937/helm-mode.el rename to elpa/helm-20250515.548/helm-mode.el index 9a447e9a..5b2cce3b 100644 --- a/elpa/helm-20241224.1937/helm-mode.el +++ b/elpa/helm-20250515.548/helm-mode.el @@ -1,6 +1,6 @@ ;;; helm-mode.el --- Enable helm completion everywhere. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -34,6 +34,11 @@ (defvar helm--locate-library-cache) (defvar completion-lazy-hilit) ; Emacs-30 only. (defvar eww-bookmarks) +(defvar helm-info--files-cache) +(defvar helm-info--files-doc-cache) +(defvar Info-current-file) +(defvar helm-M-x-prefix-argument) +(defvar helm-M-x--timer) ;; No warnings in Emacs built --without-x (declare-function x-file-dialog "xfns.c") @@ -51,6 +56,13 @@ (declare-function print-coding-system-briefly "mul-diag.el") (declare-function color-rgb-to-hex "color.el") (declare-function find-library-name "find-func.el") +(declare-function helm-info-file-doc "helm-info") +(declare-function Info-find-file "info") +(declare-function helm-M-x--notify-prefix-arg "helm-command") +(declare-function helm-M-x--unwind-forms "helm-command") +(declare-function helm-M-x--move-selection-after-hook "helm-command") +(declare-function helm-M-x--before-action-hook "helm-command") +(declare-function helm-M-x-persistent-action "helm-command") (defgroup helm-mode nil "Enable helm completion." @@ -94,7 +106,7 @@ Special symbol \\='default' means use the default helm handler for either e.g. (write-region . (default helm-read-file-name-handler-1)) means helm will use `helm-completing-read-default-handler' when `write-region' calls `completing-read' and -`helm-read-file-name-handler-1' when it calls `read-file-name'. +`helm-read-file-name-handler-1' when it calls `read-file-name'. Each key is an Emacs command that use originaly `completing-read' or/and `read-file-name'. @@ -254,10 +266,11 @@ This is mainly needed to prevent \"*Completions*\" buffers to popup.") (describe-theme . t)) "Allow overriding REQUIRE-MATCH completing-read arg for a specific function.") -(defcustom helm-completions-detailed (and (boundp 'completions-detailed) - completions-detailed) - "Allow providing `completions-detailed' for Emacs < 28. -Not guaranteed to work with Emacs < 27." +(defcustom helm-completions-detailed t + "Provide detailed completion in several places. +See `helm-completing-read-extra-metadata' and +`helm-completing-read-command-categories'. +Setting `completions-detailed' when available have the same effect." :type 'boolean :group 'helm-mode) @@ -598,7 +611,7 @@ If COLLECTION is an `obarray', a TEST should be needed. See `obarray'." cands)) ;; Some functions like debug-on-entry use (symbol-name sym) ;; without checking if sym is non nil, so the return value become - ;; "nil". + ;; "nil". ((and (not (member default '("" "nil"))) (string= helm-pattern "")) (cons default (delete (helm-stringify default) @@ -756,7 +769,7 @@ Keys description: - GET-LINE: Specify the :get-line slot of `helm-source-in-buffer', has no effect when CANDIDATES-IN-BUFFER is nil. - + - MATCH-PART: Allow matching only one part of candidate. See match-part documentation in `helm-source'. @@ -771,7 +784,7 @@ Keys description: - COERCE: See coerce in `helm-source'. - RAW-CANDIDATE: Do not unquote the unknown candidate coming from helm-pattern - when non nil. + when non nil. - GROUP: See group in `helm-source'. @@ -784,7 +797,7 @@ that use `helm-comp-read'. See `helm-M-x' for example." ;; ;; Should show helm with one source at first run and save result on ;; exit, should show the history source along candidates source on - ;; next run as soon as `test-hist' value is feeded. + ;; next run as soon as `test-hist' value is feeded. ;; (setq test-hist nil) ;; (helm-comp-read "test: " '(a b c d e) ;; :history 'test-hist) @@ -814,10 +827,10 @@ that use `helm-comp-read'. See `helm-M-x' for example." ;; whatever (bug #2527). (setq must-match t)) (let ((action-fn `(("Sole action (Identity)" - . (lambda (candidate) - (if ,marked-candidates - (helm-marked-candidates) - (identity candidate))))))) + . ,(lambda (candidate) + (if marked-candidates + (helm-marked-candidates) + (identity candidate))))))) (let* ((minibuffer-completion-predicate test) (minibuffer-completion-table (or minibuffer-completion-table collection)) @@ -1034,6 +1047,10 @@ that use `helm-comp-read'. See `helm-M-x' for example." (symbol-help . (metadata (affixation-function . helm-symbol-completion-table-affixation) (category . symbol-help))) + (command-help . (metadata + (prefix-arg . t) + (affixation-function . helm-symbol-completion-table-affixation) + (category . symbol-help))) (eww-help . (metadata ;; Emacs-30 only (affixation-function . helm-completion-eww-affixation) (category . eww-help))) @@ -1057,7 +1074,10 @@ that use `helm-comp-read'. See `helm-M-x' for example." (category . charset))) (man . (metadata (popup-info-function . helm-completion-man-popup-info) - (category . man)))) + (category . man))) + (info . (metadata + (affixation-function . helm-completion-info-file-affixation) + (category . info)))) "Extra metadatas for completing-read. It is used to add `affixation-function' or `annotation-function' if original @@ -1098,7 +1118,7 @@ FLAGS is a list of variables to renitialize to nil when exiting or quitting.") ("describe-minor-mode" . symbol-help) ("where-is" . symbol-help) ("execute-extended-command" . symbol-help) - ("execute-extended-command-for-buffer" . symbol-help) + ("execute-extended-command-for-buffer" . command-help) ("info-lookup-symbol" . symbol-help) ("Info-goto-emacs-command-node" . symbol-help) ("find-library" . library) @@ -1107,6 +1127,10 @@ FLAGS is a list of variables to renitialize to nil when exiting or quitting.") ("package-install" . package) ("package-vc-install" . package) ("package-vc-checkout" . package) + ("package-vc-log-incoming" . package) + ("package-vc-prepare-patch" . package) + ("package-vc-rebuild" . package) + ("package-vc-upgrade" . package) ("describe-package" . package) ("load-theme" . theme) ("describe-theme" . theme) @@ -1123,6 +1147,7 @@ FLAGS is a list of variables to renitialize to nil when exiting or quitting.") ("universal-coding-system-argument" . coding-system) ("read-color" . color) ("list-charset-chars" . charset) + ("info-display-manual" . info) ;; Emacs-30 only ("eww" . eww-help)) "An alist to specify metadata category by command. @@ -1167,9 +1192,11 @@ should be specified as a string and the category as a symbol.") (propertize (symbol-name major-mode) 'face 'helm-completions-detailed))) (size (helm-buffer-size buf)) - (max-len helm-buffer-max-length) + (max-len (helm-acase helm-buffer-max-length + ((guard* (numberp it)) it) + (t 20))) (bname (truncate-string-to-width - comp helm-buffer-max-length nil nil + comp max-len nil nil helm-buffers-end-truncated-string)) (suffix (format "%s%s%s%s%s `%s'" (make-string (1+ (- max-len (length bname))) ? ) @@ -1304,19 +1331,20 @@ is used." (defun helm--get-theme-doc-1 (sym) (let ((fn (locate-file (concat (symbol-name sym) "-theme.el") - (custom-theme--load-path) - '("" "c"))) + (custom-theme--load-path) + '("" "c"))) doc) ;; Avoid loading theme as much as possible. (when fn (with-temp-buffer (insert-file-contents fn) (helm-awhile (let ((read-circle nil)) - (condition-case nil - (read (current-buffer)) - (end-of-file nil))) - (when (eq (car-safe it) 'deftheme) - (cl-return (setq doc (car (split-string (nth 2 it) "\n")))))) + (condition-case nil + (read (current-buffer)) + (end-of-file nil))) + (let ((docstring (nth 2 it))) + (when (and (eq (car-safe it) 'deftheme) docstring) + (cl-return (setq doc (car (split-string docstring "\n"))))))) (unless doc (setq doc (helm--get-theme-doc-from-header))))) doc)) @@ -1371,6 +1399,7 @@ is used." (propertize " " 'display (concat sep it))))))) (defun helm-completion-library-affixation (_comps) + ;; We share here the same cache as `helm-locate-library'. (require 'helm-elisp) (lambda (comp) ;; Because find-library-include-other-files default to t, we have all the @@ -1389,7 +1418,7 @@ is used." helm--locate-library-doc-cache)))) (list comp "" - (helm-aand (propertize doc 'face 'font-lock-warning-face) + (helm-aand (propertize doc 'face 'helm-completions-detailed) (propertize " " 'display (concat sep it)))))))) (defun helm-completion-eww-affixation (_completions) @@ -1406,6 +1435,46 @@ is used." 'face 'helm-completions-detailed) (propertize " " 'display (concat it sep))) "")))) + +(defun helm-completion-info-file-affixation (_completions) + ;; We share here the same cache as `helm-info'. + (require 'info) + (require 'helm-info) + (lambda (comp) + (let* ((sep (helm-make-separator comp)) + (prefix "") + (file (or + ;; The `info-display-manual' favours `Info-mode' + ;; buffers. However, each buffer like that may be opened from + ;; a file that has not been installed and is not visible to a + ;; `Info-find-file'. Retrieve the such a file name from the + ;; buffer, and use it to scan for affixation, however don't + ;; cache the result in `helm-info--files-cache' to avoid using + ;; wrong file. For example, the latter can happen after a + ;; development version of info file has been opened. + (let ((manual-re (concat "\\(?:/\\|\\`\\)" comp + "\\(?:\\.\\|\\'\\)")) + (case-fold-search t)) + (cl-loop for buffer in (buffer-list) thereis + (with-current-buffer buffer + (when (and (derived-mode-p 'Info-mode) + (stringp Info-current-file) + (string-match + manual-re Info-current-file)) + (setq prefix "*") + Info-current-file)))) + (assoc-default comp helm-info--files-cache) + (helm-aif (Info-find-file comp t) + (prog1 it (push (cons comp it) helm-info--files-cache))))) + (summary (or (gethash file helm-info--files-doc-cache) + (puthash file (helm-info-file-doc file) + helm-info--files-doc-cache)))) + (list comp + (helm-aand (propertize prefix 'face 'helm-completions-detailed) + (propertize " " 'display (format "%-2s" it))) + (helm-aand (propertize summary 'face 'helm-completions-detailed) + (propertize " " 'display (concat sep it))))))) + ;;; Completing read handlers ;; @@ -1431,6 +1500,7 @@ handling properties, see `helm-comp-read'. This handler should be used when candidate list doesn't need to be rebuilt dynamically otherwise use `helm-completing-read-default-2'." + (require 'helm-command) (let* ((history (or (car-safe hist) hist)) (initial-input (helm-acase init ((guard* (stringp it)) it) @@ -1449,7 +1519,7 @@ dynamically otherwise use `helm-completing-read-default-2'." metadata 'display-sort-function) (lambda (candidates) (sort candidates #'helm-generic-sort-fn))))) - popup-info flags) + popup-info flags pref-arg keymap) (helm-aif (and (null category) (assoc-default name helm-completing-read-command-categories)) (setq metadata `(metadata (category . ,it)) @@ -1461,54 +1531,104 @@ dynamically otherwise use `helm-completing-read-default-2'." (setq metadata it) (setq afun (completion-metadata-get metadata 'annotation-function) afix (completion-metadata-get metadata 'affixation-function) + ;; prefix-arg metadata is only in command-help category. + pref-arg (completion-metadata-get metadata 'prefix-arg) popup-info (completion-metadata-get metadata 'popup-info-function) flags (completion-metadata-get metadata 'flags)))) + (setq keymap (if pref-arg + (let ((map (make-sparse-keymap))) + (set-keymap-parent map helm-comp-read-map) + (define-key map (kbd "C-u") 'helm-M-x-universal-argument) + map) + helm-comp-read-map) + prompt (if pref-arg + (concat (helm-acase helm-M-x-prefix-argument + (- "-") + ((dst* l &rest args) + (if (eq l 4) "C-u " (format "%d " l))) + ((guard* (integerp it)) (format "%d " it))) + prompt) + prompt) + helm--mode-line-display-prefarg pref-arg) + (when pref-arg + (setq helm-M-x--timer (run-at-time 1 0.1 #'helm-M-x--notify-prefix-arg)) + (add-hook 'helm-move-selection-after-hook + #'helm-M-x--move-selection-after-hook) + (add-hook 'helm-before-action-hook + #'helm-M-x--before-action-hook) + ;; Notify C-u entered before Hitting M-[xX]. + (setq helm-M-x-prefix-argument current-prefix-arg) + (setq current-prefix-arg nil) + ;; Remove command-execute advice when execute-extended-command exit. + (advice-add 'execute-extended-command :around #'helm--advice-execute-extended-command)) (unwind-protect - (helm-comp-read - prompt collection - :test test - :history history - :reverse-history helm-mode-reverse-history - :input-history history - :must-match require-match - :alistp alistp - :diacritics helm-mode-ignore-diacritics - :help-message #'helm-comp-read-help-message - :name name - :requires-pattern (if (and (stringp default) - (string= default "") - (memq require-match - '(confirm confirm-after-completion))) - 1 0) - :fc-transformer - ;; When afun afix and category are nil - ;; helm-completion--decorate returns - ;; candidates (COMPS) unmodified. - (append (list (lambda (candidates _source) - (helm-completion--decorate - (if (and sort-fn (> (length helm-pattern) 0)) - (funcall sort-fn candidates) - candidates) - afun afix category))) - '(helm-cr-default-transformer)) - :popup-info popup-info - :quit-when-no-cand (eq require-match t) - :nomark (null helm-comp-read-use-marked) - :candidates-in-buffer cands-in-buffer - :get-line (or get-line #'buffer-substring) - :exec-when-only-one exec-when-only-one - :fuzzy (eq helm-completion-style 'helm-fuzzy) - :buffer buffer - ;; If DEF is not provided, fallback to empty string - ;; to avoid `thing-at-point' to be appended on top of list - :default (or default "") - ;; Fail with special characters (e.g in gnus "nnimap+gmail:") - ;; if regexp-quote is not used. - ;; when init is added to history, it will be unquoted by - ;; helm-comp-read. - :initial-input initial-input) + (prog1 + (helm-comp-read + prompt collection + :test test + :keymap keymap + :history history + :reverse-history helm-mode-reverse-history + :input-history history + :must-match require-match + :alistp alistp + :diacritics helm-mode-ignore-diacritics + :help-message #'helm-comp-read-help-message + :persistent-action (and pref-arg #'helm-M-x-persistent-action) + :persistent-help (if pref-arg "Toggle Describe command" "DoNothing") + :name name + :requires-pattern (if (and (stringp default) + (string= default "") + (memq require-match + '(confirm confirm-after-completion))) + 1 0) + :fc-transformer + ;; When afun afix and category are nil + ;; helm-completion--decorate returns + ;; candidates (COMPS) unmodified. + (append (list (lambda (candidates _source) + (helm-completion--decorate + (if (and sort-fn (> (length helm-pattern) 0)) + (funcall sort-fn candidates) + candidates) + afun afix category))) + '(helm-cr-default-transformer)) + :popup-info popup-info + :quit-when-no-cand (eq require-match t) + :nomark (null helm-comp-read-use-marked) + :candidates-in-buffer cands-in-buffer + :get-line (or get-line #'buffer-substring) + :exec-when-only-one exec-when-only-one + :fuzzy (eq helm-completion-style 'helm-fuzzy) + :buffer buffer + ;; If DEF is not provided, fallback to empty string + ;; to avoid `thing-at-point' to be appended on top of list + :default (or default "") + ;; Fail with special characters (e.g in gnus "nnimap+gmail:") + ;; if regexp-quote is not used. + ;; when init is added to history, it will be unquoted by + ;; helm-comp-read. + :initial-input initial-input) + (when pref-arg + (advice-add 'command-execute :around #'helm--advice-command-execute))) + (when pref-arg (helm-M-x--unwind-forms)) (dolist (f flags) (set f nil))))) +(defun helm--advice-command-execute (old--fn &rest args) + (helm-M-x--unwind-forms 'done) + ;; `command-execute' is wrapped in a let with `prefix-arg' bound to the argument + ;; PREFIXARG of `execute-extended-command' so set this let-bounded `prefix-arg' + ;; to the value defined during helm completion. We use + ;; helm-M-x-prefix-argument instead of initial PREFIXARG to allow changing the + ;; initial prefix arg during helm completion e.g. C-u M-X foo C-u 2 foo, in + ;; this case the initial C-u is replaced by C-u 2. + (setq prefix-arg (or helm-current-prefix-arg helm-M-x-prefix-argument)) + (apply old--fn args)) + +(defun helm--advice-execute-extended-command (old--fn &rest args) + (prog1 (apply old--fn args) + (advice-remove 'command-execute 'helm--advice-command-execute))) + (defun helm-completing-read-default-2 (prompt collection predicate require-match init hist default _inherit-input-method @@ -1749,7 +1869,7 @@ Don't use it directly." ;; to `read-buffer' through `minibuffer-setup-hook' which is too ;; late to be known by `read-buffer-function', in our case ;; `helm--generic-read-buffer'. It should let bind it to allow us - ;; using it. + ;; using it. (let ((minibuffer-completion-table (internal-complete-buffer-except))) (read-buffer prompt (other-buffer (current-buffer)) (confirm-nonexistent-file-or-buffer)))) @@ -2001,11 +2121,11 @@ Keys description: '(helm-ff-update-when-only-one-matched helm-ff-auto-expand-to-home-or-root)) (let* ((action-fn `(("Sole action (Identity)" - . (lambda (candidate) - (if ,marked-candidates - (helm-marked-candidates - :with-wildcard t :all-sources ,all-marked) - (identity candidate)))))) + . ,(lambda (candidate) + (if marked-candidates + (helm-marked-candidates + :with-wildcard t :all-sources all-marked) + (identity candidate)))))) ;; Be sure we don't erase the underlying minibuffer if some. (helm-ff-auto-update-initial-value (and helm-ff-auto-update-initial-value @@ -2411,6 +2531,88 @@ When AFUN, AFIX are nil and CATEGORY is not file return COMPS unmodified." comps)) (t comps))) +;;;###autoload +(defun helm-dynamic-completion (collection predicate &optional point metadata nomode styles) + "Build a completion function for `helm-pattern' in COLLECTION. + +Only the elements of COLLECTION that satisfy PREDICATE are considered. + +Argument POINT is the same as in `completion-all-completions' and +is meaningful only when using some kind of `completion-at-point'. + +The return value is a list of completions that may be sorted by +the sort function provided by the completion-style in +use (emacs-27 only), otherwise (emacs-26) the sort function has +to be provided if needed either with an FCT function in source or +by passing the sort function with METADATA +E.g.: \\='((metadata (display-sort-function . foo))). +Candidates can be modified by passing an affixation-function in METADATA. + +If you don't want the sort fn provided by style to kick +in (emacs-27) you can use as metadata value the symbol `nosort'. + +Example: + + (helm :sources (helm-build-sync-source \"test\" + :candidates (helm-dynamic-completion + \\='(foo bar baz foab) + \\='symbolp) + :match-dynamic t) + :buffer \"*helm test*\") + +When argument NOMODE is non nil don't use `completion-styles' as +specified in `helm-completion-styles-alist' for specific modes. + +When STYLES is specified use these `completion-styles', see +`helm--prepare-completion-styles'. + +Also `helm-completion-style' settings have no effect here, +`emacs' being used inconditionally as value." + (lambda () + (let* (;; Force usage of emacs style otherwise + ;; helm--prepare-completion-styles will reset + ;; completion-styles to default value i.e. (basic partial + ;; emacs22). + (helm-completion-style 'emacs) + (completion-styles + (with-helm-current-buffer + (helm--prepare-completion-styles nomode styles))) + (completion-flex-nospace t) + (nosort (eq metadata 'nosort)) + (compsfn (lambda (str pred _action) + (let* ((completion-ignore-case (helm-set-case-fold-search)) + ;; Use a copy of metadata to avoid accumulation of + ;; adjustment in metadata (This is not needed in + ;; emacs-31+, it has been fixed in emacsbug + ;; #74718). This also avoid the flex adjustment fn + ;; reusing the previous sort fn. + (md (copy-sequence metadata)) + (comps (completion-all-completions + str + (if (functionp collection) + (funcall collection str pred t) + collection) + pred + (or point 0) + (or (and (consp md) md) + (setq metadata '(metadata))))) + (last-data (last comps)) + (sort-fn (unless nosort + (completion-metadata-get + md 'display-sort-function))) + (affix (completion-metadata-get + md 'affixation-function)) + all) + (when (cdr last-data) (setcdr last-data nil)) + (setq all (if (and sort-fn (> (length str) 0)) + (funcall sort-fn comps) + comps)) + (if affix + (helm-completion--decorate all nil affix nil) + all))))) + ;; Ensure circular objects are removed. + (complete-with-action t compsfn helm-pattern predicate)))) + ;; Helm multi matching style (defun helm-completion-try-completion (string table pred point) @@ -2584,7 +2786,6 @@ is non-nil." Can be used for `completion-in-region-function' by advicing it with an :around advice to allow passing the old `completion-in-region-function' value in ORIGFUN." - (cl-declare (special require-match prompt)) (if (memq major-mode helm-mode-no-completion-in-region-in-modes) (funcall origfun start end collection predicate) (advice-add @@ -2627,13 +2828,9 @@ Can be used for `completion-in-region-function' by advicing it with an (crm (eq current-command 'crm-complete)) (str-command (helm-symbol-name current-command)) (buf-name (format "*helm-mode-%s*" str-command)) - (require-match (cond ((boundp 'require-match) require-match) - (minibuffer-completion-confirm) - ;; If prompt have not been propagated here, that's - ;; probably mean we have no prompt and we are in - ;; completion-at-point or friend, so use a non--nil - ;; value for require-match. - ((not (boundp 'prompt))))) + ;; If we have a minibuffer use `minibuffer-completion-confirm' + ;; otherwise assume we use `completion-at-point' and use `t'. + (require-match (if crm minibuffer-completion-confirm t)) (metadata (completion-metadata input collection predicate)) ;; `completion-extra-properties' is let-bounded in `completion-at-point'. ;; `afun' is a closure to call against each string in `data'. @@ -2715,8 +2912,13 @@ Can be used for `completion-in-region-function' by advicing it with an (result (if (stringp data) data (helm-comp-read - ;; Completion-at-point and friends have no prompt. - (or (and (boundp 'prompt) prompt) "Pattern: ") + ;; Completion-at-point and friends have no prompt, + ;; we have a prompt only with CRM, in this case + ;; reuse it. Handle the case where user switched out + ;; of minibuffer, leaving an active minibuffer open. + (or (and (minibufferp (current-buffer)) + (minibuffer-prompt)) + "Pattern: ") data :name str-command :nomark (null crm) @@ -2730,9 +2932,6 @@ Can be used for `completion-in-region-function' by advicing it with an initial-input))) ((string-match "/\\'" initial-input) (and (eq helm-completion-style 'emacs) initial-input)) - ((or (null require-match) - (stringp require-match)) - (helm-mode--completion-in-region-initial-input initial-input)) (t (helm-mode--completion-in-region-initial-input initial-input))) :buffer buf-name :fc-transformer @@ -2834,6 +3033,9 @@ Be sure to know what you are doing when modifying this.") ;; it matches or default to "," if no match. (eq (length crm-separator) 1) crm-separator) + (and (stringp crm-separator) + (or (get-text-property 0 'separator crm-separator) + (string-replace "[ \t]*" "" crm-separator))) helm-crm-default-separator))) ;; Try to find a default separator. If `crm-separator' is a ;; regexp use the string the regexp is matching. @@ -2847,10 +3049,27 @@ Be sure to know what you are doing when modifying this.") (when (looking-back crm-separator (1- (point))) (setq sep (match-string 0)))) (setq sep nil)) + (when (> emacs-major-version 29) + (add-function :override (local 'completion-list-insert-choice-function) + #'helm--crm-insert-fn)) (funcall completion-list-insert-choice-function beg end (mapconcat 'identity (append result '("")) sep)))) (t nil))) +(defun helm--crm-insert-fn (_start _end choice) + ;; Fix Emacs bug~76461. + (let* ((beg (save-excursion + (if (and (re-search-backward crm-separator nil t) + ;; Matches end of prompt (:) when sep is ":". + (not (field-at-pos (point)))) + (1+ (point)) + (minibuffer-prompt-end)))) + (end (save-excursion + (if (re-search-forward crm-separator nil t) + (1- (point)) + (point-max))))) + (completion--replace beg end choice))) + (defun helm-mode--disable-ido-maybe (&optional from-hook) (when (and (boundp 'ido-everywhere) ido-everywhere) (remove-function read-file-name-function #'ido-read-file-name) diff --git a/elpa/helm-20241224.1937/helm-net.el b/elpa/helm-20250515.548/helm-net.el similarity index 93% rename from elpa/helm-20241224.1937/helm-net.el rename to elpa/helm-20250515.548/helm-net.el index 469dfb1a..98baa667 100644 --- a/elpa/helm-20241224.1937/helm-net.el +++ b/elpa/helm-20250515.548/helm-net.el @@ -1,6 +1,6 @@ ;;; helm-net.el --- helm browse url and search web. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -117,27 +117,28 @@ This is a format string, don't forget the `%s'." :group 'helm-net) (defcustom helm-google-suggest-actions - '(("Google Search" . helm-google-suggest-action) - ("Wikipedia" . (lambda (candidate) - (helm-search-suggest-perform-additional-action - helm-search-suggest-action-wikipedia-url - candidate))) - ("Youtube" . (lambda (candidate) + (helm-make-actions + "Google Search" 'helm-google-suggest-action + "Wikipedia" (lambda (candidate) + (helm-search-suggest-perform-additional-action + helm-search-suggest-action-wikipedia-url + candidate)) + "Youtube" (lambda (candidate) + (helm-search-suggest-perform-additional-action + helm-search-suggest-action-youtube-url + candidate)) + "IMDb" (lambda (candidate) + (helm-search-suggest-perform-additional-action + helm-search-suggest-action-imdb-url + candidate)) + "Google Maps" (lambda (candidate) (helm-search-suggest-perform-additional-action - helm-search-suggest-action-youtube-url + helm-search-suggest-action-google-maps-url + candidate)) + "Google News" (lambda (candidate) + (helm-search-suggest-perform-additional-action + helm-search-suggest-action-google-news-url candidate))) - ("IMDb" . (lambda (candidate) - (helm-search-suggest-perform-additional-action - helm-search-suggest-action-imdb-url - candidate))) - ("Google Maps" . (lambda (candidate) - (helm-search-suggest-perform-additional-action - helm-search-suggest-action-google-maps-url - candidate))) - ("Google News" . (lambda (candidate) - (helm-search-suggest-perform-additional-action - helm-search-suggest-action-google-news-url - candidate)))) "List of actions for google suggest sources." :group 'helm-net :type '(alist :key-type string :value-type function)) diff --git a/elpa/helm-20241224.1937/helm-occur.el b/elpa/helm-20250515.548/helm-occur.el similarity index 99% rename from elpa/helm-20241224.1937/helm-occur.el rename to elpa/helm-20250515.548/helm-occur.el index be2e6419..931ecf5b 100644 --- a/elpa/helm-20241224.1937/helm-occur.el +++ b/elpa/helm-20250515.548/helm-occur.el @@ -1,6 +1,6 @@ ;;; helm-occur.el --- Incremental Occur for Helm. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -116,7 +116,7 @@ Any other non--nil value update after confirmation." Use this to display lines with their text properties in helm-occur buffer. Can be one of `buffer-substring' or `buffer-substring-no-properties'. -See `helm-occur-buffer-substring-default-mode' to setup this globally. +See `helm-occur-buffer-substring-default-mode' to setup this globally. Note that when using `buffer-substring' initialization will be slower." :type '(alist :key-type (symbol :tag "Mode") @@ -799,11 +799,11 @@ RESET non-nil means rewind to the first match. This is the `next-error-function' for `helm-occur-mode'." (interactive "p") (goto-char (cond (reset (point-min)) - ((and (< argp 0) helm-current-error) + ((and (< argp 0) helm-current-error) (line-beginning-position)) - ((and (> argp 0) helm-current-error) + ((and (> argp 0) helm-current-error) (line-end-position)) - ((point)))) + ((point)))) (let ((fun (if (> argp 0) #'next-single-property-change #'previous-single-property-change))) diff --git a/elpa/helm-20241224.1937/helm-packages.el b/elpa/helm-20250515.548/helm-packages.el similarity index 95% rename from elpa/helm-20241224.1937/helm-packages.el rename to elpa/helm-20250515.548/helm-packages.el index 906a5950..181c128f 100644 --- a/elpa/helm-20241224.1937/helm-packages.el +++ b/elpa/helm-20250515.548/helm-packages.el @@ -1,6 +1,6 @@ -;;; helm-packages.el --- helm interface to manage packages -*- lexical-binding: t; -*- +;;; helm-packages.el --- helm interface to manage packages -*- lexical-binding: t; -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -37,9 +37,9 @@ (find-file-target :initform #'helm-packages-quit-an-find-file) (filtered-candidate-transformer :initform - '(helm-packages-transformer - (lambda (candidates _source) - (sort candidates #'helm-generic-sort-fn)))) + `(helm-packages-transformer + ,(lambda (candidates _source) + (sort candidates #'helm-generic-sort-fn)))) (update :initform #'helm-packages--refresh-contents)) "A class to define `helm-packages' sources.") @@ -163,13 +163,22 @@ as dependencies." (async-package-do-action 'install mkd error-file) (helm-packages-install--sync mkd)))))) +(defun helm-packages--get-deps (pkg) + "Recursively find PKG dependencies." + (let ((desc (cadr (assq pkg package-archive-contents)))) + (when desc + (cl-loop for req in (package-desc-reqs desc) ; (foo (1 2 3)) + for sym = (car req) + nconc (cons sym (helm-packages--get-deps sym)) into pkgs + finally return (helm-fast-remove-dups pkgs))))) + (defun helm-packages-isolate-1 (packages &optional _ignore) "Start an Emacs with only PACKAGES loaded. Arg PACKAGES is a list of strings." (let* ((name (concat "package-isolate-" (mapconcat #'identity packages "_"))) (deps (cl-loop for p in packages for sym = (intern p) - nconc (package--dependencies sym)))) + nconc (helm-packages--get-deps sym)))) (apply #'start-process name nil (list (expand-file-name invocation-name invocation-directory) "-Q" "--debug-init" @@ -277,7 +286,7 @@ Arg PACKAGES is a list of strings." (defun helm-finder--list-matches (key) (let* ((id (intern key)) (built-in (gethash id finder-keywords-hash)) - (exts (cl-loop for p in package-archive-contents + (exts (cl-loop for p in package-archive-contents for sym = (car p) when (package--has-keyword-p (package-get-descriptor sym) @@ -298,9 +307,9 @@ Arg PACKAGES is a list of strings." 'global (helm-fast-remove-dups (helm-finder--list-matches candidate)))) :filtered-candidate-transformer - (list #'helm-packages-transformer - (lambda (candidates _source) - (sort candidates #'helm-generic-sort-fn))) + `(helm-packages-transformer + ,(lambda (candidates _source) + (sort candidates #'helm-generic-sort-fn))) :action-transformer (lambda (actions candidate) (if (package-installed-p candidate) @@ -322,7 +331,7 @@ Arg PACKAGES is a list of strings." when (not (assq sym package-alist)) nconc (list (list sym (package--from-builtin (cons sym vec)))))) - package-alist))) + package-alist))) (cl-loop for (sym desc) in pkgs for pkg = (assq sym package-archive-contents) for cversion = (and pkg (package-desc-version desc)) diff --git a/elpa/helm-20241224.1937/helm-pkg.el b/elpa/helm-20250515.548/helm-pkg.el similarity index 66% rename from elpa/helm-20241224.1937/helm-pkg.el rename to elpa/helm-20250515.548/helm-pkg.el index f4c7aaef..5e95654f 100644 --- a/elpa/helm-20241224.1937/helm-pkg.el +++ b/elpa/helm-20250515.548/helm-pkg.el @@ -1,11 +1,11 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "helm" "20241224.1937" +(define-package "helm" "20250515.548" "Helm is an Emacs incremental and narrowing framework." - '((helm-core "4.0") + '((helm-core "4.0.3") (wfnames "1.2")) - :url "https://github.com/emacs-helm/helm" - :commit "54f852b3ddc714e77a8b8a47bbda6caea4e845e0" - :revdesc "54f852b3ddc7" + :url "https://emacs-helm.github.io/helm/" + :commit "387b8c8c5ae83150151672979d432e9cd790b79a" + :revdesc "387b8c8c5ae8" :keywords '("helm" "convenience" "files" "buffers" "grep" "completion" "lisp" "matching" "tools" "help") :authors '(("Thierry Volpiatto" . "thievol@posteo.net")) :maintainers '(("Thierry Volpiatto" . "thievol@posteo.net"))) diff --git a/elpa/helm-20241224.1937/helm-regexp.el b/elpa/helm-20250515.548/helm-regexp.el similarity index 98% rename from elpa/helm-20241224.1937/helm-regexp.el rename to elpa/helm-20250515.548/helm-regexp.el index 73f00214..767e883c 100644 --- a/elpa/helm-20241224.1937/helm-regexp.el +++ b/elpa/helm-20250515.548/helm-regexp.el @@ -1,6 +1,6 @@ ;;; helm-regexp.el --- In buffer regexp searching and replacement for helm. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-ring.el b/elpa/helm-20250515.548/helm-ring.el similarity index 99% rename from elpa/helm-20241224.1937/helm-ring.el rename to elpa/helm-20250515.548/helm-ring.el index 18f08346..4431d371 100644 --- a/elpa/helm-20241224.1937/helm-ring.el +++ b/elpa/helm-20250515.548/helm-ring.el @@ -1,6 +1,6 @@ ;;; helm-ring.el --- kill-ring, mark-ring, and register browsers for helm. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -546,7 +546,7 @@ See (info \"(emacs) Keyboard Macros\") for detailed infos." (cons (kmacro-ring-head) kmacro-ring) :test 'equal))) - + :multiline t :candidate-transformer (lambda (candidates) diff --git a/elpa/helm-20241224.1937/helm-semantic.el b/elpa/helm-20250515.548/helm-semantic.el similarity index 100% rename from elpa/helm-20241224.1937/helm-semantic.el rename to elpa/helm-20250515.548/helm-semantic.el diff --git a/elpa/helm-20241224.1937/helm-sys.el b/elpa/helm-20250515.548/helm-sys.el similarity index 92% rename from elpa/helm-20241224.1937/helm-sys.el rename to elpa/helm-20250515.548/helm-sys.el index 1c3cf501..e382bdd3 100644 --- a/elpa/helm-20241224.1937/helm-sys.el +++ b/elpa/helm-20250515.548/helm-sys.el @@ -1,6 +1,6 @@ ;;; helm-sys.el --- System related functions for helm. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -221,26 +221,26 @@ Return empty string for non--valid candidates." Show actions only on line starting by a PID." (let ((disp (helm-get-selection nil t))) (cond ((string-match "\\` *[0-9]+" disp) - (list '("kill (SIGTERM)" . (lambda (_pid) - (helm-top-sh "TERM" (helm-top--marked-pids)))) - '("kill (SIGKILL)" . (lambda (_pid) - (helm-top-sh "KILL" (helm-top--marked-pids)))) - '("kill (SIGINT)" . (lambda (_pid) - (helm-top-sh "INT" (helm-top--marked-pids)))) - '("kill (Choose signal)" - . (lambda (_pid) - (let ((pids (helm-top--marked-pids))) - (helm-top-sh - (helm-comp-read (format "Kill %d pids with signal: " - (length pids)) - '("ALRM" "HUP" "INT" "KILL" "PIPE" "POLL" - "PROF" "TERM" "USR1" "USR2" "VTALRM" - "STKFLT" "PWR" "WINCH" "CHLD" "URG" - "TSTP" "TTIN" "TTOU" "STOP" "CONT" - "ABRT" "FPE" "ILL" "QUIT" "SEGV" - "TRAP" "SYS" "EMT" "BUS" "XCPU" "XFSZ") - :must-match t) - pids)))))) + `(("kill (SIGTERM)" . ,(lambda (_pid) + (helm-top-sh "TERM" (helm-top--marked-pids)))) + ("kill (SIGKILL)" . ,(lambda (_pid) + (helm-top-sh "KILL" (helm-top--marked-pids)))) + ("kill (SIGINT)" . ,(lambda (_pid) + (helm-top-sh "INT" (helm-top--marked-pids)))) + ("kill (Choose signal)" + . ,(lambda (_pid) + (let ((pids (helm-top--marked-pids))) + (helm-top-sh + (helm-comp-read (format "Kill %d pids with signal: " + (length pids)) + '("ALRM" "HUP" "INT" "KILL" "PIPE" "POLL" + "PROF" "TERM" "USR1" "USR2" "VTALRM" + "STKFLT" "PWR" "WINCH" "CHLD" "URG" + "TSTP" "TTIN" "TTOU" "STOP" "CONT" + "ABRT" "FPE" "ILL" "QUIT" "SEGV" + "TRAP" "SYS" "EMT" "BUS" "XCPU" "XFSZ") + :must-match t) + pids)))))) (t actions)))) (defun helm-top--marked-pids () diff --git a/elpa/helm-20241224.1937/helm-tags.el b/elpa/helm-20250515.548/helm-tags.el similarity index 99% rename from elpa/helm-20241224.1937/helm-tags.el rename to elpa/helm-20250515.548/helm-tags.el index d414da3d..53a87773 100644 --- a/elpa/helm-20241224.1937/helm-tags.el +++ b/elpa/helm-20250515.548/helm-tags.el @@ -1,6 +1,6 @@ ;;; helm-tags.el --- Helm for Etags. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20241224.1937/helm-types.el b/elpa/helm-20250515.548/helm-types.el similarity index 91% rename from elpa/helm-20241224.1937/helm-types.el rename to elpa/helm-20250515.548/helm-types.el index b33488fb..1de00334 100644 --- a/elpa/helm-20241224.1937/helm-types.el +++ b/elpa/helm-20250515.548/helm-types.el @@ -1,8 +1,8 @@ ;;; helm-types.el --- Helm types classes and methods. -*- lexical-binding: t -*- -;; Copyright (C) 2015 ~ 2020 Thierry Volpiatto +;; Copyright (C) 2015 ~ 2025 Thierry Volpiatto -;; Author: Thierry Volpiatto +;; Author: Thierry Volpiatto ;; URL: http://github.com/emacs-helm/helm ;; This program is free software; you can redistribute it and/or modify @@ -34,7 +34,10 @@ ;; Files -(defclass helm-type-file (helm-source) () +(defclass helm-type-file (helm-source) + ((completing-file-name + :initarg :completing-file-name :initform t + :documentation "Flag to notify we are completing filenames.")) "A class to define helm type file.") (cl-defmethod helm-source-get-action-from-type ((object helm-type-file)) @@ -140,6 +143,7 @@ "Bookmark edit annotation" 'bookmark-edit-annotation "Delete marked bookmark(s)" 'helm-delete-marked-bookmarks "Edit Bookmark" 'helm-bookmark-edit-bookmark + "Reset Bookmark to current pos" 'bookmark-set "Rename marked bookmark(s)" 'helm-bookmark-rename-marked "Relocate bookmark" 'bookmark-relocate) "Default actions for type bookmarks." @@ -296,18 +300,18 @@ "A class to define helm type timers.") (defcustom helm-type-timers-actions - '(("Cancel Timer" . (lambda (_timer) - (let ((mkd (helm-marked-candidates))) - (cl-loop for timer in mkd - do (cancel-timer timer))))) - ("Describe Function" . (lambda (tm) - (describe-function (timer--function tm)))) - ("Find Function" . (lambda (tm) - (helm-aif (timer--function tm) - (if (or (byte-code-function-p it) - (helm-subr-native-elisp-p it)) - (message "Can't find anonymous function `%s'" it) - (find-function it)))))) + `(("Cancel Timer" . ,(lambda (_timer) + (let ((mkd (helm-marked-candidates))) + (cl-loop for timer in mkd + do (cancel-timer timer))))) + ("Describe Function" . ,(lambda (tm) + (describe-function (timer--function tm)))) + ("Find Function" . ,(lambda (tm) + (helm-aif (timer--function tm) + (if (or (byte-code-function-p it) + (helm-subr-native-elisp-p it)) + (message "Can't find anonymous function `%s'" it) + (find-function it)))))) "Default actions for type timers." :group 'helm-elisp :type '(alist :key-type string :value-type function)) @@ -325,12 +329,13 @@ ;; Builders. (defun helm-build-type-file () (helm-make-type 'helm-type-file)) - +(make-obsolete 'helm-build-type-file 'helm-make-source "4.0.3") (defun helm-build-type-function () (helm-make-type 'helm-type-function)) - +(make-obsolete 'helm-build-type-function 'helm-make-source "4.0.3") (defun helm-build-type-command () (helm-make-type 'helm-type-command)) +(make-obsolete 'helm-build-type-command 'helm-make-source "4.0.3") (provide 'helm-types) diff --git a/elpa/helm-20241224.1937/helm-utils.el b/elpa/helm-20250515.548/helm-utils.el similarity index 99% rename from elpa/helm-20241224.1937/helm-utils.el rename to elpa/helm-20250515.548/helm-utils.el index 5678b964..f6496fbf 100644 --- a/elpa/helm-20241224.1937/helm-utils.el +++ b/elpa/helm-20250515.548/helm-utils.el @@ -1,6 +1,6 @@ ;;; helm-utils.el --- Utilities Functions for helm. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -1053,8 +1053,9 @@ Assume regexp is a pcre based regexp." (defvar helm--show-help-echo-timer nil) (defvar helm--maybe-show-help-echo-overlay nil) (defface helm-tooltip - '((t :background "Goldenrod" - :foreground "black")) + '((((type tty pc)) + :background "yellow" :foreground "black") + (t :background "Goldenrod" :foreground "black")) "Face used by `helm-tooltip-show'." :group 'helm-grep-faces) diff --git a/elpa/helm-20241224.1937/helm-x-files.el b/elpa/helm-20250515.548/helm-x-files.el similarity index 99% rename from elpa/helm-20241224.1937/helm-x-files.el rename to elpa/helm-20250515.548/helm-x-files.el index 3cc2fae7..0552a47a 100644 --- a/elpa/helm-20241224.1937/helm-x-files.el +++ b/elpa/helm-20250515.548/helm-x-files.el @@ -1,6 +1,6 @@ ;;; helm-x-files.el --- helm auxiliary functions and sources. -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/helm-20250515.548/helm-x-icons.el b/elpa/helm-20250515.548/helm-x-icons.el new file mode 100644 index 00000000..708ec21e --- /dev/null +++ b/elpa/helm-20250515.548/helm-x-icons.el @@ -0,0 +1,161 @@ +;;; helm-x-icons.el --- Provide compatibility between icons providers -*- lexical-binding: t -*- + +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Code: + +(require 'helm-lib) + +(defgroup helm-x-icons nil + "Compatibility functions between icons provider packages." + :group 'helm) + +(defcustom helm-x-icons-provider 'all-the-icons + "The icons provider package. +The currently supported providers are `all-the-icons' and `nerd-icons'. +Do not use setq to set this variable but customize." + :type '(choice + (const :tag "Use `all-the-icons' package" all-the-icons) + (const :tag "Use `nerd-icons' package" nerd-icons)) + :set (lambda (var val) + (when val (require val nil t)) + (set var val))) + +(defun helm-x-icons-match-to-alist (file type) + "Match FILE against an entry in ALIST using `string-match-p'. +Supported TYPE are ext, regexp, mode, url and dir." + (cl-loop with alist = (helm-x-icons-resolve-alist type) + for (elm . rest) in alist + for target = (if (eq type 'url) file (helm-basename file)) + when (string-match-p (helm-stringify elm) target) + return rest)) + +(defun helm-x-icons-resolve-alist (type) + "Return the icon alist corresponding to TYPE. +The returned alist is computed according to `helm-x-icons-provider'." + (let* ((provider-name (symbol-name helm-x-icons-provider)) + (alist-name (helm-acase type + (ext "extension-icon-alist") + (regexp "regexp-icon-alist") + (dir "dir-icon-alist") + (url "url-alist") + (mode "mode-icon-alist")))) + (symbol-value + (intern-soft (concat provider-name "-" alist-name))))) + +(defun helm-x-icons-icon-for-file (&rest args) + "Compatibility function for `*-icon-for-file'." + (let ((fn (helm-acase helm-x-icons-provider + (all-the-icons 'all-the-icons-icon-for-file) + (nerd-icons 'nerd-icons-icon-for-file)))) + (when fn (apply fn args)))) + +(defvar helm-x-icons-nerd-icons-compat-alist + '(("file-symlink-directory" . (nerd-icons-codicon . "nf-cod-file_symlink_directory")) + ("file-directory" . (nerd-icons-sucicon . "nf-custom-folder_oct")) + ("star" . (nerd-icons-mdicon . "nf-md-star")) + ("mail-read" . (nerd-icons-codicon . "nf-cod-mail_read")) + ("info" . (nerd-icons-faicon . "nf-fa-info")) + ("link-external" . (nerd-icons-faicon . "nf-fa-external_link")) + ("mail" . (nerd-icons-mdicon . "nf-md-email")) + ("note_add" . (nerd-icons-codicon . "nf-cod-new_file")) + ("create_new_folder" . (nerd-icons-codicon . "nf-cod-new_folder")) + ("firefox" . (nerd-icons-faicon . "nf-fa-firefox")) + ("globe" . (nerd-icons-faicon . "nf-fa-globe")) + ("man-page" . (nerd-icons-octicon . "nf-oct-command_palette")) + ("crop" . (nerd-icons-faicon . "nf-fa-crop")) + ("package" . (nerd-icons-octicon . "nf-oct-package")) + ("color_lens" . (nerd-icons-mdicon . "nf-md-color_lens")) + ("cube" . (nerd-icons-mdicon . "nf-md-cube")) + ("three-bars" . (nerd-icons-codicon . "nf-code-three_bars")) + ("cog" . (nerd-icons-mdicon . "nf-md-cog")) + ("lightning" . (nerd-icons-mdicon . "nf-md-lightning_bolt")) + ("file" . (nerd-icons-mdicon . "nf-md-file")) + ("folder" . (nerd-icons-mdicon . "nf-md-folder")) + ("key" . (nerd-icons-faicon . "nf-fa-key")) + ("angle-double-right" . (nerd-icons-faicon . "nf-fa-angle-double-right")) + ("calculator" . (nerd-icons-mdicon . "nf-md-calculator")) + ("book" . (nerd-icons-codicon . "nf-cod-book")) + ("border_style" . (nerd-icons-mdicon . "nf-md-border_style")) + ("text_fields" . (nerd-icons-mdicon . "nf-md-text")) + ("code" . (nerd-icons-faicon . "nf-fa-code")) + ("bar-chart" . (nerd-icons-faicon . "nf-fa-bar_chart")) + ("clone" . (nerd-icons-faicon . "nf-fa-clone"))) + "The `nerd-icons' counterpart for icon names. +The `helm-x-icons-generic' function uses this alist to find `nerd-icons' +functions and names to display icons. +To each icon added here, its all-the-icons counterpart have to be added in +`helm-x-icons-all-the-icons-compat-alist'.") + +(defvar helm-x-icons-all-the-icons-compat-alist + '(("file-symlink-directory" . (all-the-icons-octicon . "file-symlink-directory")) + ("file-directory" . (all-the-icons-octicon . "file-directory")) + ("star" . (all-the-icons-octicon . "star")) + ("mail-read" . (all-the-icons-octicon . "mail-read")) + ("info" . (all-the-icons-octicon . "info")) + ("link-external" . (all-the-icons-octicon . "link-external")) + ("mail" . (all-the-icons-octicon . "mail")) + ("note_add" . (all-the-icons-material . "note_add")) + ("create_new_folder" . (all-the-icons-material . "create_new_folder")) + ("firefox" . (all-the-icons-faicon . "firefox")) + ("globe" . (all-the-icons-faicon . "globe")) + ("man-page" . (all-the-icons-fileicon . "man-page")) + ("crop" . (all-the-icons-material . "crop")) + ("package" . (all-the-icons-octicon . "package")) + ("color_lens" . (all-the-icons-material . "color_lens")) + ("cube" . (all-the-icons-faicon . "cube")) + ("three-bars" . (all-the-icons-octicon . "three-bars")) + ("cog" . (all-the-icons-faicon . "cog")) + ("lightning" . (all-the-icons-wicon . "lightning")) + ("file" . (all-the-icons-faicon . "file")) + ("folder" . (all-the-icons-faicon . "folder")) + ("key" . (all-the-icons-octicon . "key")) + ("angle-double-right" . (all-the-icons-faicon . "angle-double-right")) + ("calculator" . (all-the-icons-faicon . "calculator")) + ("book" . (all-the-icons-octicon . "book")) + ("border_style" . (all-the-icons-material . "border_style")) + ("text_fields" . (all-the-icons-material . "text_fields")) + ("code" . (all-the-icons-material . "code")) + ("bar-chart" . (all-the-icons-faicon . "bar-chart")) + ("clone" . (all-the-icons-faicon . "clone"))) + "The `all-the-icons' counterpart for icon names. +The `helm-x-icons-generic' function uses this alist to find `all-the-icons' +functions and names to display icons. +To each icon added here, its all-the-icons counterpart have to be added in +`helm-x-icons-nerd-icons-compat-alist'.") + +(defun helm-x-icons-generic (icon-name &rest args) + "Compatibility function for icons. +Run an `all-the-icons' or `nerd-icons' function according to +`helm-x-icons-provider'and ICON-NAME. +Functions and icon names are found in `helm-x-icons-all-the-icons-compat-alist' +and `helm-x-icons-nerd-icons-compat-alist'." + (let (fn) + (helm-acase helm-x-icons-provider + (nerd-icons + (helm-acase (assoc-default icon-name helm-x-icons-nerd-icons-compat-alist) + ((dst* (sym . name)) + (setq fn sym icon-name name)))) + (all-the-icons + (helm-acase (assoc-default icon-name helm-x-icons-all-the-icons-compat-alist) + ((dst* (sym . name)) + (setq fn sym icon-name name))))) + (when fn (apply fn icon-name args)))) + + +(provide 'helm-x-icons) + +;;; helm-x-icons.el ends here diff --git a/elpa/helm-20241224.1937/helm.el b/elpa/helm-20250515.548/helm.el similarity index 91% rename from elpa/helm-20241224.1937/helm.el rename to elpa/helm-20250515.548/helm.el index bde24dd8..b9191cd4 100644 --- a/elpa/helm-20241224.1937/helm.el +++ b/elpa/helm-20250515.548/helm.el @@ -2,7 +2,7 @@ ;; Copyright (C) 2007 Tamas Patrovics ;; 2008 ~ 2011 rubikitch -;; 2011 ~ 2023 Thierry Volpiatto +;; 2011 ~ 2025 Thierry Volpiatto ;; This is a fork of anything.el wrote by Tamas Patrovics. @@ -11,10 +11,10 @@ ;; Thierry Volpiatto ;; Author: Thierry Volpiatto -;; Package-Version: 20241224.1937 -;; Package-Revision: 54f852b3ddc7 +;; Package-Version: 20250515.548 +;; Package-Revision: 387b8c8c5ae8 ;; URL: https://emacs-helm.github.io/helm/ -;; Package-Requires: ((helm-core "4.0") (wfnames "1.2")) +;; Package-Requires: ((helm-core "4.0.3") (wfnames "1.2")) ;; Keywords: helm, convenience, files, buffers, grep, completion, lisp, matching, tools, help ;; This program is free software; you can redistribute it and/or modify diff --git a/elpa/helm-core-20241225.641/helm-core-autoloads.el b/elpa/helm-core-20250514.1025/helm-core-autoloads.el similarity index 93% rename from elpa/helm-core-20241225.641/helm-core-autoloads.el rename to elpa/helm-core-20250514.1025/helm-core-autoloads.el index 2e3bf3a7..175f9bd9 100644 --- a/elpa/helm-core-20241225.641/helm-core-autoloads.el +++ b/elpa/helm-core-20250514.1025/helm-core-autoloads.el @@ -223,6 +223,19 @@ Call `helm' only with SOURCES and BUFFER as args. ;;; Generated autoloads from helm-lib.el +(autoload 'helm-add-to-list "helm-lib" "\ +Add or move ELM to the value of VAR at INDEX unless already here. + +If ELM is member of var value and at index INDEX, return var value +unchanged, if INDEX value is different move ELM at this `nth' INDEX value. +If ELM is not present in list add it at `nth' INDEX. + +If REPLACE is non nil replace element at INDEX by ELM. + +Do not use this function in helm code, use `helm-append-at-nth' +instead. It is meant to be used in config files only. + +(fn VAR ELM INDEX &optional REPLACE)") (register-definition-prefixes "helm-lib" '("helm-" "with-helm-")) diff --git a/elpa/helm-core-20241225.641/helm-core-pkg.el b/elpa/helm-core-20250514.1025/helm-core-pkg.el similarity index 54% rename from elpa/helm-core-20241225.641/helm-core-pkg.el rename to elpa/helm-core-20250514.1025/helm-core-pkg.el index 68bb16b3..43fb7e38 100644 --- a/elpa/helm-core-20241225.641/helm-core-pkg.el +++ b/elpa/helm-core-20250514.1025/helm-core-pkg.el @@ -1,10 +1,10 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "helm-core" "20241225.641" +(define-package "helm-core" "20250514.1025" "Development files for Helm." '((emacs "25.1") - (async "1.9.8")) - :url "https://github.com/emacs-helm/helm" - :commit "d1c4965fefb2c677b85ece70df219e672577631c" - :revdesc "d1c4965fefb2" + (async "1.9.9")) + :url "https://emacs-helm.github.io/helm/" + :commit "e03edf775af41053c8a4de98f370689d4525077b" + :revdesc "e03edf775af4" :authors '(("Thierry Volpiatto" . "thievol@posteo.net")) :maintainers '(("Thierry Volpiatto" . "thievol@posteo.net"))) diff --git a/elpa/helm-core-20241225.641/helm-core.el b/elpa/helm-core-20250514.1025/helm-core.el similarity index 98% rename from elpa/helm-core-20241225.641/helm-core.el rename to elpa/helm-core-20250514.1025/helm-core.el index 822b2901..43a1008b 100644 --- a/elpa/helm-core-20241225.641/helm-core.el +++ b/elpa/helm-core-20250514.1025/helm-core.el @@ -1,12 +1,12 @@ ;;; helm-core.el --- Development files for Helm -*- lexical-binding: t -*- -;; Copyright (C) 2022 ~ 2023 Thierry Volpiatto +;; Copyright (C) 2022 ~ 2025 Thierry Volpiatto ;; Author: Thierry Volpiatto ;; URL: https://emacs-helm.github.io/helm/ -;; Package-Version: 20241225.641 -;; Package-Revision: d1c4965fefb2 -;; Package-Requires: ((emacs "25.1") (async "1.9.8")) +;; Package-Version: 20250514.1025 +;; Package-Revision: e03edf775af4 +;; Package-Requires: ((emacs "25.1") (async "1.9.9")) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -43,6 +43,9 @@ (declare-function helm-quit-and-find-file "helm-utils.el") (declare-function linum-mode "linum.el") (declare-function minibuffer-depth-setup "mb-depth.el") +(declare-function transient--delete-window "ext:transient" ()) +(declare-function transient--preserve-window-p "ext:transient" + (&optional nohide)) (defvar helm-marked-buffer-name) (defvar display-buffer-function) @@ -283,14 +286,14 @@ Arg OTHER-SUBKEYS should be an alist composed of (command . short-key) where command is another command than COMMAND bound to short-key. A PROMPT can be used to describe bindings of COMMAND and OTHER-SUBKEYS. - + Return an anonymous interactive command to use with `helm-define-key-with-subkeys'." (lambda () (interactive) (let (timer) (call-interactively command) - (unless (or defining-kbd-macro executing-kbd-macro) + (unless (or defining-kbd-macro executing-kbd-macro) (unwind-protect (progn (when delay @@ -436,6 +439,7 @@ i.e. the loop is not entered after running COMMAND." (define-key map (kbd "M-a") #'helm-mark-all) (define-key map (kbd "M-U") #'helm-unmark-all) (define-key map (kbd "C-M-a") #'helm-show-all-candidates-in-source) + (define-key map (kbd "C-M-f") #'helm-limit-to-sources) (define-key map (kbd "C-M-e") #'helm-display-all-sources) (define-key map (kbd "C-s") #'undefined) (define-key map (kbd "M-s") #'undefined) @@ -543,6 +547,8 @@ Default to Helm group when group is not defined in source." This is a format spec where %d will be replaced by the candidate number. +This is useful when `helm-display-line-numbers-mode' is turned on. + NOTE: `setq' have no effect until you restart Emacs, use customize for immediate effect." :group 'helm @@ -555,6 +561,8 @@ customize for immediate effect." This is a format spec where %d will be replaced by the candidate number. +This is useful when `helm-display-line-numbers-mode' is turned on. + NOTE: `setq' have no effect until you restart Emacs, use customize for immediate effect." :group 'helm @@ -635,13 +643,13 @@ If t, then Helm does not pop-up a new window." :type 'string) (defcustom helm-save-configuration-functions - '(set-window-configuration . current-window-configuration) + '(set-window-configuration . helm-current-window-configuration) "Functions used to restore or save configurations for frames and windows. Specified as a pair of functions, where car is the restore function and cdr is the save function. To save and restore frame configuration, set this variable to -\\='(set-frame-configuration . current-frame-configuration) +\\='(set-frame-configuration . helm-current-frame-configuration) NOTE: This may not work properly with own-frame minibuffer settings. Older versions saves/restores frame configuration, but @@ -1140,7 +1148,11 @@ then doesn't use `while-no-input', because `while-no-input' throws on :group 'helm) (defface helm-source-header - `((((background dark)) + `((((type tty pc)) + ,@(and (>= emacs-major-version 27) '(:extend t)) + :background "blue" + :foreground "white") + (((background dark)) ,@(and (>= emacs-major-version 27) '(:extend t)) :background "#22083397778B" :foreground "white" @@ -1182,7 +1194,7 @@ then doesn't use `while-no-input', because `while-no-input' throws on (defface helm-candidate-number `((((background dark)) ,@(and (>= emacs-major-version 27) '(:extend t)) - :background "Yellow" :foreground "black") + :background "yellow" :foreground "black") (((background light)) ,@(and (>= emacs-major-version 27) '(:extend t)) :background "#faffb5" :foreground "black")) @@ -1196,7 +1208,10 @@ then doesn't use `while-no-input', because `while-no-input' throws on :group 'helm-faces) (defface helm-selection - `((((background dark)) + `((((type tty pc)) + ,@(and (>= emacs-major-version 27) '(:extend t)) + :inherit isearch) + (((background dark)) ,@(and (>= emacs-major-version 27) '(:extend t)) :background "ForestGreen" :distant-foreground "black") @@ -1268,6 +1283,13 @@ Allow specifying the height of this line." `((t :inherit default)) "Face for string `helm-visible-mark-prefix'." :group 'helm-faces) + +(defface helm-dim-prompt + `((((class color) (min-colors 88) (background dark)) + :foreground "DimGray") + (t :inherit shadow)) + "Face used for shadowing prompt while updating." + :group 'helm-faces) ;;; Variables. ;; @@ -1696,7 +1718,7 @@ and creating a new one at each session, see `helm-display-buffer-reuse-frame'. Normally you don't have to use this, it have been made to workaround slow frame popup in Emacs-26, to workaround this slowness in Emacs-26 use instead -#+begin_src elisp +#+begin_src elisp (when (= emacs-major-version 26) (setq x-wait-for-event-timeout nil)) #+end_src @@ -2016,9 +2038,9 @@ The hook should takes one arg SOURCES.") (defvar helm-dim-prompt-on-update nil "Dim prompt when updating. -Do not set this globaly. Do not use this in async sources or in +Do not set this globally. Do not use this in async sources or in commands using an async source in their sources. -Use this either let-bounded of helm buffer local.") +Use this either let-bounded or helm buffer local.") ;; Utility: logging (defun helm-log (from format-string &rest args) @@ -2401,6 +2423,29 @@ show ARG number of candidates." (helm-set-source-filter nil))) (put 'helm-display-all-sources 'helm-only t) +(defun helm-limit-to-sources () + "Limit sources to display from current session. +This is a toggle command, when hit a second time reset to all sources." + (interactive) + (with-helm-alive-p + (with-helm-buffer + (if (null helm-source-filter) + (when (cdr helm-sources) + (let ((headers (helm-comp-read + "Limit to source(s): " + (mapcar + (lambda (s) + (let* ((name (assoc-default 'name s)) + (disp (helm-aif (assoc-default 'header-name s) + (funcall it name) name))) + (cons disp name))) + helm-sources) + :marked-candidates t + :allow-nest t + :buffer "*helm sources*"))) + (helm-set-source-filter headers))) + (helm-set-source-filter nil))))) +(put 'helm-limit-to-sources 'helm-only t) ;;; Source infos fns. ;; @@ -3025,7 +3070,7 @@ HISTORY args see `helm'." ;; When non-nil (the default) the current active ;; minibuffer is used in new frame, which is not what we ;; want in helm when starting from an active minibuffer, - ;; either a helm minibuffer or something line M-:. + ;; either a helm minibuffer or something line M-:. (and ori--minibuffer-follows-selected-frame (setq minibuffer-follows-selected-frame (unless (or helm--nested @@ -3370,6 +3415,14 @@ frame configuration as per `helm-save-configuration-functions'." ((symbol-function 'x-focus-frame) #'ignore)) (select-frame-set-input-focus frame)))))) +(defun helm-current-window-configuration () + "Like `current-window-configuration' but deal with Transient incompatibility. +See https://github.com/magit/transient/discussions/361 for details." + (when (and (window-live-p (bound-and-true-p transient--window)) + (not (transient--preserve-window-p))) + (transient--delete-window)) + (current-window-configuration)) + (defun helm-split-window-default-fn (window) "Default function to split windows before displaying `helm-buffer'. @@ -3466,7 +3519,7 @@ The function used to display `helm-buffer' by calling helm-reuse-last-window-split-state) (helm-acase helm-split-window-default-side ((same other) it) ; take precedence on *-window-side-state. - ((guard* helm--window-side-state) guard) + ((guard* (progn helm--window-side-state)) guard) (t it)) helm-split-window-default-side)) (disp-fn (with-current-buffer buffer @@ -3550,9 +3603,14 @@ version < emacs-28." (helm-default-display-buffer buffer) (setq helm--buffer-in-new-frame-p t) (let* ((pos (window-absolute-pixel-position)) + (px (car pos)) + (py (cdr pos)) (half-screen-size (/ (display-pixel-height x-display-name) 2)) (frame-info (frame-geometry)) + (screen-width (display-pixel-width x-display-name)) + (helm-frame-width (* (frame-char-width) (+ 2 helm-display-buffer-width))) (prmt-size (length helm--prompt)) + (prmt-width (* prmt-size (frame-char-width))) (line-height (frame-char-height)) tab-bar-mode (new-frame-alist @@ -3562,25 +3620,24 @@ version < emacs-28." `((width . ,helm-display-buffer-width) (height . ,helm-display-buffer-height) (tool-bar-lines . 0) - (left . ,(- (car pos) - (* (frame-char-width) - (if (< (- (point) (pos-bol)) prmt-size) - (- (point) (pos-bol)) - prmt-size)))) + ;; lateral constraint to keep the frame inside of the screen + (left . ,(cond ((> (+ px helm-frame-width) screen-width) + (- screen-width helm-frame-width)) + (t (max (- px prmt-width) 0)))) ;; Try to put frame at the best possible place. ;; Frame should be below point if enough ;; place, otherwise above point and ;; current line should not be hidden ;; by helm frame. - (top . ,(if (> (cdr pos) half-screen-size) + (top . ,(if (> py half-screen-size) ;; Above point - (- (cdr pos) + (- py ;; add 2 lines to make sure there is always a gap (* (+ helm-display-buffer-height 2) line-height) ;; account for title bar height too (cddr (assq 'title-bar-size frame-info))) ;; Below point - (+ (cdr pos) line-height))) + (+ py line-height))) (title . "Helm") (undecorated . ,helm-use-undecorated-frame-option) (background-color . ,(or helm-frame-background-color @@ -3606,7 +3663,7 @@ version < emacs-28." (add-hook 'helm-minibuffer-set-up-hook 'helm-hide-minibuffer-maybe) (with-helm-buffer (setq-local helm-echo-input-in-header-line - (not (> (cdr pos) half-screen-size))))) + (not (> py half-screen-size))))) (helm-display-buffer-popup-frame buffer new-frame-alist) ;; When frame size have been modified manually by user restore ;; it to default value unless resuming or not using @@ -4446,12 +4503,13 @@ If (candidate-number-limit . 123) is in SOURCE limit candidate to 123." "Get searched display part from CANDIDATE. CANDIDATE is either a string, a symbol, or a (DISPLAY . REAL) cons cell." - (cond ((car-safe candidate)) - ((symbolp candidate) - (symbol-name candidate)) - ((numberp candidate) - (number-to-string candidate)) - (t candidate))) + (helm-acase candidate + ((dst* (disp . real)) disp) + ((guard* (symbolp candidate)) + (symbol-name candidate)) + ((guard* (numberp candidate)) + (number-to-string candidate)) + (t candidate))) (defun helm-process-pattern-transformer (pattern source) "Execute pattern-transformer attribute function(s) on PATTERN in SOURCE." @@ -4708,7 +4766,8 @@ useful when the order of the candidates is meaningful, e.g. with (host (and file-comp (get-text-property (max 0 (1- (length display))) 'host display))) (regex (helm--maybe-get-migemo-pattern pattern diacritics)) - (mpart (get-text-property 0 'match-part display)) + ;; Match prop at end, because at 0 we might have an icon. + (mpart (get-text-property (1- (length display)) 'match-part display)) (mp (cond ((and mpart (string= display mpart)) nil) (mpart) ;; FIXME: This may be wrong when match-on-real @@ -4719,7 +4778,7 @@ useful when the order of the candidates is meaningful, e.g. with (count 0) beg-str end-str) ;; Happens when matching empty lines (^$), in this case there is nothing to - ;; highlight. + ;; highlight. (if (string= mpart "") candidate (when host (setq pattern (cadr (split-string pattern ":")))) @@ -4783,7 +4842,7 @@ to the matching method in use. When DIACRITICS is specified, ignore diacritics, see `char-fold-to-regexp' for more infos." (if (string= pattern "") ;; Empty pattern, do nothing. This is needed when this function - ;; is used outside of helm-fuzzy-highlight-matches like in *buffers-list. + ;; is used outside of helm-fuzzy-highlight-matches like in *buffers-list. candidate ;; Else start highlighting. (helm-fuzzy-default-highlight-match-1 candidate pattern diacritics file-comp))) @@ -4820,7 +4879,7 @@ REGEXP should be generated from a pattern which is a list like Such pattern may be build with `helm-completion--flex-transform-pattern' function, and the regexp with `completion-pcm--pattern->regex'. For commodity, -`helm--fuzzy-flex-pattern-to-regexp' is used to build such regexp. +`helm--fuzzy-flex-pattern-to-regexp' is used to build such regexp. Function extracted from `completion-pcm--hilit-commonality' in emacs-27 to provide such scoring in emacs<27." @@ -5158,7 +5217,7 @@ Argument OVERLAY is a ref-cell." (consp overlay)) ;; Ensure OVERLAY is a ref-cell. (with-selected-window (minibuffer-window) (setcar overlay (make-overlay (minibuffer-prompt-end) (point-max))) - (overlay-put (car overlay) 'face '(:foreground "DimGray")) + (overlay-put (car overlay) 'face 'helm-dim-prompt) (redisplay)))) (defun helm-update-source-p (source) @@ -5199,7 +5258,7 @@ Argument OVERLAY is a ref-cell." (error nil)) (helm-follow-execute-persistent-action-maybe))) -(cl-defun helm-force-update (&optional preselect (recenter t)) +(cl-defun helm-force-update (&optional (preselect nil spreselect) (recenter t)) "Force recalculation and update of candidates. Unlike `helm-update', this function re-evaluates `init' and @@ -5208,7 +5267,8 @@ not reinitialized, meaning candidates are not recomputed unless pattern has changed. Selection is preserved to current candidate if it still exists after -update or moved to PRESELECT, if specified. +update or moved to PRESELECT, if specified. If PRESELECT is specified with a +nil value no preselection at all is done. The helm-window is re-centered at the end when RECENTER is t which is the default. RECENTER can be also a number in this case it is passed as argument to `recenter'." @@ -5218,7 +5278,7 @@ passed as argument to `recenter'." (regexp-quote it)))) (setq helm--force-updating-p t) (mapc 'helm-force-update--reinit helm-sources) - (helm-update (or preselect selection) source) + (helm-update (if spreselect preselect selection) source) (when (and (helm-window) recenter) (with-helm-window (recenter (and (numberp recenter) recenter))))))) @@ -5341,7 +5401,8 @@ specified as respectively `helm-cand-num' and `helm-cur-source'." start end `(mouse-face highlight keymap ,map - help-echo ,(helm-acase (get-text-property start 'help-echo) + ;; At 0 we might have an icon, so match at end. + help-echo ,(helm-acase (get-text-property (1- end) 'help-echo) ((guard* (stringp it)) (concat it "\nmouse-1: select candidate\nmouse-3: menu actions")) (t "mouse-1: select candidate\nmouse-3: menu actions"))))) @@ -5367,7 +5428,7 @@ specified as respectively `helm-cand-num' and `helm-cur-source'." (let ((inhibit-read-only t) (map (get-text-property pos 'keymap))) (when map - (define-key map [drag-mouse-1] helm-drag-mouse-1-fn) + (define-key map [down-mouse-1] helm-drag-mouse-1-fn) (define-key map [mouse-2] 'helm-maybe-exit-minibuffer) (put-text-property helm-selection-point @@ -5395,6 +5456,8 @@ specified as respectively `helm-cand-num' and `helm-cur-source'." (helm-get-previous-header-pos))) (forward-line 1))) (helm-mark-current-line) + (when helm-popup-tip-mode + (helm-maybe-show-help-echo)) (helm-follow-execute-persistent-action-maybe)) (select-window (minibuffer-window)) (set-buffer (window-buffer window))))) @@ -5676,11 +5739,11 @@ If action buffer is selected, back to the Helm buffer." ;; If `helm-show-action-window-other-window' is non nil ;; we should have now two windows displaying ;; helm-buffer, delete the one that was handling - ;; previously action buffer. + ;; previously action buffer. (when (helm--show-action-window-other-window-p) (delete-window it)) ;; Resize window on horizontal split, though for some - ;; reasons only 'above' needs to be resized. + ;; reasons only 'above' needs to be resized. (when (memq helm-show-action-window-other-window '(below above)) (window-resize (get-buffer-window helm-buffer) delta)) (kill-buffer helm-action-buffer) @@ -5709,7 +5772,7 @@ If action buffer is selected, back to the Helm buffer." ;; was itself force updating, now do it explicitely ;; from here. (helm-set-pattern "" t) - (helm-force-update) + (helm-force-update nil) ;; Unhide minibuffer to make visible action prompt [1]. (with-selected-window (minibuffer-window) (remove-overlays) (setq cursor-type t)) @@ -7109,13 +7172,16 @@ unless FORCE-LONGEST is non nil." (with-current-buffer buf (erase-buffer) (cond ((listp data) - (insert (mapconcat (lambda (i) - (let ((cand (cond ((symbolp i) (symbol-name i)) - ((numberp i) (number-to-string i)) - ((consp i) (propertize - (car i) - 'helm-realvalue (cdr i))) - (t i)))) + (insert (mapconcat (lambda (elm) + (let ((cand + (helm-acase elm + ((guard* (symbolp it)) + (symbol-name it)) + ((guard* (numberp it)) + (number-to-string it)) + ((dst* (disp . real)) + (propertize disp 'helm-realvalue real)) + (t it)))) (setq-local helm-candidate-buffer-longest-len (max helm-candidate-buffer-longest-len (length cand))) @@ -7129,7 +7195,7 @@ unless FORCE-LONGEST is non nil." buf))) (defun helm--get-longest-len-in-buffer () - "Return length of the longest line in buffer." + "Return length of the longest line in buffer." (save-excursion (goto-char (point-min)) (let ((max 0) diff --git a/elpa/helm-core-20241225.641/helm-lib.el b/elpa/helm-core-20250514.1025/helm-lib.el similarity index 92% rename from elpa/helm-core-20241225.641/helm-lib.el rename to elpa/helm-core-20250514.1025/helm-lib.el index 78090c7b..05f03973 100644 --- a/elpa/helm-core-20241225.641/helm-lib.el +++ b/elpa/helm-core-20250514.1025/helm-lib.el @@ -1,8 +1,8 @@ ;;; helm-lib.el --- Helm routines. -*- lexical-binding: t -*- -;; Copyright (C) 2015 ~ 2020 Thierry Volpiatto +;; Copyright (C) 2015 ~ 2025 Thierry Volpiatto -;; Author: Thierry Volpiatto +;; Author: Thierry Volpiatto ;; URL: http://github.com/emacs-helm/helm ;; This program is free software; you can redistribute it and/or modify @@ -114,14 +114,10 @@ convenient to use a simple boolean value here." (defun helm-ff--setup-boring-regex (var val) (set var val) (setq helm-ff--boring-regexp - (cl-loop with last = (car (last val)) - for r in (butlast val) - if (string-match "\\$\\'" r) - concat (concat r "\\|") into result - else concat (concat r "$\\|") into result - finally return - (concat result last - (if (string-match "\\$\\'" last) "" "$"))))) + (cl-loop for r on val + if (cdr r) + concat (concat (car r) "\\|") + else concat (car r)))) (defcustom helm-boring-file-regexp-list (mapcar (lambda (f) @@ -129,13 +125,15 @@ convenient to use a simple boolean value here." (if (string-match-p "[^/]$" f) ;; files: e.g .o => \\.o$ (concat rgx "$") - ;; directories: e.g .git/ => \.git\\(/\\|$\\) - (concat (substring rgx 0 -1) "\\(/\\|$\\)")))) + ;; To not ignore files with same prefix as directory names + ;; (bug#2009) use e.g. .git/ => \.git\?$. + ;; See also PR in bug#2012. + (concat rgx "?$")))) completion-ignored-extensions) "A list of regexps matching boring files. This list is build by default on `completion-ignored-extensions'. -The directory names should end with \"/?\" e.g. \"\\.git/?\" and +The directory names should end with \"/?$\" e.g. \"\\.git/?$\" and the file names should end with \"$\" e.g. \"\\.o$\". These regexps may be used to match the entire path, not just the @@ -161,7 +159,10 @@ the customize functions e.g. `customize-set-variable' and NOT (defcustom helm-current-directory-alist '((dired-mode . dired-current-directory) - (mu4e-main-mode . mu4e-maildir)) + (mu4e-main-mode . mu4e-root-maildir) + (gnus-group-mode . gnus-directory) + (gnus-summary-mode . gnus-directory) + (gnus-article-mode . gnus-directory)) "Tell `helm-current-directory' what to use according to `major-mode'. Each element of alist is (MAJOR-MODE . SYMBOL) where SYMBOL is either a variable or a function." @@ -323,7 +324,7 @@ the leading `-' char." (unless package--initialized (package-initialize 'no-activate)) (or (cadr (assq pkg-name package-alist)) (cadr (assq pkg-name package-archive-contents)))) - + (defun package-upgrade (name) "Upgrade package NAME if a newer version exists." (let* ((package (if (symbolp name) @@ -351,15 +352,7 @@ object." (dolist (elc (directory-files-recursively (package-desc-dir pkg-desc) "\\.elc\\'")) (delete-file elc)) - (package--compile pkg-desc))) - - (defun package--dependencies (pkg) - "Return a list of all dependencies PKG has. -This is done recursively." - ;; Can we have circular dependencies? Assume "nope". - (when-let* ((desc (cadr (assq pkg package-archive-contents))) - (deps (mapcar #'car (package-desc-reqs desc)))) - (delete-dups (apply #'nconc deps (mapcar #'package--dependencies deps)))))))) + (package--compile pkg-desc)))))) ;;; Provide `help--symbol-class' not available in emacs-27 ;; @@ -397,10 +390,10 @@ This is done recursively." object (let ((vec (string-to-vector object))) (unless (multibyte-string-p object) - (dotimes (i (length vec)) - (let ((k (aref vec i))) - (when (> k 127) - (setf (aref vec i) (+ k ?\M-\C-@ -128)))))) + (dotimes (i (length vec)) + (let ((k (aref vec i))) + (when (> k 127) + (setf (aref vec i) (+ k ?\M-\C-@ -128)))))) vec)))) (defun helm-proper-list-p (obj) @@ -464,23 +457,6 @@ Like `this-command' but return the real command, and not ;;; Iterators ;; -(cl-defmacro helm-position (item seq &key test all) - "A simple and faster replacement of CL `position'. - -Returns ITEM first occurence position found in SEQ. -When SEQ is a string, ITEM have to be specified as a char. -Argument TEST when unspecified default to `eq'. -When argument ALL is non-nil return a list of all ITEM positions -found in SEQ." - (let ((key (if (stringp seq) 'across 'in))) - `(cl-loop with deftest = 'eq - for c ,key ,seq - for index from 0 - when (funcall (or ,test deftest) c ,item) - if ,all collect index into ls - else return index - finally return ls))) - (defun helm-iter-list (seq &optional cycle) "Return an iterator object from SEQ. The iterator die and return nil when it reach end of SEQ. @@ -573,8 +549,11 @@ KEYLIST can be any object that will be compared with `equal' or an expression starting with special symbol `guard*' which is then evaluated. Once evaluated the symbol `guard' is bound to the returned value that can be used in the cdr of clause. When -KEYLIST match EXPR or `guard*' sexp evaluation is non-nil, BODY is -executed and `helm-acase' exits with its value. +KEYLIST match EXPR or `guard*' sexp evaluation is non-nil, BODY +is executed and `helm-acase' exits with its value. +Note: +`guard*' sexp should not be a single symbol to eval, e.g. (guard* foo) +in such cases you should use (guard* (progn foo)). KEYLIST can also be a list starting with special symbol `dst*' followed by an expression suitable for `cl-destructuring-bind'. @@ -1068,6 +1047,31 @@ Examples: (beg-part (butlast seq len))) (append beg-part elm end-part)))) +;;;###autoload +(defun helm-add-to-list (var elm index &optional replace) + "Add or move ELM to the value of VAR at INDEX unless already here. + +If ELM is member of var value and at index INDEX, return var value +unchanged, if INDEX value is different move ELM at this `nth' INDEX value. +If ELM is not present in list add it at `nth' INDEX. + +If REPLACE is non nil replace element at INDEX by ELM. + +Do not use this function in helm code, use `helm-append-at-nth' +instead. It is meant to be used in config files only." + (cl-assert (boundp var) nil "Unbound variable `%s'" var) + (let ((val (symbol-value var)) + flag) + (cond ((and (member elm val) (equal elm (nth index val)))) + ((member elm val) + (setq val (delete elm val) flag t)) + ((and replace (not (< index 0)) (not (> index (length val)))) + (setq val (delete (nth index val) val) flag t)) + (t (setq flag t))) + (if flag + (set var (helm-append-at-nth val elm index)) + val))) + (cl-defgeneric helm-take (seq n) "Return the first N elements of SEQ if SEQ is longer than N. It is used for narrowing list of candidates to the @@ -1166,6 +1170,31 @@ Examples: sequence)) (pos (1+ (helm-position elm new-seq :test 'equal)))) (append (nthcdr pos new-seq) (helm-take new-seq pos)))) + +(cl-defun helm-position (elm seq &key (test 'eq) from-end) + "Return position of ELM in SEQ. +Comparison is tested with keyword TEST which default to `eq'. +If keyword FROM-END is non nil search from end." + (let ((count (if from-end (1- (length seq)) 0))) + (while (if from-end + (not (zerop count)) + (<= count (1- (length seq)))) + (when (funcall test (if (listp seq) + (car (nthcdr count seq)) + (aref seq count)) + elm) + (cl-return-from helm-position count)) + (setq count (funcall (if from-end #'1- #'1+) count))))) + +(defsubst helm-copy-sequence (seq) + "Return a copy of SEQ. +When the elements of SEQ are strings, they are +copied; they are not shared with the original. +Otherwise returns SEQ unchanged, the elements are not copied." + (cl-loop for elm in seq collect + (if (stringp elm) + (copy-sequence elm) + elm))) ;;; Strings processing. ;; @@ -1411,8 +1440,8 @@ in LIST to be displayed in PROMPT." (defsubst helm-string-numberp (str) "Return non nil if string STR represent a number." (cl-assert (stringp str) t) - (or (cl-loop for c across str always (char-equal c ?0)) - (not (zerop (string-to-number str))))) + (cl-loop with chars = '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9) + for c across str always (memql c chars))) (defsubst helm-re-search-forward (regexp &optional bound noerror count) "Same as `re-search-forward' but return nil when point doesn't move. @@ -1819,16 +1848,22 @@ e.g. (helm-basename \"~/ucs-utils-6.0-delta.py.gz\" \\='(2 . \"\\\\.py\\\\\\='\" (defun helm-basedir (fname &optional parent) "Return the base directory of FNAME ending by a slash. -If PARENT is specified and FNAME is a directory return the parent -directory of FNAME. +If PARENT is non nil and FNAME is a directory return the parent +directory of FNAME, if PARENT is a number return the parent directory up to +PARENT level. If PARENT is not specified but FNAME doesn't end by a slash, the returned value is same as with PARENT." (helm-aif (and fname (or (and (string= fname "~") "~") (file-name-directory - (if parent - (directory-file-name fname) - fname)))) + (helm-acase parent + ((guard* (numberp it)) + (cl-loop repeat it + for bd = (helm-basedir (or bd fname) t) + finally return bd)) + ((guard* (eq it t)) + (directory-file-name fname)) + (t fname))))) (file-name-as-directory it))) (defun helm-current-directory () @@ -1982,20 +2017,16 @@ Directories expansion is not supported." (defun helm-locate-lib-get-summary (file) "Extract library description from 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 "^;;;(.*) ---? (.*)$") - (desc (shell-command-to-string - (format cmd - (if (string-match-p "\\.gz\\'" file) - "gzip -c -q -d" "cat") - (shell-quote-argument file) - regexp)))) - (if (string= desc "") - "Not documented" - (replace-regexp-in-string "\n" "" desc)))) + (with-temp-buffer + (let (desc) + (cl-letf (((symbol-function 'message) #'ignore)) + (insert-file-contents file nil 0 128)) + (goto-char (point-min)) + (when (re-search-forward "^;;;?\\(.*\\) ---? \\(.*\\)" (pos-eol) t) + (setq desc (match-string-no-properties 2))) + (if (or (null desc) (string= "" desc) (string-match "\\`-\\*-" desc)) + "Not documented" + (car (split-string desc "-\\*-" nil "[ \t\n\r-]+")))))) (defun helm-local-directory-files (directory &rest args) "Run `directory-files' without tramp file name handlers. @@ -2181,87 +2212,6 @@ flex or helm-flex completion style if present." (if (memq wflex completion-styles) 1 0))))))) -(defun helm-dynamic-completion (collection predicate &optional point metadata nomode styles) - "Build a completion function for `helm-pattern' in COLLECTION. - -Only the elements of COLLECTION that satisfy PREDICATE are considered. - -Argument POINT is the same as in `completion-all-completions' and -is meaningful only when using some kind of `completion-at-point'. - -The return value is a list of completions that may be sorted by -the sort function provided by the completion-style in -use (emacs-27 only), otherwise (emacs-26) the sort function has -to be provided if needed either with an FCT function in source or -by passing the sort function with METADATA -E.g.: \\='((metadata (display-sort-function . foo))). -Candidates can be modified by passing an affixation-function in METADATA. - -If you don't want the sort fn provided by style to kick -in (emacs-27) you can use as metadata value the symbol `nosort'. - -Example: - - (helm :sources (helm-build-sync-source \"test\" - :candidates (helm-dynamic-completion - \\='(foo bar baz foab) - \\='symbolp) - :match-dynamic t) - :buffer \"*helm test*\") - -When argument NOMODE is non nil don't use `completion-styles' as -specified in `helm-completion-styles-alist' for specific modes. - -When STYLES is specified use these `completion-styles', see -`helm--prepare-completion-styles'. - -Also `helm-completion-style' settings have no effect here, -`emacs' being used inconditionally as value." - (lambda () - (let* (;; Force usage of emacs style otherwise - ;; helm--prepare-completion-styles will reset - ;; completion-styles to default value i.e. (basic partial - ;; emacs22). - (helm-completion-style 'emacs) - (completion-styles - (with-helm-current-buffer - (helm--prepare-completion-styles nomode styles))) - (completion-flex-nospace t) - (nosort (eq metadata 'nosort)) - (compsfn (lambda (str pred _action) - (let* ((completion-ignore-case (helm-set-case-fold-search)) - ;; Use a copy of metadata to avoid accumulation of - ;; adjustment in metadata (This is not needed in - ;; emacs-31+, it has been fixed in emacsbug - ;; #74718). This also avoid the flex adjustment fn - ;; reusing the previous sort fn. - (md (copy-sequence metadata)) - (comps (completion-all-completions - str - (if (functionp collection) - (funcall collection str pred t) - collection) - pred - (or point 0) - (or (and (consp md) md) - (setq metadata '(metadata))))) - (last-data (last comps)) - (sort-fn (unless nosort - (completion-metadata-get - md 'display-sort-function))) - (affix (completion-metadata-get - md 'affixation-function)) - all) - (when (cdr last-data) (setcdr last-data nil)) - (setq all (if (and sort-fn (> (length str) 0)) - (funcall sort-fn comps) - comps)) - (if affix - (helm-completion--decorate all nil affix nil) - all))))) - ;; Ensure circular objects are removed. - (complete-with-action t compsfn helm-pattern predicate)))) - (defun helm-guess-filename-at-point () (with-helm-current-buffer ;; Ensure to disable the evil `ffap-machine-at-point' which may run here as diff --git a/elpa/helm-core-20241225.641/helm-multi-match.el b/elpa/helm-core-20250514.1025/helm-multi-match.el similarity index 99% rename from elpa/helm-core-20241225.641/helm-multi-match.el rename to elpa/helm-core-20250514.1025/helm-multi-match.el index 546969e0..903bd9b5 100644 --- a/elpa/helm-core-20241225.641/helm-multi-match.el +++ b/elpa/helm-core-20250514.1025/helm-multi-match.el @@ -3,9 +3,9 @@ ;; Original Author: rubikitch ;; Copyright (C) 2008 ~ 2011 rubikitch -;; Copyright (C) 2011 ~ 2020 Thierry Volpiatto +;; Copyright (C) 2011 ~ 2025 Thierry Volpiatto -;; Author: Thierry Volpiatto +;; Author: Thierry Volpiatto ;; URL: http://github.com/emacs-helm/helm ;; This program is free software; you can redistribute it and/or modify diff --git a/elpa/helm-core-20241225.641/helm-source.el b/elpa/helm-core-20250514.1025/helm-source.el similarity index 99% rename from elpa/helm-core-20241225.641/helm-source.el rename to elpa/helm-core-20250514.1025/helm-source.el index dbfe3207..e7b3ead1 100644 --- a/elpa/helm-core-20241225.641/helm-source.el +++ b/elpa/helm-core-20250514.1025/helm-source.el @@ -1,8 +1,8 @@ ;;; helm-source.el --- Helm source creation. -*- lexical-binding: t -*- -;; Copyright (C) 2015 ~ 2020 Thierry Volpiatto +;; Copyright (C) 2015 ~ 2025 Thierry Volpiatto -;; Author: Thierry Volpiatto +;; Author: Thierry Volpiatto ;; URL: http://github.com/emacs-helm/helm ;; This program is free software; you can redistribute it and/or modify @@ -500,7 +500,7 @@ sources built with child class `helm-source-in-buffer' the SEARCH slot. This also add a `filtered-candidate-transformer' function to sort candidates (see `helm-fuzzy-sort-fn') according to the score of each candidate which is - computed with `helm-fuzzy-default-score-fn'. + computed with `helm-fuzzy-default-score-fn'. This is an easy way of enabling fuzzy matching, but you can use the MATCH or SEARCH slots yourself if you want something more elaborated, mixing different type of match (See `helm-source-buffers' class for example), you @@ -615,7 +615,7 @@ :documentation " Enable `helm-follow-mode' for this source only. With a value of 1 enable, a value of -1 or nil disable the mode, value set to - \\='never prevent using `helm-follow-mode' in this source. + \\='never prevent using `helm-follow-mode' in this source. See `helm-follow-mode' for more infos.") (follow-delay @@ -674,7 +674,7 @@ :documentation " A local hook that run at end of initilization of this source. i.e After the creation of `helm-buffer'. - + Should be a variable (a symbol) bound to a list of functions or a single function (see `run-hooks' documentation). Even better is to use `add-hook' to feed this variable. @@ -777,7 +777,7 @@ The :candidates function in this case is in charge of fetching candidates dynamically according to `helm-pattern'. If you want to make your :candidates function working with `completion-styles' - use the function `helm-dynamic-completion'. + use the function `helm-dynamic-completion'. Note that :volatile is automatically enabled when using this, so no need to specify it.")) @@ -796,7 +796,7 @@ Matching is done basically with `string-match' against each candidate.") The function called with no arguments must return a process i.e. `processp', it use typically `start-process' or `make-process', see (info \"(elisp) Asynchronous Processes\"). - + NOTE: When building the source at runtime you can give directly a process @@ -852,7 +852,7 @@ inherit from `helm-source'.") (match :initform '(identity)) - + (get-line :initarg :get-line :initform 'buffer-substring-no-properties @@ -992,8 +992,7 @@ the keyword :name in your source, NAME will be used instead. Argument CLASS is a symbol defining an eieio class object. Arguments ARGS are keyword value pairs as defined in CLASS." (declare (indent 2)) - (let ((source (apply #'make-instance class name args))) - (setf (slot-value source 'name) name) + (let ((source (apply #'make-instance class :name name args))) (helm--setup-source source) (helm-setup-user-source source) (helm--create-source source))) @@ -1003,6 +1002,7 @@ Arguments ARGS are keyword value pairs as defined in CLASS." (setf (slot-value source 'name) nil) (helm--setup-source source) (helm--create-source source))) +(make-obsolete 'helm-make-type 'helm-make-source "4.0.3") (defvar helm-mm-default-search-functions) (defvar helm-mm-default-match-functions) diff --git a/elpa/helm-descbinds-20240216.1154/helm-descbinds-autoloads.el b/elpa/helm-descbinds-20250204.451/helm-descbinds-autoloads.el similarity index 100% rename from elpa/helm-descbinds-20240216.1154/helm-descbinds-autoloads.el rename to elpa/helm-descbinds-20250204.451/helm-descbinds-autoloads.el diff --git a/elpa/helm-descbinds-20240216.1154/helm-descbinds-pkg.el b/elpa/helm-descbinds-20250204.451/helm-descbinds-pkg.el similarity index 71% rename from elpa/helm-descbinds-20240216.1154/helm-descbinds-pkg.el rename to elpa/helm-descbinds-20250204.451/helm-descbinds-pkg.el index ad896cb6..758fe529 100644 --- a/elpa/helm-descbinds-20240216.1154/helm-descbinds-pkg.el +++ b/elpa/helm-descbinds-20250204.451/helm-descbinds-pkg.el @@ -1,10 +1,10 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "helm-descbinds" "20240216.1154" +(define-package "helm-descbinds" "20250204.451" "A convenient `describe-bindings' with `helm'." '((helm "1.5")) :url "https://github.com/emacs-helm/helm-descbinds" - :commit "ca03f02da4e54a1d0a2d5498b86e1639aa808d8c" - :revdesc "ca03f02da4e5" + :commit "c12bc85ef3ce342fe1c78cdd86117c05d5310789" + :revdesc "c12bc85ef3ce" :keywords '("helm" "help") :authors '(("Taiki SUGAWARA" . "buzz.taiki@gmail.com")) :maintainers '(("Taiki SUGAWARA" . "buzz.taiki@gmail.com"))) diff --git a/elpa/helm-descbinds-20240216.1154/helm-descbinds.el b/elpa/helm-descbinds-20250204.451/helm-descbinds.el similarity index 98% rename from elpa/helm-descbinds-20240216.1154/helm-descbinds.el rename to elpa/helm-descbinds-20250204.451/helm-descbinds.el index 40341fb4..0d59dab9 100644 --- a/elpa/helm-descbinds-20240216.1154/helm-descbinds.el +++ b/elpa/helm-descbinds-20250204.451/helm-descbinds.el @@ -4,12 +4,13 @@ ;; Copyright (C) 2012, 2013 Michael Markert ;; Copyright (C) 2013 Daniel Hackney ;; Copyright (C) 2015, 2016 Michael Heerdegen +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto ;; Author: Taiki SUGAWARA ;; URL: https://github.com/emacs-helm/helm-descbinds ;; Keywords: helm, help -;; Package-Version: 20240216.1154 -;; Package-Revision: ca03f02da4e5 +;; Package-Version: 20250204.451 +;; Package-Revision: c12bc85ef3ce ;; Package-Requires: ((helm "1.5")) ;; This file is free software; you can redistribute it and/or modify @@ -277,7 +278,7 @@ Return a list of sections, each section beeing an alist composed of (helm-descbinds-display-string-in-help helm-descbinds-prefix-help)) ((guard (and (symbolp name) (fboundp name))) - (describe-function name))))) + (funcall helm-describe-function-function name))))) (defun helm-descbinds-action:find-func (candidate) "An action that find selected CANDIDATE function." diff --git a/elpa/helm-org-20240922.603/helm-org-pkg.el b/elpa/helm-org-20240922.603/helm-org-pkg.el deleted file mode 100644 index f7b3be63..00000000 --- a/elpa/helm-org-20240922.603/helm-org-pkg.el +++ /dev/null @@ -1,10 +0,0 @@ -;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "helm-org" "20240922.603" - "Helm for org headlines and keywords completion." - '((helm "3.3") - (emacs "24.4")) - :url "https://github.com/emacs-helm/helm-org" - :commit "9b7d5d4fd18180b2009a0f2b908c84d5363e41f3" - :revdesc "9b7d5d4fd181" - :authors '(("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")) - :maintainers '(("Thierry Volpiatto" . "thierry.volpiatto@gmail.com"))) diff --git a/elpa/helm-org-20240922.603/helm-org-autoloads.el b/elpa/helm-org-20250405.1720/helm-org-autoloads.el similarity index 100% rename from elpa/helm-org-20240922.603/helm-org-autoloads.el rename to elpa/helm-org-20250405.1720/helm-org-autoloads.el diff --git a/elpa/helm-org-20250405.1720/helm-org-pkg.el b/elpa/helm-org-20250405.1720/helm-org-pkg.el new file mode 100644 index 00000000..4f7b8406 --- /dev/null +++ b/elpa/helm-org-20250405.1720/helm-org-pkg.el @@ -0,0 +1,10 @@ +;; -*- no-byte-compile: t; lexical-binding: nil -*- +(define-package "helm-org" "20250405.1720" + "Helm for org headlines and keywords completion." + '((helm "4.0.2") + (emacs "25.1")) + :url "https://github.com/emacs-helm/helm-org" + :commit "4744ca7f8b35e17bafce9cb0093deb87a232699d" + :revdesc "4744ca7f8b35" + :authors '(("Thierry Volpiatto" . "thievol@posteo.net")) + :maintainers '(("Thierry Volpiatto" . "thievol@posteo.net"))) diff --git a/elpa/helm-org-20240922.603/helm-org.el b/elpa/helm-org-20250405.1720/helm-org.el similarity index 97% rename from elpa/helm-org-20240922.603/helm-org.el rename to elpa/helm-org-20250405.1720/helm-org.el index a80d2399..3b5e2305 100644 --- a/elpa/helm-org-20240922.603/helm-org.el +++ b/elpa/helm-org-20250405.1720/helm-org.el @@ -1,12 +1,12 @@ ;;; helm-org.el --- Helm for org headlines and keywords completion -*- lexical-binding: t -*- -;; Copyright (C) 2012 ~ 2019 Thierry Volpiatto -;; Author: Thierry Volpiatto +;; Copyright (C) 2012 ~ 2025 Thierry Volpiatto +;; Author: Thierry Volpiatto ;; URL: https://github.com/emacs-helm/helm-org -;; Package-Requires: ((helm "3.3") (emacs "24.4")) -;; Package-Version: 20240922.603 -;; Package-Revision: 9b7d5d4fd181 +;; Package-Requires: ((helm "4.0.2") (emacs "25.1")) +;; Package-Version: 20250405.1720 +;; Package-Revision: 4744ca7f8b35 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -32,6 +32,8 @@ (require 'helm-utils) (require 'org) +(declare-function helm-dynamic-completion "ext:helm-mode.el") + (defvar helm-completing-read-handlers-alist) ;; Internals @@ -186,7 +188,7 @@ Note: [1] A separator can be a comma, a colon i.e. [,:] or a space. (helm-build-sync-source "Org Capture Templates:" :candidates (cl-loop for template in org-capture-templates collect (cons (nth 1 template) (nth 0 template))) - :action '(("Do capture" . (lambda (template-shortcut) + :action `(("Do capture" . ,(lambda (template-shortcut) (org-capture nil template-shortcut)))))) ;;; Org headings @@ -243,11 +245,11 @@ Note: [1] A separator can be a comma, a colon i.e. [,:] or a space. parents (or force-refresh helm-org--force-refresh)) 'stringp - nil '(metadata (display-sort-function + nil `(metadata (display-sort-function . - (lambda (candidates) - (sort candidates - #'helm-generic-sort-fn)))) + ,(lambda (candidates) + (sort candidates + #'helm-generic-sort-fn)))) nil helm-org-completion-styles) :match-dynamic t :find-file-target (lambda (source) diff --git a/elpa/helm-projectile-20231023.1425/helm-projectile-autoloads.el b/elpa/helm-projectile-20250218.1525/helm-projectile-autoloads.el similarity index 97% rename from elpa/helm-projectile-20231023.1425/helm-projectile-autoloads.el rename to elpa/helm-projectile-20250218.1525/helm-projectile-autoloads.el index d83a0fe5..3df69601 100644 --- a/elpa/helm-projectile-20231023.1425/helm-projectile-autoloads.el +++ b/elpa/helm-projectile-20250218.1525/helm-projectile-autoloads.el @@ -35,10 +35,12 @@ DIR is the project root, if not set then current directory is used (fn &optional DIR)" t) (autoload 'helm-projectile-ack "helm-projectile" "\ Helm version of projectile-ack. +DIR directory where to search (fn &optional DIR)" t) (autoload 'helm-projectile-ag "helm-projectile" "\ Helm version of `projectile-ag'. +OPTIONS explicit command line arguments to ag (fn &optional OPTIONS)" t) (autoload 'helm-projectile-rg "helm-projectile" "\ diff --git a/elpa/helm-projectile-20231023.1425/helm-projectile-pkg.el b/elpa/helm-projectile-20250218.1525/helm-projectile-pkg.el similarity index 53% rename from elpa/helm-projectile-20231023.1425/helm-projectile-pkg.el rename to elpa/helm-projectile-20250218.1525/helm-projectile-pkg.el index 3e57cf11..67adb9ac 100644 --- a/elpa/helm-projectile-20231023.1425/helm-projectile-pkg.el +++ b/elpa/helm-projectile-20250218.1525/helm-projectile-pkg.el @@ -1,10 +1,10 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "helm-projectile" "20231023.1425" +(define-package "helm-projectile" "20250218.1525" "Helm integration for Projectile." - '((helm "1.9.9") - (projectile "2.2.0") + '((helm "3.0") + (projectile "2.9") (cl-lib "0.3")) :url "https://github.com/bbatsov/helm-projectile" - :commit "e2e38825c975269a4971df25e79b2ae98929624e" - :revdesc "e2e38825c975" + :commit "041076e35a6663302a91a0fa672f847c7d64bf29" + :revdesc "041076e35a66" :keywords '("project" "convenience")) diff --git a/elpa/helm-projectile-20231023.1425/helm-projectile.el b/elpa/helm-projectile-20250218.1525/helm-projectile.el similarity index 88% rename from elpa/helm-projectile-20231023.1425/helm-projectile.el rename to elpa/helm-projectile-20250218.1525/helm-projectile.el index 4ac96b6d..9cd7a12c 100644 --- a/elpa/helm-projectile-20231023.1425/helm-projectile.el +++ b/elpa/helm-projectile-20250218.1525/helm-projectile.el @@ -1,14 +1,14 @@ ;;; helm-projectile.el --- Helm integration for Projectile -*- lexical-binding: t; -*- -;; Copyright (C) 2011-2020 Bozhidar Batsov +;; Copyright (C) 2011-2025 Bozhidar Batsov ;; Author: Bozhidar Batsov ;; URL: https://github.com/bbatsov/helm-projectile ;; Created: 2011-31-07 ;; Keywords: project, convenience -;; Package-Version: 20231023.1425 -;; Package-Revision: e2e38825c975 -;; Package-Requires: ((helm "1.9.9") (projectile "2.2.0") (cl-lib "0.3")) +;; Package-Version: 20250218.1525 +;; Package-Revision: 041076e35a66 +;; Package-Requires: ((helm "3.0") (projectile "2.9") (cl-lib "0.3")) ;; This file is NOT part of GNU Emacs. @@ -40,16 +40,20 @@ ;; ;;; Code: +;; built-in libraries (require 'subr-x) -(require 'projectile) (require 'cl-lib) -(require 'grep) -(require 'helm) +(require 'grep) ;; TODO: Probably we should defer this require + +(require 'helm-core) +(require 'helm-global-bindings) (require 'helm-types) (require 'helm-locate) (require 'helm-buffers) (require 'helm-files) +(require 'projectile) + (declare-function eshell "eshell") (declare-function helm-do-ag "ext:helm-ag") (declare-function dired-get-filename "dired") @@ -223,15 +227,39 @@ It is there because Helm requires it." :group 'helm-projectile :type '(alist :key-type string :value-type function)) -(defvar helm-source-projectile-projects - (helm-build-sync-source "Projectile projects" - :candidates (lambda () (with-helm-current-buffer projectile-known-projects)) - :fuzzy-match helm-projectile-fuzzy-match - :keymap helm-projectile-projects-map - :mode-line helm-read-file-name-mode-line-string - :action 'helm-source-projectile-projects-actions) +(defclass helm-projectile-projects-source (helm-source-sync helm-type-file) + ((candidates :initform (lambda () (with-helm-current-buffer + (mapcar #'copy-sequence + (projectile-known-projects))))) + (fuzzy-match :initform 'helm-projectile-fuzzy-match) + (keymap :initform 'helm-projectile-projects-map) + (mode-line :initform 'helm-read-file-name-mode-line-string) + (action :initform 'helm-source-projectile-projects-actions)) "Helm source for known projectile projects.") +(cl-defmethod helm--setup-source :after ((source helm-projectile-projects-source)) + "Make SOURCE specific to project switching. +The `helm-projectile-projects-source` inherits from +`helm-type-file` (which see), which sets up actions, keymap, and +help message slots to file specific ones. Override these slots +to be specific to `helm-projectile-projects-source'." + (setf (slot-value source 'action) 'helm-source-projectile-projects-actions) + (setf (slot-value source 'keymap) helm-projectile-projects-map) + ;; Use `ignore' as a persistent action, to actually keep `helm' session + ;; when `helm-execute-persistent-action' is executed. + (setf (slot-value source 'persistent-action) #'ignore) + (let ((persistent-help "Do Nothing")) + (setf (slot-value source 'persistent-help) persistent-help) + (setf (slot-value source 'header-line) + (helm-source--persistent-help-string + persistent-help + source))) + (setf (slot-value source 'mode-line) + (list "Project(s)" helm-mode-line-string))) + +(defvar helm-source-projectile-projects + (helm-make-source "Projectile projects" 'helm-projectile-projects-source)) + (defvar helm-projectile-dirty-projects-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-map) @@ -834,6 +862,31 @@ variable `projectile-other-file-alist'." :prompt (projectile-prepend-project-name "Find other file: "))))) (error "No other file found")))) +(defcustom helm-projectile-ignore-strategy 'projectile + "Allow projectile to compute ignored files and directories. + +When set to `projectile', the package will compute ignores and +explicitely add additionally command line arguments to the search +tool. Note that this might override search tool specific +behaviors (for instance ag would not use VCS ignore files). + +When set to `search-tool', the above does not happen." + :group 'helm-projectile + :type '(choice (const :tag "Allow projectile to compute ignores" projectile) + (const :tag "Let the search tool compute ignores" search-tool))) + +(defun helm-projectile--projectile-ignore-strategy () + "True if the ignore strategy is `projectile'." + (eq 'projectile helm-projectile-ignore-strategy)) + +(defun helm-projectile--ignored-files () + "Compute ignored files." + (cl-union (projectile-ignored-files-rel) grep-find-ignored-files)) + +(defun helm-projectile--ignored-directories () + "Compute ignored directories." + (cl-union (projectile-ignored-directories-rel) grep-find-ignored-directories)) + (defcustom helm-projectile-grep-or-ack-actions '("Find file" helm-grep-action "Find file other frame" helm-grep-other-frame @@ -866,15 +919,17 @@ ACK-IGNORED-PATTERN is a file regex to exclude from searching. ACK-EXECUTABLE is the actual ack binary name. It is usually \"ack\" or \"ack-grep\". If it is nil, or ack/ack-grep not found then use default grep command." + (when (helm-projectile--projectile-ignore-strategy) + (setq helm-grep-ignored-files (helm-projectile--ignored-files) + helm-grep-ignored-directories (mapcar 'directory-file-name (helm-projectile--ignored-directories)))) + (let* ((default-directory (or dir (projectile-project-root))) (helm-ff-default-directory default-directory) (helm-grep-in-recurse t) - (helm-grep-ignored-files (cl-union (projectile-ignored-files-rel) grep-find-ignored-files)) - (helm-grep-ignored-directories - (cl-union (mapcar 'directory-file-name (projectile-ignored-directories-rel)) - grep-find-ignored-directories)) (helm-grep-default-command (if use-ack-p - (concat ack-executable " -H --no-group --no-color " ack-ignored-pattern " %p %f") + (concat ack-executable " -H --no-group --no-color " + (when ack-ignored-pattern (concat ack-ignored-pattern " ")) + "%p %f") (if (and projectile-use-git-grep (eq (projectile-project-vcs) 'git)) helm-projectile-git-grep-command helm-projectile-grep-command))) @@ -939,39 +994,52 @@ DIR is the project root, if not set then current directory is used" ;;;###autoload (defun helm-projectile-ack (&optional dir) - "Helm version of projectile-ack." + "Helm version of projectile-ack. +DIR directory where to search" (interactive) - (let ((project-root (or dir (projectile-project-root) (error "You're not in a project")))) - (let ((ack-ignored (mapconcat - 'identity - (cl-union (mapcar (lambda (path) - (concat "--ignore-dir=" (file-name-nondirectory (directory-file-name path)))) - (projectile-ignored-directories)) - (mapcar (lambda (path) - (concat "--ignore-file=match:" (shell-quote-argument path))) - (append (projectile-ignored-files) (projectile-patterns-to-ignore)))) " ")) - (helm-ack-grep-executable (cond - ((executable-find "ack") "ack") - ((executable-find "ack-grep") "ack-grep") - (t (error "ack or ack-grep is not available"))))) - (funcall 'run-with-timer 0.01 nil - #'helm-projectile-grep-or-ack project-root t ack-ignored helm-ack-grep-executable)))) + (let* ((project-root (or dir (projectile-project-root) (error "You're not in a project"))) + (ignored (when (helm-projectile--projectile-ignore-strategy) + (mapconcat + 'identity + (cl-union (mapcar (lambda (path) + (concat "--ignore-dir=" (file-name-nondirectory (directory-file-name path)))) + (helm-projectile--ignored-directories)) + (mapcar (lambda (path) + (concat "--ignore-file=match:" (shell-quote-argument path))) + (append (helm-projectile--ignored-files) + (projectile-patterns-to-ignore)))) + " "))) + (helm-ack-grep-executable (cond + ((executable-find "ack") "ack") + ((executable-find "ack-grep") "ack-grep") + (t (error "ack or ack-grep is not available"))))) + (funcall 'run-with-timer 0.01 nil + #'helm-projectile-grep-or-ack project-root t ignored helm-ack-grep-executable))) ;;;###autoload + (defun helm-projectile-ag (&optional options) - "Helm version of `projectile-ag'." + "Helm version of `projectile-ag'. +OPTIONS explicit command line arguments to ag" (interactive (if current-prefix-arg (list (helm-read-string "option: " "" 'helm-ag--extra-options-history)))) (if (require 'helm-ag nil t) (if (projectile-project-p) - (let* ((grep-find-ignored-files (cl-union (projectile-ignored-files-rel) grep-find-ignored-files)) - (grep-find-ignored-directories (cl-union (projectile-ignored-directories-rel) grep-find-ignored-directories)) - (ignored (mapconcat (lambda (i) - (concat "--ignore " i)) - (append grep-find-ignored-files grep-find-ignored-directories (cadr (projectile-parse-dirconfig-file))) - " ")) - (helm-ag-base-command (concat helm-ag-base-command " " ignored " " options)) - (current-prefix-arg nil)) - (helm-do-ag (projectile-project-root) (car (projectile-parse-dirconfig-file)))) + (progn + (when (helm-projectile--projectile-ignore-strategy) + (setq grep-find-ignored-files (helm-projectile--ignored-files) + grep-find-ignored-directories (helm-projectile--ignored-directories))) + (let* ((ignored (when (helm-projectile--projectile-ignore-strategy) + (mapconcat (lambda (i) + (concat "--ignore " i)) + (append grep-find-ignored-files + grep-find-ignored-directories + (cadr (projectile-parse-dirconfig-file))) + " "))) + (helm-ag-base-command (concat helm-ag-base-command + (when ignored (concat " " ignored)) + " " options)) + (current-prefix-arg nil)) + (helm-do-ag (projectile-project-root) (car (projectile-parse-dirconfig-file))))) (error "You're not in a project")) (when (yes-or-no-p "`helm-ag' is not installed. Install? ") (condition-case nil @@ -1005,17 +1073,20 @@ STRING the string in which to escape special characters." (if (projectile-project-p) (let* ((helm-rg-prepend-file-name-line-at-top-of-matches nil) (helm-rg-include-file-on-every-match-line t) - (ignored-files (mapcan (lambda (path) - (list "--glob" (concat "!" (glob-quote path)))) - (cl-union (projectile-ignored-files-rel) grep-find-ignored-files))) - (ignored-directories (mapcan (lambda (path) - (list "--glob" (concat "!" (glob-quote path) "/**"))) - (cl-union (mapcar 'directory-file-name (projectile-ignored-directories-rel)) - grep-find-ignored-directories))) - (helm-rg--extra-args `(,@ignored-files ,@ignored-directories))) - (let ((default-directory (projectile-project-root))) - (helm-rg (helm-projectile-rg--region-selection) - nil))) + (default-directory (projectile-project-root))) + (when (helm-projectile--projectile-ignore-strategy) + (setq helm-rg--extra-args + (mapconcat + 'identity + (cl-union (mapcan (lambda (path) + (list "--glob" (concat "!" (glob-quote path)))) + (helm-projectile--ignored-files)) + (mapcan (lambda (path) + (list "--glob" (concat "!" (glob-quote path) "/**"))) + (mapcar 'directory-file-name (helm-projectile--ignored-directories)))) + " "))) + (helm-rg (helm-projectile-rg--region-selection) + nil)) (error "You're not in a project")) (when (yes-or-no-p "`helm-rg' is not installed. Install? ") (condition-case nil -- 2.47.3