From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: bug#8219: Effect of deletions on indirect buffers (Bug#8219) Date: Sun, 13 Mar 2011 12:30:59 -0400 Message-ID: References: <877hc5bfqy.fsf@stupidchicken.com> <838vwlto85.fsf@gnu.org> <83wrk4soee.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1300033873 10785 80.91.229.12 (13 Mar 2011 16:31:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 13 Mar 2011 16:31:13 +0000 (UTC) Cc: Eli Zaretskii , 8219@debbugs.gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 13 17:31:07 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PyoCA-00054H-31 for ged-emacs-devel@m.gmane.org; Sun, 13 Mar 2011 17:31:06 +0100 Original-Received: from localhost ([127.0.0.1]:43704 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PyoC9-0000S0-Kg for ged-emacs-devel@m.gmane.org; Sun, 13 Mar 2011 12:31:05 -0400 Original-Received: from [140.186.70.92] (port=52739 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PyoC5-0000Rv-CF for emacs-devel@gnu.org; Sun, 13 Mar 2011 12:31:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PyoC4-0004kc-5T for emacs-devel@gnu.org; Sun, 13 Mar 2011 12:31:01 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:47660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PyoC4-0004kY-2Y for emacs-devel@gnu.org; Sun, 13 Mar 2011 12:31:00 -0400 Original-Received: from cyd by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1PyoC3-0005lc-Gn; Sun, 13 Mar 2011 12:30:59 -0400 In-Reply-To: (Stefan Monnier's message of "Sat, 12 Mar 2011 15:47:05 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:137191 Archived-At: Stefan Monnier writes: > Yes. At least that was my conclusion last time we bumped into such > a bug. I even added a comment in buffer.h about it: > > /* !!!FIXME: all the BUF_BEGV/BUF_ZV/BUF_PT macros are flawed: > on indirect (or base) buffers, that value is only correct if that buffer > is the current_buffer, or if the buffer's text hasn't been modified (via > an indirect buffer) since it was last current. */ I think we should do away with the BUF_BEGV and related macros. Let the code in buffer.c manipulate the buffer->begv members directly; and the usage in other parts of Emacs can be replaced with buf_begv() functions that will update begv if necessary, and return the corrected result.