From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#8463: 24.0.50; [PATCH] Direct Edit in *Occur* Buffer Date: Sat, 28 May 2011 19:05:01 -0400 Message-ID: <87pqn2xw82.fsf@stupidchicken.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306623971 7939 80.91.229.12 (28 May 2011 23:06:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 28 May 2011 23:06:11 +0000 (UTC) Cc: 8463@debbugs.gnu.org, Daniel Colascione To: Leo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 29 01:06:07 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QQSa6-00045A-Vs for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 May 2011 01:06:07 +0200 Original-Received: from localhost ([::1]:46233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQSa6-0001BP-A2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 May 2011 19:06:06 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQSa3-0001AE-7Z for bug-gnu-emacs@gnu.org; Sat, 28 May 2011 19:06:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQSa2-0005My-EA for bug-gnu-emacs@gnu.org; Sat, 28 May 2011 19:06:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQSa2-0005Mp-CD for bug-gnu-emacs@gnu.org; Sat, 28 May 2011 19:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QQSa1-0001ki-Uy; Sat, 28 May 2011 19:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 May 2011 23:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8463 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 8463-submit@debbugs.gnu.org id=B8463.13066239106664 (code B ref 8463); Sat, 28 May 2011 23:06:01 +0000 Original-Received: (at 8463) by debbugs.gnu.org; 28 May 2011 23:05:10 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QQSZC-0001jQ-52 for submit@debbugs.gnu.org; Sat, 28 May 2011 19:05:10 -0400 Original-Received: from vm-emlprdomr-04.its.yale.edu ([130.132.50.145]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QQSZA-0001jF-3v for 8463@debbugs.gnu.org; Sat, 28 May 2011 19:05:08 -0400 Original-Received: from furball (c-71-192-165-84.hsd1.ct.comcast.net [71.192.165.84]) (authenticated bits=0) by vm-emlprdomr-04.its.yale.edu (8.14.4/8.14.4) with ESMTP id p4SN52oA030906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 28 May 2011 19:05:02 -0400 Original-Received: by furball (Postfix, from userid 1000) id 3694E16031F; Sat, 28 May 2011 19:05:01 -0400 (EDT) In-Reply-To: (Leo's message of "Sun, 10 Apr 2011 16:14:53 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.145 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 28 May 2011 19:06:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46767 Archived-At: Leo writes: > I have extended the occur feature in Emacs to allow direct editing in > the *Occur* buffer by propagating the changes to the original buffers. > > With the attached preliminary patch, one can press `C-x C-q' or `C-c > C-c' to enter occur-edit-mode and start editing. Pressing `C-x C-q' or > `C-c C-c' again finishes the edit. > > Comments are highly welcomed. Thanks in advance. Looks good. I've made a couple of tweaks, and have committed it to trunk. The C-c c-c binding was removed in favor of just C-x C-q, as Stefan suggested. For now, I also left out the part where C-x C-q in Occur Edit mode saves the associated buffers, because this doesn't seem to be properly thought out; what if the buffers have no associated files? Also, I added a small fix to occur-after-change-function to avoid screwing up the Occur Edit buffer when multi-line text is inserted. Since we can't create new Occur entries, this just ignores everything after the inserted newline. If you want to try and handle this properly (i.e. by inserting a new Occur entry for each inserted line), go ahead.