| Age | Commit message (Collapse) | Author |
|
add-dir-local-variable switches to the .dir-locals.el buffer.
Without save-selected-window, kill-buffer and the subsequent
buffer-file-name check operated on unpredictable buffers. This
matches the pattern already used in projectile-add-dir-local-variable.
|
|
The seq-sort comparator ignored its second argument, producing
undefined ordering. The intent was just to prioritize files from
sibling directories. Replace with a clear two-bucket partition:
sibling-dir files first, then the rest.
|
|
unwind-protect ran save-buffer even when the user aborted skeleton
insertion with C-g, creating a .dir-locals.el with empty/partial
content. Run save-buffer sequentially after the skeleton instead,
so aborting leaves no file on disk.
|
|
projectile-ignored-projects returns truename-resolved paths, but
callers pass abbreviated or unnormalized paths. The member check
would fail to match (e.g., ~/work/ vs /Users/bob/work/). Resolve
project-root to truename before comparing.
|
|
file-expand-wildcards uses default-directory for relative patterns,
which was whatever the current buffer had rather than the project
root. Bind default-directory to the project root and return relative
paths so projectile-expand-paths resolves them correctly downstream.
|
|
find-tag was removed in Emacs 29. When the configured tags backend
(ggtags or etags-select) is unavailable, fall back to
xref-find-definitions instead, which is available since Emacs 25.1.
|
|
Replace private xref--show-xrefs with public xref-show-xrefs. The
private function's signature changed across Emacs versions. Keep
xref-references-in-directory to scope the search to Projectile's
project root.
|
|
The filename text at point (from thing-at-point or region) was used
directly as a regexp pattern in string-match. Characters like [ ] ( )
would cause invalid-regexp errors or incorrect matches. Use
string-search for literal substring matching instead.
|
|
projectile-get-sub-projects-command returned "" for non-git VCSes,
which passed the stringp guard in projectile-files-via-ext-command
and spawned a useless shell process. Return nil instead, and also
make the guard defensive against empty strings to match the
docstring's contract.
|
|
|
|
- Test sort-by-modification-time handles nil file-attributes
- Test projectile--merge-related-files-fns merges correctly across
keys, within same key, and does not mutate original return values
- Test projectile-load-project-cache does not store nil on corrupt
cache files
|
|
nconc destructively modifies the existing plist value, which can
corrupt shared data from related-files-fn return values. It also
silently drops values when the existing list is nil (nconc of nil
doesn't update the plist entry in place). Using append with
explicit plist-put fixes both issues.
|
|
When no command is configured for a project type and
compilation-read-command is nil (skipping the prompt), the nil
command would reach (compile nil) and signal a cryptic
wrong-type-argument error. Signal a clear user-error instead.
|
|
recentf stores canonical paths (with symlinks resolved), so the
project root must also be truename-resolved for string-prefix-p
matching to work when the project path contains symlinks.
|
|
file-attributes returns nil for deleted files, causing
file-attribute-modification-time to error. Use 0 as the fallback
timestamp so deleted files sort to the end instead of crashing.
|
|
Like projectile-project-buffers, pass a shared truename-cache hash
table to projectile-project-buffer-p to avoid redundant
file-truename calls when iterating over the buffer list.
|
|
The format call passed both project-root and compile-dir, but no
project type's configure command uses two %s placeholders (meson
uses one for the project root). The extra argument was silently
ignored.
|
|
The function created a temp buffer and ran hack-dir-local-variables
on every compile/test/run invocation just to read a variable that
dir-locals already set buffer-locally in file buffers. Simply read
the variable directly.
|
|
The unbounded (while (vc-dir-busy) ...) loop could freeze Emacs
indefinitely if vc-dir hangs (e.g., broken remote repo). This is
especially dangerous when called for every known project via
projectile-check-vcs-status-of-known-projects.
|
|
The new-process argument was ignored when generating the eat buffer
name (hardcoded nil), so requesting a new process via prefix arg
would always reuse the same buffer name. This matches the behavior
already used in projectile--vterm.
|
|
mapcar wraps each recursive result in a list, producing nested lists
that only work because flatten-tree compensates downstream. mapcan
properly concatenates the results into a flat list.
|
|
When projectile-unserialize returns nil (corrupt or empty file),
don't store nil in projectile-projects-cache. A nil entry prevents
future reload attempts until the user manually invalidates.
|
|
Reuse the already-resolved `current-project` binding instead of
calling projectile-project-root a second time. Avoids redundant
root resolution and a subtle correctness risk if the two calls
returned different values.
|
|
|
|
- Test that projectile-update-project-type resets cache with 'equal test
- Test safe-local-variable predicates for project settings variables
- Test that projectile-project-type passes project-root through to
detect-project-type
|
|
projectile-project-type already resolves the project root. Pass it
through to projectile-detect-project-type so it doesn't resolve it
a second time just for the cache key.
|
|
nconc destructively modifies the list returned by
projectile-get-immediate-sub-projects, which could affect any caller
holding a reference to that list. Use append for a non-destructive
alternative.
|
|
The deleted file check used member inside seq-remove, which is O(n*m)
where n is total files and m is deleted files. Convert the deleted
list to a hash set for O(1) lookups, making the overall operation O(n).
|
|
Variables documented as "should be set via .dir-locals.el" were missing
safe-local-variable properties, causing Emacs to prompt for confirmation
every time they were encountered. Add stringp for command and directory
variables, booleanp for the caching toggle.
Intentionally omit projectile-project-related-files-fn since it accepts
functions, which cannot be safely evaluated from dir-locals.
|
|
file-truename resolves symlinks via synchronous I/O, which can hang
Emacs when the project is on a remote host via TRAMP. expand-file-name
is sufficient here (it normalizes path components) and works safely
with remote paths.
|
|
The buffer-limiting function was called before the file-remote-p guard
in projectile-find-file-hook-function, triggering expensive buffer
enumeration and file-truename calls on every remote file open. Move
it inside the existing TRAMP guard.
|
|
When called with :precedence, the function recreated the type cache
hash table without :test 'equal, defaulting to eql. Since project
roots are strings, no cache key would ever match, causing perpetual
re-detection of project types until Emacs was restarted.
|
|
|
|
- projectile-purge-file-from-cache: verify it serializes the updated
file list (not the stale original) to disk
- projectile-default-generic-command: test string commands, symbol
commands, lambda commands, and missing commands
- projectile-sort-by-modification-time: verify descending sort order
- projectile-project-buffer-p: verify the truename cache is used and
avoids redundant file-truename calls
|
|
Move projectile--dirconfig-cache near other cache variables to fix
byte-compilation warning. Also skip caching when file-attributes
returns nil (e.g. file doesn't exist) to avoid false cache hits.
|
|
Two issues:
1. projectile-find-dir-hook was added on mode enable but never removed
on disable, leaking the hook function after turning off the mode.
2. dired-before-readin-hook was added with the LOCAL flag, but
projectile-mode is a global mode. This meant the hook only fired
in whichever buffer happened to be current when the mode was enabled,
not in all dired buffers. Remove the LOCAL flag and clean it up
properly on disable.
|
|
A plain message is easy to miss in the echo area. Use display-warning
so the failure is visible in the *Warnings* buffer and harder to
overlook, since a failed write means in-memory and on-disk caches
will silently diverge.
|
|
When checking which buffers belong to a project, file-truename was
called for every buffer's directory. Many buffers share the same
directory, so memoize the results in a hash table passed from
projectile-project-buffers. This reduces redundant symlink resolution,
which is especially costly over TRAMP.
|
|
The .projectile dirconfig file was being re-read and re-parsed 3-4
times per indexing operation (by paths-to-ignore, patterns-to-ignore,
paths-to-ensure, patterns-to-ensure, etc.). This is wasteful,
especially over TRAMP where each file read is a network round-trip.
Cache the parsed result per project root, keyed by the file's
modification time so edits to .projectile are picked up immediately.
The cache is also cleared by projectile-invalidate-cache.
|
|
The sort comparator was calling file-attributes on every comparison,
resulting in O(n log n) stat calls. Pre-compute all timestamps into
a hash table first (O(n) stats), then sort using cached values.
Also use file-attribute-modification-time/file-attribute-access-time
accessors instead of raw nth.
|
|
system-type and the return value of projectile-project-vcs are symbols,
not strings. string=/string-equal happened to work due to implicit
coercion, but eq is the correct comparison for symbols.
|
|
The function used fboundp + symbol-function which only works for
symbols. Actual lambda/closure values would silently return nil.
Use funcall directly, which handles both symbols and lambdas.
|
|
The NORECORD and FORCE-SAME-WINDOW arguments to switch-to-buffer
were outside the function call, so they were never actually passed.
|
|
The function was serializing the original file list to disk instead of
the updated list with the file removed. This meant purged files would
reappear in the cache after restarting Emacs.
|
|
|
|
|
|
- Use VCS-appropriate command in projectile-get-sub-projects-files
instead of hardcoding projectile-git-command.
- Add projectile-hg-ignored-command and projectile-svn-ignored-command
defcustoms so ignored-file filtering works for hg and svn projects
in native/hybrid indexing mode.
|
|
seq-union requires Emacs 28.1+ and seq-keep requires Emacs 29.1+.
|
|
seq-union is not available in Emacs 27's built-in seq.el.
Use (seq-uniq (append ...)) which achieves the same result.
|
|
The fboundp guard was removed but vc-git is only loaded at runtime,
so the byte-compiler needs a declare-function to avoid a warning.
|