From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#46268: 27.1.91; Error in occur-rename-buffer Date: Wed, 03 Feb 2021 10:05:43 -0500 Message-ID: References: <874kitttd3.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32680"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46268@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 03 16:06:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7JjS-0008Od-FQ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 16:06:14 +0100 Original-Received: from localhost ([::1]:60906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7JjR-0006BZ-Fl for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 10:06:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7JjG-00069j-MA for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 10:06:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7JjG-0002xt-Dk for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 10:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l7JjG-00030b-6M for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 10:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Feb 2021 15:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46268 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46268-submit@debbugs.gnu.org id=B46268.161236475411542 (code B ref 46268); Wed, 03 Feb 2021 15:06:02 +0000 Original-Received: (at 46268) by debbugs.gnu.org; 3 Feb 2021 15:05:54 +0000 Original-Received: from localhost ([127.0.0.1]:38586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7Jj7-000305-Pc for submit@debbugs.gnu.org; Wed, 03 Feb 2021 10:05:54 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:59926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7Jj5-0002zj-4x for 46268@debbugs.gnu.org; Wed, 03 Feb 2021 10:05:52 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 9D7888050D; Wed, 3 Feb 2021 10:05:45 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2D8BF8063A; Wed, 3 Feb 2021 10:05:44 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1612364744; bh=Im3mIG+hUCbv1vnfgSXpXhmnExQk/onlOPG1q2ZuUPw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=a1Pmr/xQQjJ2/9I+UqcTFTEZcdL+8O3RqMVA5tyLW4X9Cs8QYsQlrCeZJiC5teXtg gTM3uK06zqwfeCXmLblEoUKL7ZYZeehFqZb62H9T9rQ3HYPIjIg3ESNJuvjtvhu6+8 Tn9h5aZDpMZ7GsskOuHl/A/MuXPAuplh5KyFw/2bFzgkmtUAY5nd4IfErDhpCtj0jJ U9H2KEr83wIU+ra3myPdFhnIP6ASZA6MkRxD0PQ5MjOe1j7JWIpDIlB84omrZ3ILMG 19eAQHQ+WeuJWlPMQTBAr4MU2nSfwGRdPjxETnwKFfyINv4FKheEliYP8DJaadEIa4 869gct2ClszFg== Original-Received: from alfajor (76-10-182-85.dsl.teksavvy.com [76.10.182.85]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E80E31204AE; Wed, 3 Feb 2021 10:05:43 -0500 (EST) In-Reply-To: <874kitttd3.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 03 Feb 2021 10:54:24 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199199 Archived-At: > Also Cc:ing Stefan with a question about occur--garbage-collect-revert-args: [ Side note: Not sure why, I'm not familiar with this code. ] > trying to revert the Occur buffer created from an active region > removes the source buffer name from the Occur buffer name. > For example, (after applying the attached patch) 'M-x occur' > on the active region in *scratch* creates the buffer *Occur: *scratch**. > > But reverting the Occur buffer with 'g' removes the *scratch* buffer name, > and renames the Occur buffer to *Occur: *. > > This is because of two lines in occur-1: > > (occur--garbage-collect-revert-args) > (setq occur-revert-arguments (list regexp nlines bufs)) > > where occur--garbage-collect-revert-args deletes the overlay > with the buffer name *scratch*, and later occur-rename-buffer > can't get the original buffer name from occur-revert-arguments. > And I don't know how to fix this. AFAICT, `occur--garbage-collect-revert-args` aims to throw away the overlays when they're not needed, but we will need them again if we want to `revert-buffer`, so we shouldn't call this function until we're sure `revert-buffer` won't be called. IOW, I think we should just remove the above call. [ I just took a look at the history of this code, and I see that it claims I'm the one who added that function and that call 2 years ago. I say this is fake news ;-) ] Stefan "not sure it's a good idea to joke about the re-birth of nazism"