From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sI01FAPbT2NXUQEAbAwnHQ (envelope-from ) for ; Wed, 19 Oct 2022 13:09:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2Jg/EwPbT2MnnAAAG6o9tA (envelope-from ) for ; Wed, 19 Oct 2022 13:09:55 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0BA229C00 for ; Wed, 19 Oct 2022 13:09:54 +0200 (CEST) Received: from localhost ([::1]:35420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol6xM-0007he-S4 for larch@yhetil.org; Wed, 19 Oct 2022 07:09:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okyVD-0003RK-Q1 for emacs-orgmode@gnu.org; Tue, 18 Oct 2022 22:08:16 -0400 Received: from netyu.xyz ([152.44.41.246]:37040 helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okyVC-0004vB-1E for emacs-orgmode@gnu.org; Tue, 18 Oct 2022 22:08:15 -0400 Received: from fw.net.yu (c-24-12-195-243.hsd1.il.comcast.net [24.12.195.243]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 8b18f539 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 19 Oct 2022 02:08:06 +0000 (UTC) To: emacs-orgmode@gnu.org Subject: [BUG] org-num-mode does not clear previous numbers [9.5.5 (9.5.5-g9ce472 @ /home/user/.config/emacs/straight/build/org/)] Date: Tue, 18 Oct 2022 21:08:02 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) BAYES_00=-1.9, FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=1.999, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 19 Oct 2022 07:07:30 -0400 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" Reply-to: Ruijie Yu From: Ruijie Yu via "General discussions about Org-mode." X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666177794; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=o2B0q1vVrW7YMvb0+jFzUxU1zqNICbvLNwQ94SMNrts=; b=nBdran1u4sox9TF6B7jMFiGDGdwpR4MiFJlXeh9rO2Jn8kSmkXpwacuD9hk9g4tOAHnjEX 3rGJe18qhKj1ZontGwDmZvKHqX3lFXQ8iWCocAIwdcSGQTGbToceKHaxemiVEEzlhh8B2v BE5t2obDKWYImAGFfNtBwejXOt0K06O1punOg2Kl2tGUvqUz3VIgfMmlfjlNCxGkPCbX3A 9nCHdQ1Ade8Z74c6W0HgoW+P7FCXC61lJKiPZrkKKGzhmNhc2b0XjFL/ISyS1PK0+3grr4 SYc85gIeh2ftn1LXPWISg2+lJBUwECS+PZkiRRzjuBp5qWXaYtVqysRZi+YGnw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666177794; a=rsa-sha256; cv=none; b=utm4n6DXUKGGfXvRO98jkY3S8RVY/4O702N4ecdti/j/KhwKeBkudpDOTPOWq/kqTZRP9J Wd4VtYpQ8xAHAn1WFv3dbPrQhpINw6FvirBpuzmV8t36oUJ1MNJYquyir82unroicujXDH 9imbgpu3V2KWeaAsuhcLgCv1yU85Euw+3PPVoQDZYR4bRNlP4e/VLYeG2c28aixZrK8+l2 hr4hxJDAi4bCe1t9XmrBTkxZeZqefvBpQ3A5gbSf1gPiamcSpWgQ7rS7maT4FQdb7B2pWB /HxMEsGpF8b+VX6otCeK7aTOVbkqNjRqYxU0A5jqvgMVXGmTrKYbhZZUinrsrA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.23 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0BA229C00 X-Spam-Score: -2.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: xTvJBOAd2cFo Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ When I call `(org-num-mode)' from lisp multiple times on a single orgmode buffer, I get multiple numberings on each heading. Subsequently, when I call `(org-num-mode -1)' or `(org-num--clear)', only one layer of numberings are removed. This behavior is observed at the build below, but should still be reproducible in current HEAD (4179d1205ed791254aa21fadf262623bc805595d). I have also successfully replicated this issue from a `emacs -Q -nw' environment, using the same orgmode version. Because of this, I have removed the "current state" section since they are proven irrelevant. The offending code is the `cond' construct in `org-num-mode' minor mode definition, where we are directly resetting `org-num--overlays'. I think we should run something like `(org-num--clear)' before the two `setq''s, so that the previous numbers are cleared. Alternatively (and probably a bad advice), maybe we could simply not execute the "enable" branch in `cond' when `org-num--overlays' is non-nil? I don't have a full understanding of the role of `org-num--numbering', so I don't have anything to say about this variable. Emacs : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-10-14 Package: Org mode version 9.5.5 (9.5.5-g9ce472 @ /home/user/.config/emacs/straight/build/org/) current state: ============== ;; omitted