From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: undo weirdness with insert-file-contents Date: Sat, 08 Mar 2008 10:55:54 +0100 Message-ID: <47D262AA.10900@gmx.at> References: <47C70CFC.30203@gmx.at> <47C88A51.7020205@gmx.at> <47CAA13E.3040909@gmx.at> <47CB2498.1030405@gmx.at> <47CBC035.7030006@gmx.at> <47D10BD9.9050001@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204970208 4158 80.91.229.12 (8 Mar 2008 09:56:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Mar 2008 09:56:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 08 10:57:16 2008 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.50) id 1JXvnn-0005ey-U3 for ged-emacs-devel@m.gmane.org; Sat, 08 Mar 2008 10:57:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXvnF-0006M5-2B for ged-emacs-devel@m.gmane.org; Sat, 08 Mar 2008 04:56:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JXvms-0006Kc-Fj for emacs-devel@gnu.org; Sat, 08 Mar 2008 04:56:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JXvmr-0006KA-Fg for emacs-devel@gnu.org; Sat, 08 Mar 2008 04:56:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXvmq-0006K0-Ka for emacs-devel@gnu.org; Sat, 08 Mar 2008 04:56:16 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JXvmp-0007ay-US for emacs-devel@gnu.org; Sat, 08 Mar 2008 04:56:16 -0500 Original-Received: (qmail invoked by alias); 08 Mar 2008 09:56:11 -0000 Original-Received: from N783P008.adsl.highway.telekom.at (EHLO [62.47.41.200]) [62.47.41.200] by mail.gmx.net (mp003) with SMTP; 08 Mar 2008 10:56:11 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+UhLNkFkqUpMHWSlGiryj0x6VJPIBs26mtK4O8Bm LJjJxUJ0pZxQDs User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:91707 Archived-At: > given a 3-way merge conflict, with 3 branches MINE/BASE/OTHER, I do > a narrow-to-region on the conflict, then I save all three branches of > the conflict to separate files and do: > > diff -c -w BASE MINE | patch OTHER >RESULT > > and if the patch succeeds I do `insert-file-contents' of RESULT without > VISIT but with REPLACE. > > It's indeed somewhat obscure, and indeed, it crashed Emacs when the > Unicode branch was merged (because the code didn't expect REPLACE in > a narrowed buffer). With the MINE buffer current, I suppose, to avoid visiting RESULT, inserting it into MINE, and deleting it afterwards. As a benefit, `insert-file-contents' will preserve markers within the conflict region and store less undo information. Sounds reasonable. The examples of non-VISIT&REPLACE I've found in the Emacs sources seem rather obscure though.