bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#42386: Acknowledgement ([PATCH] Handle symbols in project-kill-buffe


From: Eli Zaretskii
Subject: bug#42386: Acknowledgement ([PATCH] Handle symbols in project-kill-buffers-ignores)
Date: Thu, 16 Jul 2020 18:14:17 +0300

> From: "Philip K." <philip@warpmail.net>
> Date: Thu, 16 Jul 2020 10:47:43 +0200
> 
>  Each condition is either a regular expression matching a buffer
> -name, or a predicate function that takes a buffer object as
> -argument and returns non-nil if it matches.  Buffers that match
> -any of the conditions will not be killed."
> -  :type '(repeat (choice regexp function))
> +name, a predicate function that takes a buffer object as argument
> +and returns non-nil if it matches, or a symbol protecting buffers
> +of certain major modes.

The part you added to the doc string is unclear: how can a symbol
"protect buffers of certain major modes"?  (I think I can guess what
you mean, but readers of doc strings should be guessing.)

> -                       ((functionp c)
> +                       ((and (symbolp c)
> +                             (provided-mode-derived-p
> +                              (buffer-local-value 'major-mode buf)
> +                              c)))
> +                       ((and (not (symbolp c))
> +                             (functionp c))
>                          (funcall c buf))))

Is this logic correct and reliable?  A function is a symbol, and there
could be symbols that have both a function cell and a variable cell --
how does this cope with that?

And why do you require a function not to be a symbol?  I'm probably
missing something.

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]