GNU bug report logs - #41736
28.0.50; project.el - support global patterns for project-ignores

Previous Next

Package: emacs;

Reported by: Theodor Thornhill <theo <at> thornhill.no>

Date: Sat, 6 Jun 2020 09:46:02 UTC

Severity: normal

Found in version 28.0.50

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; project.el - support global patterns for project-ignores
Date: Sat, 06 Jun 2020 09:45:42 +0000
Hello,

In https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41572 there is talk about supporting a "plain project", and when joining that chat I realised that the "best" current implementation is the VC backend. However, this backend does not easily include other patterns to ignore.

For example we might want to ignore "node_modules", "elm-stuff" etc.
These can be added pretty easily to 'project-vc-ignores' via:

1. Major mode support: "(setq-local project-vc-ignores '("foo" "bar"))"
2. User init.el "(add-to-list project-vc-ignores "foo")"

However, there are some drawbacks.
Method 1:
- We rely on major mode to implement this
- When using "project-switch-project", then press "f - find-file" the ignore is not recognized yet since it relies on the major mode.
- It does not work when a project uses several modes

Method 2:
- Needs user to add this to own init file.
- Pollutes the defcustom globally

Is there a way to set these patters such that we still can use the fast VC backend, but not have these drawbacks?

It seems like an easy solution could be to add a "defcustom project-ignore-patterns" that the project-vc backend picks up. This could be set by both future major modes and as user customization.

FWIW, method 2 seems to work perfectly, yet seems like kind of a hack.

Theo






This bug report was last modified 5 years and 72 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.