Tags: patch Project.el currently has a small language for matching buffers, used by project-kill-buffers and project--read-project-buffer. As mentioned in [0], this could be generalised, as done in the patch below. As to what file this should be added to, should be discussed. Either way I would consider these functions useful and would have wanted to use them in my own code many times before. While difficult, it might also be useful for things like display-buffer-alist (the issue is that a function as a condition in display-buffer-alist has to accept two arguments, while the proposed patch only takes one). To match functions such as string-match, the argument of buffer-match could be reversed so that the function can be used as a testfn to assoc/alist-get. The reason this was not immediately done when project-kill-buffers was implemented, was that this would raise the "emacs" dependency of the ELPA package "project" to the latest release or even the current development version. To solve issues like these, I have been working on "compat", a yet-unreleased library added to GNU ELPA a while back that could be added as a dependency to project. That way newer functions, such as the ones propose below could be used, without breaking ELPA compatibility. To make this work properly in the near future, compat would have to follow the upstream development, before a release is made. If there is any interest in this kind of an arrangement, I could start a thread on emacs-devel to discuss the details. [0] https://mail.gnu.org/archive/html/emacs-devel/2020-09/msg00082.html [1] https://elpa.gnu.org/devel/compat.html In GNU Emacs 29.0.50 (build 13, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2022-02-24 built on viero Repository revision: bd17fa2c7565f180cedbfa396c0b159e144178cb Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000