From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Vasilij Schneidermann Newsgroups: gmane.emacs.bugs Subject: bug#25656: [PATCH] 25.1; remember-notes-mode makes every temporary buffer created from it unkillable Date: Sat, 25 Feb 2017 13:12:49 +0100 Message-ID: <20170225121249.GB669@odonien.localdomain> References: <20170224074034.GA615@odonien.localdomain> <87innzf4tp.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: blaine.gmane.org 1488024793 8166 195.159.176.226 (25 Feb 2017 12:13:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Feb 2017 12:13:13 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: 25656@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 25 13:13:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chbDm-0001T7-DA for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Feb 2017 13:13:06 +0100 Original-Received: from localhost ([::1]:42326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chbDs-0003Cs-5M for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Feb 2017 07:13:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chbDl-0003Cl-OZ for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2017 07:13:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chbDi-0002Ll-K6 for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2017 07:13:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57017) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chbDi-0002Lg-Fd for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2017 07:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1chbDh-00019G-T2 for bug-gnu-emacs@gnu.org; Sat, 25 Feb 2017 07:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Feb 2017 12:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25656 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25656-submit@debbugs.gnu.org id=B25656.14880247784404 (code B ref 25656); Sat, 25 Feb 2017 12:13:01 +0000 Original-Received: (at 25656) by debbugs.gnu.org; 25 Feb 2017 12:12:58 +0000 Original-Received: from localhost ([127.0.0.1]:55216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chbDe-00018y-99 for submit@debbugs.gnu.org; Sat, 25 Feb 2017 07:12:58 -0500 Original-Received: from mail-wr0-f194.google.com ([209.85.128.194]:35486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1chbDc-00018m-I7 for 25656@debbugs.gnu.org; Sat, 25 Feb 2017 07:12:56 -0500 Original-Received: by mail-wr0-f194.google.com with SMTP id q39so5091315wrb.2 for <25656@debbugs.gnu.org>; Sat, 25 Feb 2017 04:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=G0hPXMUChM9f+FEDOUtqelpb66xKS7//uL+9m2jYCjg=; b=tGZNi37KgFMf9vJvwzJxFW5bhXVqfdwoTherQmKQfqRS7kwTWXgYHix6lK4NRL4S9X Ap0xZ3pNMY1vdWk39HYmQPZ/W6+3g9pEwV1po61xZ03mF8fqQb3cvQymy4dx0jbAir0f rLKhqCJ1GjFY8tOtUWeGBFTDbNB0m23AvhJeabFpE4zS1c35bkyiBUxVrO/Zg0lfC/26 7CGem/5BV5NqwQ0EZ/12i/L43ytkpqu9GszpmnWgknjy2bsijQ/TfGKhcCgye5rpDbnB W6CFDDkfG8tGhLINyIYg6rx3HbY8X2rzjNUfUbxUQy7EaL5TC6mAPYNYjHqchLRCJOt8 QUzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=G0hPXMUChM9f+FEDOUtqelpb66xKS7//uL+9m2jYCjg=; b=A34jbno4C1dH0+HpFJXMG4xaXI3HLdyorxaND36b67QtDzN6qYlK+OFdbPGtZKFUcd 5EXjqcjffq6pbpetiHVchx3r3LbwCzCTlbXAf9+yRCail8Dqmwgi/jMB0eeriYBaZd8m rIN9z4cYOmOVR6/hdP1NbzfvpbZoUsgxIQJCo5hP4SLXr08P8E65fTCKlh6Hkwz5/Edl Dafaq2blGMO1vTjcHbc+R/bKiSZ0wKCvw71V4vUlZIgY8N+NVPb6u/L+gIBQTO8ZWXhA J4qncYrhe+K+wO3zKnVfP7PDi248m5Ins2uPJlbUZ8WIrKRMJzO9q9sPqxILdpWsFl5f WvdQ== X-Gm-Message-State: AMke39l73vQrNrQL/lYCrMp93/5tFkU17bXmqLL7CBmN7vW42Ci/tV4RKYUB3E1IluEJaA== X-Received: by 10.223.167.138 with SMTP id j10mr6739117wrc.178.1488024770767; Sat, 25 Feb 2017 04:12:50 -0800 (PST) Original-Received: from localhost (dslb-088-078-197-190.088.078.pools.vodafone-ip.de. [88.78.197.190]) by smtp.gmail.com with ESMTPSA id r6sm6154568wmd.4.2017.02.25.04.12.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Feb 2017 04:12:50 -0800 (PST) Content-Disposition: inline In-Reply-To: <87innzf4tp.fsf@users.sourceforge.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129776 Archived-At: OK, I think I've figured out what's going on. I'm calling a command in a remember-notes buffer that happens to hold an org file. It's set up to be unkillable by having a locally added `kill-buffer-query-functions` hook that returns nil. Now, my command calls a number of things including `org-table-export` which does a zillion of things, eventually cloning the buffer it's working on with the `org-export-with-buffer-copy` macro. This macro is so good at cloning buffers it preserves its buffer-local variables, including `kill-buffer-query-functions`. Although it tries killing the buffer afterwards, it fails doing so because the hook forbids it. The result of this avalanche of failures is that for every table cell, an unkillable buffer is created. The lesson from this is to be careful with using Org's APIs, while some of them look reusable, most aren't. While I could patch `remember-notes--kill-buffer-query` to work around this problem, I'll just customize `remember-notes-bury-on-kill` and raise an issue with Org's bug tracker. Thanks for responding to this, Noam!