[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#54296: Add buffer-matching functionality
From: |
Lars Ingebrigtsen |
Subject: |
bug#54296: Add buffer-matching functionality |
Date: |
Wed, 09 Mar 2022 17:20:45 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Philip Kaludercic <philipk@posteo.net> writes:
> 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).
Hm... how would this be used with display-buffer-alist, then? (And
perhaps Martin has some comments; added to the CCs.)
> 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.
I think I'd prefer to have the parameters reversed -- the condition is a
kind of predicate, and these days we seem to prefer to have the
predicate first.
> +(defun buffer-match (buffer condition)
> + "Return non-nil if BUFFER matches CONDITION.
> +CONDITION is is either:
> +- a regular expression, to match a buffer name,
> +- a predicate function that takes a buffer object as argument
> + and returns non-nil if the buffer should be killed,
Killed?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- bug#54296: Add buffer-matching functionality, Philip Kaludercic, 2022/03/07
- bug#54296: Add buffer-matching functionality,
Lars Ingebrigtsen <=
- bug#54296: Add buffer-matching functionality, martin rudalics, 2022/03/09
- bug#54296: Add buffer-matching functionality, Philip Kaludercic, 2022/03/10
- bug#54296: Add buffer-matching functionality, Eli Zaretskii, 2022/03/10
- bug#54296: Add buffer-matching functionality, Philip Kaludercic, 2022/03/10
- bug#54296: [External] : bug#54296: Add buffer-matching functionality, Drew Adams, 2022/03/10
- bug#54296: Add buffer-matching functionality, Eli Zaretskii, 2022/03/10
- bug#54296: Add buffer-matching functionality, Philip Kaludercic, 2022/03/11
- bug#54296: Add buffer-matching functionality, Eli Zaretskii, 2022/03/11
- bug#54296: Add buffer-matching functionality, Philip Kaludercic, 2022/03/13
- bug#54296: Add buffer-matching functionality, Eli Zaretskii, 2022/03/13