From unknown Mon Aug 18 11:25:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13648: 24.3.50; remove-overlays bugs Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Feb 2013 15:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13648@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.136024987932094 (code B ref -1); Thu, 07 Feb 2013 15:12:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Feb 2013 15:11:19 +0000 Received: from localhost ([127.0.0.1]:42166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3T8A-0008La-Ix for submit@debbugs.gnu.org; Thu, 07 Feb 2013 10:11:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46863) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3T86-0008LK-Kp for submit@debbugs.gnu.org; Thu, 07 Feb 2013 10:11:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3T6g-0002gX-Mw for submit@debbugs.gnu.org; Thu, 07 Feb 2013 10:09:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:47890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3T6g-0002gS-Ja for submit@debbugs.gnu.org; Thu, 07 Feb 2013 10:09:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3T6Y-0004kP-GW for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2013 10:09:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3T6Q-0002b3-6d for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2013 10:09:38 -0500 Received: from mout.gmx.net ([212.227.17.20]:55620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3T6P-0002aN-PC for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2013 10:09:30 -0500 Received: from mailout-de.gmx.net ([10.1.76.32]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0Lefrs-1Ujjw236BK-00qVqM for ; Thu, 07 Feb 2013 16:09:24 +0100 Received: (qmail invoked by alias); 07 Feb 2013 15:09:23 -0000 Received: from i59F57850.versanet.de (EHLO rosalinde.fritz.box) [89.245.120.80] by mail.gmx.net (mp032) with SMTP; 07 Feb 2013 16:09:23 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX19ANI9hHi5AhGG6/6xy+9JNQtiI2nbPRK4qL94tkX OvuW6OqUyBCU9v From: Stephen Berman Date: Thu, 07 Feb 2013 16:09:21 +0100 Message-ID: <8738x8b1pa.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) --=-=-= Content-Type: text/plain 0. emacs -Q 1. Evaluate the following sexp: (progn (switch-to-buffer (get-buffer-create "*test*")) (insert "one two three") (setq ov1 (make-overlay 1 4)) (setq ov2 (make-overlay 5 9)) (setq ov3 (make-overlay 9 14)) (sit-for 1) (overlay-put ov1 'display "two") (overlay-put ov2 'display "") (overlay-put ov3 'after-string " four") (sit-for 1) (remove-overlays nil nil 'display "two") (remove-overlays nil nil 'display "") (sit-for 1) (remove-overlays nil nil 'after-string)) In buffer *test* you see the following: 1. First: one two three 2. Then after one second: two three four 3. Then after another second: two two three four 4. Finally, after one more second: one two three four I think the last two displays demonstrate buggy behavior. In the third, remove-overlays has failed to clear the display string "two" but has cleared the empty string. In the fourth, the remove-overlays call specified the after-string property, yet what has been cleared is the display overlay "two" but not the after-string overlay "four". The reason for the first problem is that remove-overlays tests the overlay value with eq, which fails for all strings except the empty string. Hence, both the display overlay "two" and the after-string overlay "four" are not cleared by the second and third calls of remove-overlays, respectively. But the third call does remove "two" because overlay-get tries to get the value of the overlay's after-string property, but it only has a display property, so overlay-get returns nil, and since the fourth argument of remove-overlays is also nil here, they are eq, so the overlay is cleared. The general problem here, I believe, is that, although all the arguments of remove-overlays are optional (so the last invocation of remove-overlays is legitimate), the logic of the code is that the NAME and VAL arguments are either both nil or both non-nil, which conflicts with the semantics of the &optional keyword. I think the easiest and best fix is to make the NAME and VAL arguments conform to the &optional semantics by allowing independent values. This means that the last call of remove-overlays in the above sexp would clear any after-string overlays, regardless of their value. I think this would be useful, and it is backward compatible, because all uses of remove-overlays in Emacs have either both or neither of the NAME and VAL arguments (and any third-party code that only has the NAME argument is either buggy, like the above sexp, or works by chance). The patch below implements this, and also fixes the first problem by testing with equal if the eq test fails. 2013-02-07 Stephen Berman * subr.el (remove-overlays): Handle string and list values of overlay properties. If the property argument is non-nil and the value argument is nil, clear all overlays with that property regardless of their values. (Bug#XXXXX) --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: remove-overlays patch === modified file 'lisp/subr.el' *** lisp/subr.el 2013-02-03 16:13:36 +0000 --- lisp/subr.el 2013-02-07 14:45:09 +0000 *************** *** 2579,2585 **** (defun remove-overlays (&optional beg end name val) "Clear BEG and END of overlays whose property NAME has value VAL. Overlays might be moved and/or split. ! BEG and END default respectively to the beginning and end of buffer." ;; This speeds up the loops over overlays. (unless beg (setq beg (point-min))) (unless end (setq end (point-max))) --- 2579,2589 ---- (defun remove-overlays (&optional beg end name val) "Clear BEG and END of overlays whose property NAME has value VAL. Overlays might be moved and/or split. ! ! BEG and END default respectively to the beginning and end of ! buffer. If VAL is nil and NAME is non-nil, clear all NAME ! overlays regardless of their values. If both NAME and VAL are ! nil, clear all overlays from BEG to END." ;; This speeds up the loops over overlays. (unless beg (setq beg (point-min))) (unless end (setq end (point-max))) *************** *** 2588,2607 **** (setq beg (prog1 end (setq end beg)))) (save-excursion (dolist (o (overlays-in beg end)) ! (when (eq (overlay-get o name) val) ! ;; Either push this overlay outside beg...end ! ;; or split it to exclude beg...end ! ;; or delete it entirely (if it is contained in beg...end). ! (if (< (overlay-start o) beg) (if (> (overlay-end o) end) ! (progn ! (move-overlay (copy-overlay o) ! (overlay-start o) beg) ! (move-overlay o end (overlay-end o))) ! (move-overlay o (overlay-start o) beg)) ! (if (> (overlay-end o) end) ! (move-overlay o end (overlay-end o)) ! (delete-overlay o))))))) ;;;; Miscellanea. --- 2592,2614 ---- (setq beg (prog1 end (setq end beg)))) (save-excursion (dolist (o (overlays-in beg end)) ! (let ((v (overlay-get o name))) ! ;; An overlay property value can be not just a symbol, ! ;; but also a string or a list. ! (when (if val (or (eq v val) (equal v val)) name) ! ;; Either push this overlay outside beg...end ! ;; or split it to exclude beg...end ! ;; or delete it entirely (if it is contained in beg...end). ! (if (< (overlay-start o) beg) ! (if (> (overlay-end o) end) ! (progn ! (move-overlay (copy-overlay o) ! (overlay-start o) beg) ! (move-overlay o end (overlay-end o))) ! (move-overlay o (overlay-start o) beg)) (if (> (overlay-end o) end) ! (move-overlay o end (overlay-end o)) ! (delete-overlay o)))))))) ;;;; Miscellanea. --=-=-= Content-Type: text/plain In GNU Emacs 24.3.50.6 (x86_64-suse-linux-gnu, GTK+ Version 3.4.4) of 2013-02-07 on rosalinde Bzr revision: 111689 michael.albinus@gmx.de-20130207085004-ztc6mdtkh756peam Windowing system distributor `The X.Org Foundation', version 11.0.11203000 System Description: openSUSE 12.2 (x86_64) Configured using: `configure --without-toolkit-scroll-bars CFLAGS=-g3 -O0 --no-create --no-recursion' Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=local locale-coding-system: utf-8-unix default enable-multibyte-characters: t --=-=-=-- From unknown Mon Aug 18 11:25:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13648: 24.3.50; remove-overlays bugs Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Feb 2013 16:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: 13648@debbugs.gnu.org Received: via spool by 13648-submit@debbugs.gnu.org id=B13648.136025545311374 (code B ref 13648); Thu, 07 Feb 2013 16:45:02 +0000 Received: (at 13648) by debbugs.gnu.org; 7 Feb 2013 16:44:13 +0000 Received: from localhost ([127.0.0.1]:42235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Ua4-0002xN-8a for submit@debbugs.gnu.org; Thu, 07 Feb 2013 11:44:13 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:58126) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Ua2-0002xG-15 for 13648@debbugs.gnu.org; Thu, 07 Feb 2013 11:44:11 -0500 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r17GglL0008932; Thu, 7 Feb 2013 11:42:47 -0500 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id DD941B4030; Thu, 7 Feb 2013 11:42:46 -0500 (EST) From: Stefan Monnier Message-ID: References: <8738x8b1pa.fsf@rosalinde.fritz.box> Date: Thu, 07 Feb 2013 11:42:46 -0500 In-Reply-To: <8738x8b1pa.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Thu, 07 Feb 2013 16:09:21 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4485=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4485> : streams <902226> : uri <1339299> X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) > The reason for the first problem is that remove-overlays tests the > overlay value with eq, which fails for all strings [...] No, it won't fail on all strings. You just need to pass it the same string you added to the overlay, rather than a copy of it. I.e. this is not a bug. > invocation of remove-overlays is legitimate), the logic of the code is > that the NAME and VAL arguments are either both nil or both non-nil, Indeed. > which conflicts with the semantics of the &optional keyword. Right. We should document it in the docstring. > This means that the last call of remove-overlays in the above sexp > would clear any after-string overlays, regardless of their value. Normally we don't distinguish "an property FOO of value nil" and "no property FOO". So I think what would make sense is to say that if VAL is nil, then we remove any overlay whose NAME property is non-nil (i.e. the exact inverse from what we currently do). 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. Stefan From unknown Mon Aug 18 11:25:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13648: 24.3.50; remove-overlays bugs Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Feb 2013 19:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 13648@debbugs.gnu.org Received: via spool by 13648-submit@debbugs.gnu.org id=B13648.13602645742836 (code B ref 13648); Thu, 07 Feb 2013 19:17:01 +0000 Received: (at 13648) by debbugs.gnu.org; 7 Feb 2013 19:16:14 +0000 Received: from localhost ([127.0.0.1]:42316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3WxB-0000jh-T6 for submit@debbugs.gnu.org; Thu, 07 Feb 2013 14:16:14 -0500 Received: from mout.gmx.net ([212.227.15.18]:52891) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3Wx9-0000jY-2f for 13648@debbugs.gnu.org; Thu, 07 Feb 2013 14:16:12 -0500 Received: from mailout-de.gmx.net ([10.1.76.17]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0MGDc1-1U89NN3npn-00FG7c for <13648@debbugs.gnu.org>; Thu, 07 Feb 2013 20:16:10 +0100 Received: (qmail invoked by alias); 07 Feb 2013 19:16:10 -0000 Received: from i59F57850.versanet.de (EHLO rosalinde.fritz.box) [89.245.120.80] by mail.gmx.net (mp017) with SMTP; 07 Feb 2013 20:16:10 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1/d+KoxIffdbKT3Y6kgt5TnYnkdY6Udj4YZfdKoRP k7oDpTrwbJ7VXC From: Stephen Berman References: <8738x8b1pa.fsf@rosalinde.fritz.box> Date: Thu, 07 Feb 2013 20:16:07 +0100 In-Reply-To: (Stefan Monnier's message of "Thu, 07 Feb 2013 11:42:46 -0500") Message-ID: <87y5f09bpk.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On Thu, 07 Feb 2013 11:42:46 -0500 Stefan Monnier wrote: >> The reason for the first problem is that remove-overlays tests the >> overlay value with eq, which fails for all strings [...] > > No, it won't fail on all strings. You just need to pass it the same > string you added to the overlay, rather than a copy of it. > I.e. this is not a bug. Damn, I get tripped up by that a lot. And the fact that the empty string is an exception doesn't help to keep the difference in mind. Still, it is rather cumbersome to include appropriate let-bindings or calls to overlay-get for each string value in each use of remove-overlays, as opposed to adding a single equal-check to that. >> invocation of remove-overlays is legitimate), the logic of the code is >> that the NAME and VAL arguments are either both nil or both non-nil, > > Indeed. > >> which conflicts with the semantics of the &optional keyword. > > Right. We should document it in the docstring. > >> This means that the last call of remove-overlays in the above sexp >> would clear any after-string overlays, regardless of their value. > > Normally we don't distinguish "an property FOO of value nil" and "no > property FOO". So I think what would make sense is to say that if VAL > is nil, then we remove any overlay whose NAME property is non-nil > (i.e. the exact inverse from what we currently do). > > 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. To be honest, I'm not sure I do need it. I have code that inserts before-string overlays with different values, some fixed and some dynamically generated, and when these overlays need to be cleared, it would be easier to just refer to the before-string property. But the way I use the overlays, it actually suffices to leave out both the property and the value, i.e. just remove all overlays in the region. At first I thought that's not safe enough, because there could be other other overlays at the same locations but with different properties, but in fact I haven't needed that yet. But I guess the main thing that confused me was the conflict with the semantics of &optional, and since it seems easy enough to avoid, I think it would be better than just documenting the conflict. Steve Berman From unknown Mon Aug 18 11:25:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13648: 24.3.50; remove-overlays bugs Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Feb 2013 01:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stephen Berman Cc: 13648@debbugs.gnu.org Received: via spool by 13648-submit@debbugs.gnu.org id=B13648.13602879362252 (code B ref 13648); Fri, 08 Feb 2013 01:46:02 +0000 Received: (at 13648) by debbugs.gnu.org; 8 Feb 2013 01:45:36 +0000 Received: from localhost ([127.0.0.1]:42692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3d20-0000aH-8O for submit@debbugs.gnu.org; Thu, 07 Feb 2013 20:45:36 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:20077) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3d1y-0000a9-07 for 13648@debbugs.gnu.org; Thu, 07 Feb 2013 20:45:35 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFpZnt/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSQuh3AGwS2RCgOIYZwZgV6DFQ X-IPAS-Result: Av8EABK/CFFFpZnt/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSQuh3AGwS2RCgOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="736381" Received: from 69-165-153-237.dsl.teksavvy.com (HELO pastel.home) ([69.165.153.237]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 07 Feb 2013 20:45:32 -0500 Received: by pastel.home (Postfix, from userid 20848) id 75D7D59042; Thu, 7 Feb 2013 20:45:32 -0500 (EST) From: Stefan Monnier Message-ID: References: <8738x8b1pa.fsf@rosalinde.fritz.box> <87y5f09bpk.fsf@rosalinde.fritz.box> Date: Thu, 07 Feb 2013 20:45:32 -0500 In-Reply-To: <87y5f09bpk.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Thu, 07 Feb 2013 20:16:07 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Damn, I get tripped up by that a lot. And the fact that the empty > string is an exception doesn't help to keep the difference in mind. > Still, it is rather cumbersome to include appropriate let-bindings or > calls to overlay-get for each string value in each use of > remove-overlays, as opposed to adding a single equal-check to that. Generally the best solution is very different: add another property to every overlay. E.g. smerge adds the property `smerge' with values like `conflict' or `refine', so you can then (remove-overlays beg end 'smerge 'refine) without caring about particular values of `after-string' or any other property. Stefan From unknown Mon Aug 18 11:25:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13648: 24.3.50; remove-overlays bugs Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Feb 2013 14:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 13648@debbugs.gnu.org Received: via spool by 13648-submit@debbugs.gnu.org id=B13648.136033506131802 (code B ref 13648); Fri, 08 Feb 2013 14:51:02 +0000 Received: (at 13648) by debbugs.gnu.org; 8 Feb 2013 14:51:01 +0000 Received: from localhost ([127.0.0.1]:43179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3pI1-0008Go-Jv for submit@debbugs.gnu.org; Fri, 08 Feb 2013 09:51:01 -0500 Received: from mout.gmx.net ([212.227.15.18]:54619) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U3pHw-0008Ga-7T for 13648@debbugs.gnu.org; Fri, 08 Feb 2013 09:50:56 -0500 Received: from mailout-de.gmx.net ([10.1.76.10]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0MUBZ6-1UUsb71VGE-00Qzib for <13648@debbugs.gnu.org>; Fri, 08 Feb 2013 15:50:47 +0100 Received: (qmail invoked by alias); 08 Feb 2013 14:50:47 -0000 Received: from i59F55F9C.versanet.de (EHLO rosalinde.fritz.box) [89.245.95.156] by mail.gmx.net (mp010) with SMTP; 08 Feb 2013 15:50:47 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX19mFOYfkihmJAqR+NZSfk44Ol2geb7AO82iFyMQoL 92fk+YdOji3r6T From: Stephen Berman References: <8738x8b1pa.fsf@rosalinde.fritz.box> <87y5f09bpk.fsf@rosalinde.fritz.box> Date: Fri, 08 Feb 2013 15:50:45 +0100 In-Reply-To: (Stefan Monnier's message of "Thu, 07 Feb 2013 20:45:32 -0500") Message-ID: <87r4kqvoze.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On Thu, 07 Feb 2013 20:45:32 -0500 Stefan Monnier wrote: >> Damn, I get tripped up by that a lot. And the fact that the empty >> string is an exception doesn't help to keep the difference in mind. >> Still, it is rather cumbersome to include appropriate let-bindings or >> calls to overlay-get for each string value in each use of >> remove-overlays, as opposed to adding a single equal-check to that. > > Generally the best solution is very different: add another property to > every overlay. E.g. smerge adds the property `smerge' with values like > `conflict' or `refine', so you can then (remove-overlays beg end > 'smerge 'refine) without caring about particular values of > `after-string' or any other property. Thanks, that sounds like a good strategy; I'll try it. Steve Berman From unknown Mon Aug 18 11:25:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13648: 24.3.50; remove-overlays bugs Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 11:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Stephen Berman , 13648@debbugs.gnu.org Received: via spool by 13648-submit@debbugs.gnu.org id=B13648.159835590817271 (code B ref 13648); Tue, 25 Aug 2020 11:46:02 +0000 Received: (at 13648) by debbugs.gnu.org; 25 Aug 2020 11:45:08 +0000 Received: from localhost ([127.0.0.1]:60572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAXO0-0004U9-4S for submit@debbugs.gnu.org; Tue, 25 Aug 2020 07:45:08 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAXNy-0004Mw-Mu for 13648@debbugs.gnu.org; Tue, 25 Aug 2020 07:45:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=DN/g0lgf2m0YjiNtO7cN0nDsMB03hQqbF5kVXtwULik=; b=owQ+Jhn7b1FG+LheVw8xRQ9t2G 9IBBT7hftU/Qy7DHRsWFoU4zdDxEI3nprgalQjh1faH6kRvVxcBBO8mIl0B3EDCtyg7HUuhcrfuc9 /lkF0fLM4MNkJDZJHYS8rdkOWio7Et6p+157Tlt1pPDzkki82oU7YKyhDcgZxWHPUm24=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAXNp-00054V-27; Tue, 25 Aug 2020 13:44:59 +0200 From: Lars Ingebrigtsen References: <8738x8b1pa.fsf@rosalinde.fritz.box> X-Now-Playing: Coil's _The Sound Of Musick_: "Sara Dale's Sensual Massage 7" Date: Tue, 25 Aug 2020 13:44:55 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 07 Feb 2013 11:42:46 -0500") Message-ID: <87sgcb9cg8.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: >> invocation of remove-overlays is legitimate), the logic of the code is >> that the NAME and VAL arguments are either both nil or both non-nil, > > Indeed. > >> which conflicts with the semantics of [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> invocation of remove-overlays is legitimate), the logic of the code is >> that the NAME and VAL arguments are either both nil or both non-nil, > > Indeed. > >> which conflicts with the semantics of the &optional keyword. > > Right. We should document it in the docstring. Does the patch below look OK? >> This means that the last call of remove-overlays in the above sexp >> would clear any after-string overlays, regardless of their value. > > Normally we don't distinguish "an property FOO of value nil" and "no > property FOO". So I think what would make sense is to say that if VAL > is nil, then we remove any overlay whose NAME property is non-nil > (i.e. the exact inverse from what we currently do). > > 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)? 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. Overlays might be moved and/or split. -BEG and END default respectively to the beginning and end of buffer." + +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." ;; This speeds up the loops over overlays. (unless beg (setq beg (point-min))) (unless end (setq end (point-max))) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Mon Aug 18 11:25:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13648: 24.3.50; remove-overlays bugs Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 13:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: stephen.berman@gmx.net, monnier@IRO.UMontreal.CA, 13648@debbugs.gnu.org Received: via spool by 13648-submit@debbugs.gnu.org id=B13648.159836054816928 (code B ref 13648); Tue, 25 Aug 2020 13:03:01 +0000 Received: (at 13648) by debbugs.gnu.org; 25 Aug 2020 13:02:28 +0000 Received: from localhost ([127.0.0.1]:60704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAYaq-0004Oe-0u for submit@debbugs.gnu.org; Tue, 25 Aug 2020 09:02:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAYan-0004IZ-Ls for 13648@debbugs.gnu.org; Tue, 25 Aug 2020 09:02:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37121) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAYag-0001iA-Lr; Tue, 25 Aug 2020 09:02:19 -0400 Received: from [176.228.60.248] (port=4483 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kAYaf-00028Y-Vn; Tue, 25 Aug 2020 09:02:18 -0400 Date: Tue, 25 Aug 2020 16:02:01 +0300 Message-Id: <83364a6fqu.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87sgcb9cg8.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 25 Aug 2020 13:44:55 +0200) References: <8738x8b1pa.fsf@rosalinde.fritz.box> <87sgcb9cg8.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Date: Tue, 25 Aug 2020 13:44:55 +0200 > Cc: Stephen Berman , 13648@debbugs.gnu.org > > (defun remove-overlays (&optional beg end name val) > "Clear BEG and END of overlays whose property NAME has value VAL. ^^^^^^^^^^^^^^^^^^^^^^^ Please also fix this confusing wording, while at that. Thanks. From unknown Mon Aug 18 11:25:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13648: 24.3.50; remove-overlays bugs Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 13:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: Stephen Berman , 13648@debbugs.gnu.org Received: via spool by 13648-submit@debbugs.gnu.org id=B13648.159836375410833 (code B ref 13648); Tue, 25 Aug 2020 13:56:01 +0000 Received: (at 13648) by debbugs.gnu.org; 25 Aug 2020 13:55:54 +0000 Received: from localhost ([127.0.0.1]:35491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAZQY-0002of-Bj for submit@debbugs.gnu.org; Tue, 25 Aug 2020 09:55:54 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAZQW-0002oV-9D for 13648@debbugs.gnu.org; Tue, 25 Aug 2020 09:55:52 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 828A41002C8; Tue, 25 Aug 2020 09:55:46 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AAD84100059; Tue, 25 Aug 2020 09:55:44 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1598363744; bh=5qAFF7jk8h5O7+tIomGdTUbj6ikyp+ScDc1EWQNHHAQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ee8gXNBVKGyfuMJDHnIj1UkeTA1tkxTtkxRr4uKLVxY93I4lwR2eW6h2XMcdT9DY1 9a9avxKhx6P4q30FKeMpFP6c4yVyUfA5OkcT5oAWhk7dbSXz24ZEb2NiRQQX/vzqR1 cq2w4EjfsB0RQwv1RcFmJ5TSAcZpKh6M7r7tQbjsmRp+hREi0XbJGVW5HowPAE4XAN tVYyxoHmnPUBRbSh54t+Sqf9IOgjrGHM9gGTHqzTKfncoTFXIhNhEkYhPDTrAuKrkD G9fB3CyU2bShxocf+IH+8NRgj1Dh0X3IWAR2zeXgBrTDOMeZ/XOKtWhXz1WfoVp1mo qlacEbCoFvGWA== Received: from alfajor (unknown [45.72.246.108]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7DF3F1202C2; Tue, 25 Aug 2020 09:55:44 -0400 (EDT) From: Stefan Monnier Message-ID: References: <8738x8b1pa.fsf@rosalinde.fritz.box> <87sgcb9cg8.fsf@gnus.org> Date: Tue, 25 Aug 2020 09:55:43 -0400 In-Reply-To: <87sgcb9cg8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 25 Aug 2020 13:44:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.054 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 25 10:22:27 2020 Received: (at control) by debbugs.gnu.org; 25 Aug 2020 14:22:27 +0000 Received: from localhost ([127.0.0.1]:35539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAZqF-0005fh-A5 for submit@debbugs.gnu.org; Tue, 25 Aug 2020 10:22:27 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAZqD-0005eY-OL for control@debbugs.gnu.org; Tue, 25 Aug 2020 10:22:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YG2NIgQT7FWx+DE0gDwvivtOBLnlPq565dZwRIalebg=; b=hSBh1gFi/RZssiqCgN02nALBC0 mTzT4XSmL5V+BjRIokjhcDEqwswqRYtQgoSWRsozLNajahLtE5WCHLxHLRFS6slZMuYsocQpWxcYH sKVu4pAXbeDZAaRH77rK/MPqEGmTjRBi/C+BLD6aaPLE3Qc4wMsO03KHtksD9DB+P7tU=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAZq4-0006VW-RG for control@debbugs.gnu.org; Tue, 25 Aug 2020 16:22:19 +0200 Date: Tue, 25 Aug 2020 16:22:15 +0200 Message-Id: <87wo1m7qlk.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #13648 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 13648 fixed close 13648 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 13648 fixed close 13648 28.1 quit From unknown Mon Aug 18 11:25:51 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13648: 24.3.50; remove-overlays bugs Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 14:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Stefan Monnier Cc: Stephen Berman , 13648@debbugs.gnu.org Received: via spool by 13648-submit@debbugs.gnu.org id=B13648.159836541821976 (code B ref 13648); Tue, 25 Aug 2020 14:24:01 +0000 Received: (at 13648) by debbugs.gnu.org; 25 Aug 2020 14:23:38 +0000 Received: from localhost ([127.0.0.1]:35554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAZrN-0005iO-UW for submit@debbugs.gnu.org; Tue, 25 Aug 2020 10:23:38 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAZrM-0005iA-Hi for 13648@debbugs.gnu.org; Tue, 25 Aug 2020 10:23:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=BdGcc0r6atO5PW18ElMz/bTnw9eOdHzwwcvOpINGvV4=; b=A7u3uhAKUuzOpeXca7REkck+I/ P/rIXORUkb0Vzbumxj7OTI1DPmmmIi6k/7YCHR5BuOS3H5qHseKsUi6QMT6u8D2lFsvV+AnGc1VXN +RCz5+yVfZ1+0EqkVDrX1lXkzoWJzoTErYQfd01w7nGEhdUGYBjglmCxnEP7/rHh/Qxo=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAZrE-0006W6-7i; Tue, 25 Aug 2020 16:23:30 +0200 From: Lars Ingebrigtsen References: <8738x8b1pa.fsf@rosalinde.fritz.box> <87sgcb9cg8.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEUjHyEhHB1VUVO6 sZ3///8XRmjUAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+QIGQ4WF8m1vfoAAAG8SURBVDjLdVPbkcQw CAOuAfA1YJMGdpL+ezsJO4n34zyzsw6yeAgQWUcjXPYTEdPunop/508L4UPHe7+6h/WbkUFWxysY w2m3TAIuatnTwhlm4DMXoI5bjuDxYR0AeSmd9j5T8o7L7arscHDldcp4AZrxpRcup9Q1ciZmOSSK cQGIxWAqjKwHEDBwtUeLNlb90kZXtarGCyg8eOuu2bK0gkx3HdL6gAJOwKWeTkI0ZKULWDXP44IY Ygwfdr52SD2yWsAYx3QvTq8+joGklEA7v3wdAwUWEAcjZ2kDpIBqYK/wF8/HoUCfDIme5wNsDIM8 9LUAdH0BqANd2xilrrJnOdpnAyhGMQar2rJij4uxK8JCIOKMsQDxOZbxAPoqpY7YuqZx97IaYGMB lFJ1k+uZdr8dekmv/q6BvjmJqHwBWApMsaquNYAbmzOkOaAPLTXIzeaw+ANIKSItLWu9GqRr19AC nEByRdS99oUiVYAFIDYvmA/xxsGOAqrehn2rlH4+D2MOYTEg+++ocibAhbX5AvNLB0zXIn5Oito4 g8G5Ywwp4FpAycWlX7Jb3gwtjcLvfux9qaX4NmznX+APxEFJima8pW0AAAAldEVYdGRhdGU6Y3Jl YXRlADIwMjAtMDgtMjVUMTQ6MjI6MjIrMDA6MDB/zcLuAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIw LTA4LTI1VDE0OjIyOjIyKzAwOjAwDpB6UgAAAABJRU5ErkJggg== X-Now-Playing: Various's _The Wire Tapper 53_: "Damelove - Dime" Date: Tue, 25 Aug 2020 16:23:26 +0200 In-Reply-To: (Stefan Monnier's message of "Tue, 25 Aug 2020 09:55:43 -0400") Message-ID: <87pn7e7qjl.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: >> 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 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> 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. Yeah, and perhaps that'll break something... In any case, it's probably not worth mentioning in the doc string. :/ >> (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. Yup. I've added more text there. >> +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, Pushed to the trunk. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no