From unknown Wed Sep 10 04:07:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#60058 <60058@debbugs.gnu.org> To: bug#60058 <60058@debbugs.gnu.org> Subject: Status: 29.0.60; overlay-lists does not conform to its docstring Reply-To: bug#60058 <60058@debbugs.gnu.org> Date: Wed, 10 Sep 2025 11:07:43 +0000 retitle 60058 29.0.60; overlay-lists does not conform to its docstring reassign 60058 emacs submitter 60058 Kai Ma severity 60058 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 14 00:22:19 2022 Received: (at submit) by debbugs.gnu.org; 14 Dec 2022 05:22:19 +0000 Received: from localhost ([127.0.0.1]:36769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5KDi-00024q-Mk for submit@debbugs.gnu.org; Wed, 14 Dec 2022 00:22:18 -0500 Received: from lists.gnu.org ([209.51.188.17]:54848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5KDg-00024k-T1 for submit@debbugs.gnu.org; Wed, 14 Dec 2022 00:22:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5KDg-0002Bf-Nz for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 00:22:16 -0500 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5KDf-0004zy-0W for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 00:22:16 -0500 Received: by mail-pj1-x1043.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so5876327pjj.4 for ; Tue, 13 Dec 2022 21:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=ZngAoK/tyEnxSw6pgEsHDe2OocgerxRiH0enGaMGmrM=; b=fmA+LRjyklNQy+6SU4a1f04iQoEFDv3QzMxsfg+EJtX/cy7aBKMieRihWNi39KJEDk rZUlUomGLXyrTLPSXtZ0I7ZrMf1Qje/w8kNnF24lGmAg0n8XKFEw3JOXAer1W3kugmKa 2lC4XmfMMkIuta46J/Ydyf1DzU8RC8ROyUeJW/lWmcxOLj4t6jkL6k9dlRAH9cpFmWpg 9ltq8UIbDarcbHezLjhbkh0nW7Qzj/5UNAUiUG2XoJrFtAE73P5MC6wqonz5cqxI1YwR RKhrtFPr07tA30osdklMrxWkJXawP8iiO6RYEkyAfabxAguoITz+3HQYWz+DKaDQaIx3 m3hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZngAoK/tyEnxSw6pgEsHDe2OocgerxRiH0enGaMGmrM=; b=geP5F2dJKgUrkE2RIf7y929Tozg5L8Js3DsLI2+czW9x2BvblzSAJjn3SjLuHrI6Br IQX/wU65v7e8c7nhJj7+WsO0RwUUL+mtTiGwzB3zaEfbuax3Ndp2kJXERpuloVcR0hFm +2HypKM1bXxDpGGSsWWUHYM3DaebK8TrgZCJs4hmtiapo8A1Vn8dptihHZEXmZz0mUTi 74flXx2XBwgztKHtqGTkENvNNaupQv3ZAf0qM3Oo6hOebEi1fLGVv7E08+VW5qjA2uk0 AOPe+3xZXijXKRg1DAPywNMUecLmj/b1MNznvCAZQAq4QDG6qMF7NiGSZpCJzEZm7tz5 Y2Tw== X-Gm-Message-State: ANoB5pkdY3ep2dY0LM9vKiuuBfCWri/8hM17AuXtCdRg4U3FgQ6G8K4t wuQPuLJq0y0cbeUUBEiU8UmzgrHicnRz6rN0 X-Google-Smtp-Source: AA0mqf5UY5wLc9tAbuq3TIQTWGgLxg7yFA4d//d5AZnGpIHtHCqrfutBZPjXR90aJ6l8pzqksKO4iA== X-Received: by 2002:a17:902:e30a:b0:189:deeb:8c94 with SMTP id q10-20020a170902e30a00b00189deeb8c94mr21058855plc.22.1670995332619; Tue, 13 Dec 2022 21:22:12 -0800 (PST) Received: from Kais-MacBook.local ([202.38.78.189]) by smtp.gmail.com with ESMTPSA id f17-20020a170902ce9100b00178b6ccc8a0sm837504plg.51.2022.12.13.21.22.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 21:22:11 -0800 (PST) From: Kai Ma To: bug-gnu-emacs@gnu.org Subject: 29.0.60; overlay-lists does not conform to its docstring Date: Wed, 14 Dec 2022 13:22:07 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=justksqsf@gmail.com; helo=mail-pj1-x1043.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FROM_LOCAL_NOVOWEL=0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: submit 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.8 (-) The docstring of overlay-lists states that the return value is a cons pair, and the CDR is not always nil. However, the code does not do what it claims to do. DEFUN ("overlay-lists", Foverlay_lists, Soverlay_lists, 0, 0, 0, doc: /* Return a pair of lists giving all the overlays of the current buffer. The car has all the overlays before the overlay center; the cdr has all the overlays after the overlay center. Recentering overlays moves overlays between these lists. The lists you get are copies, so that changing them has no effect. However, the overlays you get are the real objects that the buffer uses. */) (void) { Lisp_Object overlays = Qnil; struct itree_node *node; ITREE_FOREACH (node, current_buffer->overlays, BEG, Z, DESCENDING) overlays = Fcons (node->data, overlays); return Fcons (overlays, Qnil); } This change in behavior has led to at least one breakage in the wild: symbol-overlay cannot count overlays correctly. I think there is a problem either in the code or in the docstring. Kai From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 14 07:23:46 2022 Received: (at 60058) by debbugs.gnu.org; 14 Dec 2022 12:23:46 +0000 Received: from localhost ([127.0.0.1]:38830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5QnZ-0005ns-L7 for submit@debbugs.gnu.org; Wed, 14 Dec 2022 07:23:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5QnW-0005ni-Ip for 60058@debbugs.gnu.org; Wed, 14 Dec 2022 07:23:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5QnP-00044D-WF; Wed, 14 Dec 2022 07:23:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Et8JfM/8y1cUoZRbhddpUbChOtZBhMD6pfJgNoKVgR4=; b=mCnGqJpxo+S2 RjbkF3u102ntoMBMiHBNQ09wHZ1sBXhkuJlIAx809bVYZzE2bXmFnSZcNomITOGoWTS8fyvGAqXpg KQW6Dg4g3YDjnjVKI7KHxAQDeknpfAzBusJZTGHdFrsht+/QsgMEioTaPT+i+a0m3M6O1MVf13MsL dBefR86+vlMpyzACWE6hMVXFuvV37AX/MlQbIGP/3hHmRdMDXeutibX6zEZRPtO5SdHZ4mH2QoAmJ u11EPupz7yLXGFg8xJUbR5ulR0egrponlEdYzFFfSPx3gvXRpngVcwixK6igU0JAT8/ryuN3Mlyj7 nPH8tMTxINi9Rlw2WQCK0w==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5QnO-0006uT-Ib; Wed, 14 Dec 2022 07:23:34 -0500 Date: Wed, 14 Dec 2022 14:23:31 +0200 Message-Id: <83a63qnph8.fsf@gnu.org> From: Eli Zaretskii To: Kai Ma , Lars Ingebrigtsen , Stefan Monnier In-Reply-To: (message from Kai Ma on Wed, 14 Dec 2022 13:22:07 +0800) Subject: Re: bug#60058: 29.0.60; overlay-lists does not conform to its docstring References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60058 Cc: 60058@debbugs.gnu.org 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: Kai Ma > Date: Wed, 14 Dec 2022 13:22:07 +0800 > > The docstring of overlay-lists states that the return value is a cons > pair, and the CDR is not always nil. However, the code does not do what > it claims to do. > > DEFUN ("overlay-lists", Foverlay_lists, Soverlay_lists, 0, 0, 0, > doc: /* Return a pair of lists giving all the overlays of the current buffer. > The car has all the overlays before the overlay center; > the cdr has all the overlays after the overlay center. > Recentering overlays moves overlays between these lists. > The lists you get are copies, so that changing them has no effect. > However, the overlays you get are the real objects that the buffer uses. */) > (void) > { > Lisp_Object overlays = Qnil; > struct itree_node *node; > > ITREE_FOREACH (node, current_buffer->overlays, BEG, Z, DESCENDING) > overlays = Fcons (node->data, overlays); > > return Fcons (overlays, Qnil); > } > > This change in behavior has led to at least one breakage in the wild: > symbol-overlay cannot count overlays correctly. > > I think there is a problem either in the code or in the docstring. The problem is not in overlay-lists, IMO, the problem (if there is one) is in overlay-recenter: it is a no-op in Emacs 29 and later. I think we have two alternatives: . reimplement overlay-recenter for the new overlay representation . document that overlay-recenter is a no-op, as an incompatible Lisp change, and recommend that Lisp program simply stop relying on its effect in Emacs >= 29: after all, the sole purpose of that function was to speed up overlay access, and now this is not needed I tend to do the latter. Lars, Stefan, any ideas or comments? From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 14 09:21:55 2022 Received: (at 60058) by debbugs.gnu.org; 14 Dec 2022 14:21:55 +0000 Received: from localhost ([127.0.0.1]:39539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5Sdv-0001BN-KD for submit@debbugs.gnu.org; Wed, 14 Dec 2022 09:21:55 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5Sdt-0001BF-3h for 60058@debbugs.gnu.org; Wed, 14 Dec 2022 09:21:54 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B894A440C6C; Wed, 14 Dec 2022 09:21:47 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6A21A440989; Wed, 14 Dec 2022 09:21:46 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671027706; bh=bp65BPWXF8xshSmJdV7kJQL851YDLkJWHsAjrs5b98w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=a5BzRraVw01OVwm/Mv+pplJYNVhZmy40P0+2j/m/Nrmk39ok3OVFgueD9U5KU3EgP va8N5zgloZC8fLkkZ+yhQ9JkERBLsxzuelTVyWMqkgvDWh5dGTlEaTmSO7PdUbA3sg 3aheFV4Iz8++yi9sjYFXT7Md785Gxr1XEC+NSX6xzBsFFI9xn+KB9mN1u27nPVyEjN IRSUiFRJgRVwlo1xQmoz3k0HuvHkTJ9xFEOY9tso/TteBXfWjdBvqf0WtLWL7CNJJk rN1i4sVn7a9w/B+KiD1k5tICWOhm5VY448Soq7cCE89hD/LFC4PRTGHaF8bCQoUsI2 XwH7KTRan2rPQ== Received: from pastel (unknown [45.72.193.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 338211203B3; Wed, 14 Dec 2022 09:21:46 -0500 (EST) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#60058: 29.0.60; overlay-lists does not conform to its docstring In-Reply-To: <83a63qnph8.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Dec 2022 14:23:31 +0200") Message-ID: References: <83a63qnph8.fsf@gnu.org> Date: Wed, 14 Dec 2022 09:21:44 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) 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.392 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-Debbugs-Envelope-To: 60058 Cc: 60058@debbugs.gnu.org, Kai Ma , Lars Ingebrigtsen 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 (---) > The problem is not in overlay-lists, IMO, the problem (if there is > one) is in overlay-recenter: it is a no-op in Emacs 29 and later. The use of `overlay-recenter` together with `overlay-lists` took me by surprise. So yes, I think we should document that `overlay-recenter` is a no-op. We should also mark it obsolete. The code for `symbol-overlay-get-list` should likely use `overlays-in` instead. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 14 13:19:49 2022 Received: (at 60058-done) by debbugs.gnu.org; 14 Dec 2022 18:19:49 +0000 Received: from localhost ([127.0.0.1]:40802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5WM9-0006AI-AC for submit@debbugs.gnu.org; Wed, 14 Dec 2022 13:19:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5WM7-0006AA-Oe for 60058-done@debbugs.gnu.org; Wed, 14 Dec 2022 13:19:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5WM1-0003U0-TS; Wed, 14 Dec 2022 13:19:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gzn43LPS8B3n7MXExZXcBqyAQEq4rG5BCG92rNBJ82Q=; b=oHCGGWNl4DaH izr4y9Us7z1iY/h+M3yeXMrDdISIy5YJD7yv3aaTKNpEzX6ZssOCRxwbshlIaJwgF8HeNgPjvofPK kDryN8Fv1Ymtviw6MdI+jbMCBlvxZAQgjZX+8LEjdTO/rR6KlaMj/hg4xPp9xervxGlIKSjoEHMZm bHRnn9vZXRDd7b6LYd6AeXygqLvekFp4iFsRhh8CEcFiLrXMH3/qVbnH4IppKeHvRTpP/jPt4KsuB EaeSjFoOACwE/4cM5yPFyuNGeL0B9ty7kDMBSNUtFjETKVesTgBz551crKoHhx5i2w0dwz4PyiWEZ GI2WdrNybms9eRJAXdxRGQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5WM1-0005id-Dp; Wed, 14 Dec 2022 13:19:41 -0500 Date: Wed, 14 Dec 2022 20:19:39 +0200 Message-Id: <83bko5n8zo.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Wed, 14 Dec 2022 09:21:44 -0500) Subject: Re: bug#60058: 29.0.60; overlay-lists does not conform to its docstring References: <83a63qnph8.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60058-done Cc: justksqsf@gmail.com, 60058-done@debbugs.gnu.org, larsi@gnus.org 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: Stefan Monnier > Cc: Kai Ma , Lars Ingebrigtsen , > 60058@debbugs.gnu.org > Date: Wed, 14 Dec 2022 09:21:44 -0500 > > > The problem is not in overlay-lists, IMO, the problem (if there is > > one) is in overlay-recenter: it is a no-op in Emacs 29 and later. > > The use of `overlay-recenter` together with `overlay-lists` took me > by surprise. So yes, I think we should document that `overlay-recenter` > is a no-op. We should also mark it obsolete. I didn't mark it obsolete yet. Having Emacs 29.1 annoy programs that call a function that is a no-op, and adding that so close to the release, sounds like not the best idea. Maybe we should consider obsoleting it in Emacs 30. Otherwise, I did update the documentation to be consistent with the new implementation of the overlays (see also bug#59996), and I'm therefore closing this bug report. From unknown Wed Sep 10 04:07:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 12 Jan 2023 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator