From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 17:37:10 2012 Received: (at submit) by debbugs.gnu.org; 15 Dec 2012 22:37:10 +0000 Received: from localhost ([127.0.0.1]:44455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk0M1-0001el-Dl for submit@debbugs.gnu.org; Sat, 15 Dec 2012 17:37:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53013) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk0Lz-0001ee-DK for submit@debbugs.gnu.org; Sat, 15 Dec 2012 17:37:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tk0Ku-0007vE-3m for submit@debbugs.gnu.org; Sat, 15 Dec 2012 17:36:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-104.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:57015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tk0Kt-0007vA-WB for submit@debbugs.gnu.org; Sat, 15 Dec 2012 17:36:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tk0Kr-0001qf-Dy for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:35:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tk0Kp-0007uV-EB for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:35:57 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:48288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tk0Kp-0007uP-6W for bug-gnu-emacs@gnu.org; Sat, 15 Dec 2012 17:35:55 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBFMZrCp032191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 15 Dec 2012 22:35:54 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBFMZqKw022788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 15 Dec 2012 22:35:53 GMT Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBFMZqEA011417 for ; Sat, 15 Dec 2012 16:35:52 -0600 Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 15 Dec 2012 14:35:52 -0800 From: "Drew Adams" To: Subject: 24.3.50; org-odt.el code that kills modified buffers Date: Sat, 15 Dec 2012 14:35:45 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac3bFIWa+BGGFyySS4Wkkv+9DBhsXQ== X-Source-IP: ucsinet22.oracle.com [156.151.31.94] 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: -3.4 (---) X-Debbugs-Envelope-To: submit 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.1 (------) This is a question, but it might also be a bug report regarding the code cited. IIUC, `set-buffer-modified-p' (and also `restore-buffer-modified-p', which is a lousy name BTW) always acts on the current buffer. There is no way to tell it which buffer to act on, other than, say, using `with-current-buffer'. I use `find-file-noselect' over a large set of files, and at a later point I kill many such visited-file buffers. But even just `find-file-no-select' can cause visiting to modify some buffers. So when I go to kill them I need to prevent the user being queried about killing a modified buffer. I was grepping some source files to see how other code handles this kind of thing, and I came across this in org-odt.el (in `org-odt-cleanup-xml-buffers'): (mapc (lambda (file) (let ((buf (find-file-noselect (expand-file-name file org-odt-zip-dir) t))) (when (buffer-name buf) (set-buffer-modified-p nil) (kill-buffer buf)))) xml-files) I don't see how that can work properly, since `find-file-noselect' does not make the visited-file buffer current, and `set-buffer-modified-p' acts only on the current buffer. Am I missing something here, or is that a bug? In any case, I would like to learn more about this. Currently I am doing this (since this code is for Emacs 23+, which has `restore-buffer-modified-p'): (with-current-buffer buf (restore-buffer-modified-p nil) (kill-buffer buf)) Is there a way to accomplish that without making BUF current? In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600) of 2012-12-13 on ODIEONE Bzr revision: 111211 eggert@cs.ucla.edu-20121213021749-eyqqen0ewhn2hogq Windowing system distributor `Microsoft Corp.', version 5.1.2600 Configured using: `configure --with-gcc (4.7) --no-opt --enable-checking --cflags -IC:/Devel/emacs/build/include -Wall -Wextra -Wno-sign-compare -Wno-type-limits -Wno-missing-field-initializers -Wno-pointer-sign -Wdeclaration-after-statement --ldflags -LC:/Devel/emacs/build/lib' From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 23:35:37 2012 Received: (at 13197) by debbugs.gnu.org; 16 Dec 2012 04:35:37 +0000 Received: from localhost ([127.0.0.1]:44565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk5wu-0001EP-D3 for submit@debbugs.gnu.org; Sat, 15 Dec 2012 23:35:36 -0500 Received: from mail-da0-f44.google.com ([209.85.210.44]:34877) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tk5wr-0001EH-V6 for 13197@debbugs.gnu.org; Sat, 15 Dec 2012 23:35:35 -0500 Received: by mail-da0-f44.google.com with SMTP id z20so2140473dae.3 for <13197@debbugs.gnu.org>; Sat, 15 Dec 2012 20:34:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=kzZQ1ZjM6M4V9ylTyVH32CdzbLYa4hnut9fn1LmJ95s=; b=K3u6P4n4oP6uc5YKWu6M32M4d+o0HjD/eWLEiRzAFC5hKHGTvhsAMvGgVEIpyb+Pbz 3Oq/FTQOQjkSQEn1O2xFNfbMewekDiqdkAFYQahA4P5dAKF8FTekl/TM3A2IDrjgRFN7 GQ8Ot55AB1ubW7TTBHFyJDtcEo0eYmNOjqUBHXdI2AQB/ysuqs0n2SkE+3YM7yI2xNii dxNT54EIW4IddhaI/kK1tiqQI0Gk8PoUXIXnN2QZ8BWkSwJ2uVbDaxWMsNhU7BO53DIc ugPKR4FzO2Ur98dl+UgpOY6pzuf8z98PlfsT+bfhq0e4DNVfAwk7OX63snvYkIxlJHK5 1xyw== Received: by 10.66.80.68 with SMTP id p4mr30211924pax.35.1355632465793; Sat, 15 Dec 2012 20:34:25 -0800 (PST) Received: from debian-6.05 ([115.241.20.200]) by mx.google.com with ESMTPS id kl3sm5758147pbc.15.2012.12.15.20.34.22 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2012 20:34:25 -0800 (PST) From: Jambunathan K To: "Drew Adams" Subject: Re: bug#13197: 24.3.50; org-odt.el code that kills modified buffers References: Date: Sun, 16 Dec 2012 10:07:29 +0530 In-Reply-To: (Drew Adams's message of "Sat, 15 Dec 2012 14:35:45 -0800") Message-ID: <87a9te629i.fsf@gmail.com> 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.1 (/) X-Debbugs-Envelope-To: 13197 Cc: 13197@debbugs.gnu.org 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: 0.1 (/) "Drew Adams" writes: > I was grepping some source files to see how other code handles this kind > of thing, and I came across this in org-odt.el (in > `org-odt-cleanup-xml-buffers'): > > (mapc (lambda (file) > (let ((buf (find-file-noselect > (expand-file-name file org-odt-zip-dir) t))) > (when (buffer-name buf) > (set-buffer-modified-p nil) > (kill-buffer buf)))) > xml-files) > > I don't see how that can work properly, since `find-file-noselect' does > not make the visited-file buffer current, and `set-buffer-modified-p' > acts only on the current buffer. > > Am I missing something here, or is that a bug? It looks like a slip on my part. In all other places in org-odt.el, I do (with-current-buffer (find-file-noselect ) ) When an error is thrown during the export process, the buffer will be in modified but unsaved state. I forcibly mark the buffer as modified before killing it. Let me put in a fix in Org repo. Next merge will take care of this issue. -- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 16 18:16:47 2012 Received: (at 13197) by debbugs.gnu.org; 16 Dec 2012 23:16:47 +0000 Received: from localhost ([127.0.0.1]:45769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkNRv-00034u-30 for submit@debbugs.gnu.org; Sun, 16 Dec 2012 18:16:47 -0500 Received: from mail-wg0-f48.google.com ([74.125.82.48]:38907) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TkNRs-00034k-4C for 13197@debbugs.gnu.org; Sun, 16 Dec 2012 18:16:45 -0500 Received: by mail-wg0-f48.google.com with SMTP id dt10so2292557wgb.15 for <13197@debbugs.gnu.org>; Sun, 16 Dec 2012 15:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=XCwcD+nres4Ho3iyBcdJCR99IGwgBS3Athr6mISaTYI=; b=lLLkq1it3BUar4Nr2N9fxiZG4xeOPdU5Z0Wnae4ooF8uWZeyXad+yj7xAGkgewGQX8 tEH/xrPx/Rz0LcOWjMqKD1OHvztAzabE6YVw4x5femKiMIMFQh7N1BY0N64nRQzSuYZZ FHOLdzlRcl3BUATwZBeDfIOYVfuPcKuhtB+Zeub8HfDqLoYKk4+aTBqFGwxyOSdk8IP9 9HVoEm5dKSgUjQWx2Ku0trgA9tltN0lhMjEM6FHXoMgs93lbWGjwdHP2y1jUG6VI5pHr v/HA18L8dbgL8YOcK6+jc3yHctH3TEkSHfwxXXZu+pLnmVL5uJ1lRlxTFnE+oM0kT/38 DyFg== Received: by 10.180.24.199 with SMTP id w7mr12553921wif.5.1355699731585; Sun, 16 Dec 2012 15:15:31 -0800 (PST) Received: from bzg.localdomain (mar75-2-81-56-68-112.fbx.proxad.net. [81.56.68.112]) by mx.google.com with ESMTPS id s16sm3408044wii.0.2012.12.16.15.15.25 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Dec 2012 15:15:25 -0800 (PST) Received: by bzg.localdomain (Postfix, from userid 1000) id 2437822425; Mon, 17 Dec 2012 00:15:27 +0100 (CET) From: Bastien To: Jambunathan K Subject: Re: bug#13197: 24.3.50; org-odt.el code that kills modified buffers In-Reply-To: <87a9te629i.fsf@gmail.com> (Jambunathan K.'s message of "Sun, 16 Dec 2012 10:07:29 +0530") References: <87a9te629i.fsf@gmail.com> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) Date: Mon, 17 Dec 2012 00:15:27 +0100 Message-ID: <874njlr3lc.fsf@bzg.ath.cx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13197 Cc: 13197@debbugs.gnu.org, Drew Adams 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: -2.6 (--) Hi Jambunathan, Jambunathan K writes: > Let me put in a fix in Org repo. thanks for taking care of this in Org's repo. Let me know if you're with sending a patch to the mailing list or if you plan to contribute back and want push access. Best, -- Bastien From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 20 10:07:34 2012 Received: (at 13197-done) by debbugs.gnu.org; 20 Dec 2012 15:07:34 +0000 Received: from localhost ([127.0.0.1]:52716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tlhif-0000Yk-0f for submit@debbugs.gnu.org; Thu, 20 Dec 2012 10:07:34 -0500 Received: from mail-wg0-f50.google.com ([74.125.82.50]:57357) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tlhib-0000Yc-Vk for 13197-done@debbugs.gnu.org; Thu, 20 Dec 2012 10:07:31 -0500 Received: by mail-wg0-f50.google.com with SMTP id es5so1596563wgb.5 for <13197-done@debbugs.gnu.org>; Thu, 20 Dec 2012 07:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=3sfxwASWY/BG79Vw/mwNKIS4iCCDlStY2x9/KKI0S+s=; b=a9eBj6lhkGwW6GvOdHyHDX14LXCWf+GVWqxzaHrC77BIwnr6RYUvJ6Hzw1UguUKkqs unAypq/QpVAlm4TJgAPylJGs1+uTn1qXYUZ6IY7mR39cVEXTaMsG35WXIIZUI8fO6yxE RFGs8fjZ4U0P4DwLEpDzObPudp2Rm2FAEfAfTPHVT65cikYWIIjuQ2VWnUa6qqrRo7vj hEb7VqBkUwcaxSCQfqEebIFsj405W06WyB/CsZIbNHkVIY9EEzPYLm5SHAX7TuB1l2hb Ud3/sWJTsh+SKF3tpWXsW+pujHypDJMBWgglsSNpPmuq9NE4IZQUIlVX6GH5S3pk8x/3 Zw8g== X-Received: by 10.180.95.135 with SMTP id dk7mr10481588wib.29.1356016038363; Thu, 20 Dec 2012 07:07:18 -0800 (PST) Received: from bzg.localdomain (62-193-54-78.stella-net.net. [62.193.54.78]) by mx.google.com with ESMTPS id s10sm13509378wiw.4.2012.12.20.07.07.17 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Dec 2012 07:07:17 -0800 (PST) Received: by bzg.localdomain (Postfix, from userid 1000) id 947BC1C20D20; Thu, 20 Dec 2012 16:07:16 +0100 (CET) From: Bastien To: Jambunathan K Subject: Re: bug#13197: 24.3.50; org-odt.el code that kills modified buffers In-Reply-To: <874njlr3lc.fsf@bzg.ath.cx> (Bastien's message of "Mon, 17 Dec 2012 00:15:27 +0100") References: <87a9te629i.fsf@gmail.com> <874njlr3lc.fsf@bzg.ath.cx> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) Date: Thu, 20 Dec 2012 16:07:16 +0100 Message-ID: <87wqwcn4nv.fsf@bzg.ath.cx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13197-done Cc: 13197-done@debbugs.gnu.org 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: -2.6 (--) Hi Drew and Jambunathan, Bastien writes: > thanks for taking care of this in Org's repo. I've taken care of it in Org's maint branch, it will be part of the next merge with the emacs-24 branch. Thanks, -- Bastien From unknown Sat Jun 21 12:12:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 18 Jan 2013 12:24:04 +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