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

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

bug#13648: 24.3.50; remove-overlays bugs


From: Stefan Monnier
Subject: bug#13648: 24.3.50; remove-overlays bugs
Date: Tue, 25 Aug 2020 09:55:43 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> This said, the reason why I have not implemented this case of NAME being
>> specified while VAL is left unspecified is because I haven't come up
>> with a need for it.  So I'd be interested to hear the backstory of
>> why/where you need it.
> The case here is (remove-overlay beg end 'foo), which will remove all
> overlays that don't have foo (as well as the ones that have foo, but
> it's set to nil)?  

I think the case you describe is indeed never useful, but it *is*
implemented, AFAIK.

The more useful interpretation I think would be for
(remove-overlay beg end 'foo) to remove all overlays that have a non-nil
value of `foo`.  But I haven't implemented it because (despite my
impression that it would be more useful) I haven't actually found any
need for it.

> diff --git a/lisp/subr.el b/lisp/subr.el
> index a58a873a33..bd50c52552 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -3073,7 +3073,10 @@ copy-overlay
>  (defun remove-overlays (&optional beg end name val)
>    "Clear BEG and END of overlays whose property NAME has value VAL.

As Eli points out, I wasn't very inspired when I wrote this first line.
We should at very least replace "BEG and END" with "BEG...END" or
something like that.

> +BEG and END default respectively to the beginning and end of buffer.
> +Values are compared with `eq'.
> +If either NAME or VAL are specified, both should be specified."

LGTM,


        Stefan






reply via email to

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