From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Assignment of misc packages for emacs Date: Tue, 07 May 2002 21:47:47 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200205080147.g481lmD01045@rum.cs.yale.edu> References: <200205050534.g455YfF01634@aztec.santafe.edu> <5xbsbumexh.fsf@kfs2.cua.dk> <87bsbsx4cz.fsf@emacswiki.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1020822668 21456 127.0.0.1 (8 May 2002 01:51:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 8 May 2002 01:51:08 +0000 (UTC) Cc: Alex Schroeder , emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 175Gbk-0005Zx-00 for ; Wed, 08 May 2002 03:51:08 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 175Gje-0005uN-00 for ; Wed, 08 May 2002 03:59:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 175Gbi-0004KH-00; Tue, 07 May 2002 21:51:06 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 175GZV-0004FX-00 for ; Tue, 07 May 2002 21:48:49 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g481lmD01045; Tue, 7 May 2002 21:47:48 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Miles Bader Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:3697 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3697 > Also note that `diff-mode', which is what VC diffs are `colorized' with, > also offers many useful features for manipulating diffs -- navigation, > applying/unapplying of hunks, format conversion, direction reversal, and > even sane editing of the diff file [it automatically adjusts the line > counts for you]. It's quite snazzy... > > There was some small issue that interfered with it being used for `M-x > diff' output, but my vague memory is that it was pretty trivial (my > recollection is that I thought the proper solution was to say `fuck it' > and use diff-mode anyway). I personally use the patch below but never bothered to try and make it into something good enough to install. I don't even know what is missing (if anything). I don't have it high on my todo list, so if anybody wants to see it happen, he'd better do it himself, Stefan Index: diff.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/diff.el,v retrieving revision 1.43 diff -u -r1.43 diff.el --- diff.el 11 Oct 2001 01:20:16 -0000 1.43 +++ diff.el 8 May 2002 01:44:00 -0000 @@ -91,11 +91,8 @@ ;; Don't reparse diffs already seen at last parse. (if compilation-parsing-end (goto-char compilation-parsing-end)) - ;; Construct in REGEXP a regexp composed of all those in dired-regexp-alist. - (let ((regexp (mapconcat (lambda (elt) - (concat "\\(" (car elt) "\\)")) - diff-regexp-alist - "\\|")) + ;; Construct in REGEXP a regexp composed of all those in diff-regexp-alist. + (let ((regexp (mapconcat 'car diff-regexp-alist "\\|")) ;; (GROUP-IDX OLD-IDX NEW-IDX) (groups (let ((subexpr 1)) (mapcar (lambda (elt) @@ -190,7 +187,7 @@ "Find and display the differences between OLD and NEW files. Interactively the current buffer's file name is the default for NEW and a backup file for NEW is the default for OLD. -With prefix arg, prompt for diff switches." +With prefix arg, prompt for diff SWITCHES." (interactive (nconc (let (oldf newf) @@ -247,16 +244,23 @@ "No more differences" "Diff" 'diff-parse-differences)) (set-buffer buf) + ;; Replace compilation-mode with diff-mode + compilation-minor-mode. + (diff-mode) + (compilation-shell-minor-mode -1) ;diff-mode turned it on. + (compilation-minor-mode 1) + (set (make-local-variable 'compilation-parse-errors-function) + 'diff-parse-differences) + (set (make-local-variable 'compilation-error-message) + "No more differences") + ;; Continue as if nothing had happened. (set (make-local-variable 'diff-old-file) old) (set (make-local-variable 'diff-new-file) new) (set (make-local-variable 'diff-old-temp-file) old-alt) (set (make-local-variable 'diff-new-temp-file) new-alt) (set (make-local-variable 'compilation-finish-function) - (function (lambda (buff msg) - (if diff-old-temp-file - (delete-file diff-old-temp-file)) - (if diff-new-temp-file - (delete-file diff-new-temp-file))))) + (lambda (buff msg) + (if diff-old-temp-file (delete-file diff-old-temp-file)) + (if diff-new-temp-file (delete-file diff-new-temp-file)))) ;; When async processes aren't available, the compilation finish ;; function doesn't get chance to run. Invoke it by hand. (or (fboundp 'start-process)