Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

### Internal

* Tidy up top-level dependencies: `require` `grep` from the helpers that actually use `grep-find-ignored-files`/`-directories` (`helm-projectile--ignored-files`/`-directories`) instead of relying on it being pulled in transitively, and drop the unused `helm-locate` and `helm-global-bindings` requires. (No startup-time change - Helm loads all three transitively anyway; this just makes the dependencies honest.)
* Drive `helm-projectile-toggle`'s command remaps from a single table (`helm-projectile--command-remaps`) instead of two hand-maintained copies of ~20 `define-key` calls.
* Extract the remote virtual-Dired guard duplicated across the three Dired file actions into a `helm-projectile--with-virtual-dired` macro.
* Sharp-quote (`#'`) function references so the byte-compiler can catch typos in them.
Expand Down
9 changes: 6 additions & 3 deletions helm-projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@
;; built-in libraries
(require 'subr-x)
(require 'cl-lib)
(require 'grep) ;; TODO: Probably we should defer this require
;; `grep' is loaded lazily (only when computing ignores for a search); see
;; `helm-projectile--ignored-files'.

(require 'helm-core)
(require 'helm-global-bindings)
(require 'helm-types)
(require 'helm-locate)
(require 'helm-buffers)
(require 'helm-files)
(require 'helm-grep)
Expand Down Expand Up @@ -1441,11 +1440,15 @@ When set to `search-tool', the above does not happen."

(defun helm-projectile--ignored-files ()
"Compute ignored files."
;; `grep' provides `grep-find-ignored-files'; load it on demand rather than
;; at startup, since it is only needed when a search computes ignores.
(require 'grep)
(cl-union (projectile-ignored-files-rel) grep-find-ignored-files
:test #'equal))

(defun helm-projectile--ignored-directories ()
"Compute ignored directories."
(require 'grep)
(cl-union (mapcar #'file-name-as-directory (projectile-ignored-directories-rel))
(mapcar #'file-name-as-directory grep-find-ignored-directories)
:test #'equal))
Expand Down
Loading