Last major edit (later minor edits)
Changed:
< ;;; diff+.el --- Extensions to `diff.el' for Emacs 21.
to
> ;;; diff+.el --- Extensions to `diff.el' for Emacs 21 and later.
Changed:
< ;; Last-Updated: Fri Jan 15 12:50:25 2010 (-0800)
to
> ;; Last-Updated: Sun Dec 19 09:36:11 2010 (-0800)
Changed:
< ;; Update #: 559
to
> ;; Update #: 569
Changed:
< ;; Extensions to `diff.el' for Emacs 21.
to
> ;; Extensions to `diff.el' for Emacs 21 and later.
Changed:
< ;; For extensions to `diff.el' that work with Emacs versions prior to
< ;; version 21, see library `diff+20.el'.
to
> ;; For extensions to `diff.el' that work with Emacs 20, see library
> ;; `diff+20.el'.
Changed:
< ;; For extensions to `diff' highlighting in Emacs 21, see library
< ;; `diff-mode-.el'.
to
> ;; For extensions to `diff' highlighting in Emacs 21 and later, see
> ;; library `diff-mode-.el'.
Changed:
< ;; `diff-sentinel' - Fits frame to *Diff* buffer.
to
> ;; `diff-sentinel' - Works with multiple Emacs versions.
> ;; Fits frame to *Diff* buffer.
Added:
> ;; 2010/12/19 dadams
> ;; diff-sentinel: Updated for > Emacs 23.2.
Added:
> ;; Quiet the byte-compiler.
> (defvar diff-old-temp-file)
> (defvar diff-new-temp-file)
Changed:
< ;; Selects *Diff* buffer's window and calls `fit-frame-if-one-window' at end.
to
> ;;
> ;; 1. Selects *Diff* buffer's window and calls `fit-frame-if-one-window' at end.
> ;; 2. Handles Emacs 22 and later. (Emacs 23.3 added the optional args.)
Changed:
< (defun diff-sentinel (code)
to
> (defun diff-sentinel (code &optional old-temp-file new-temp-file)
Changed:
< (if diff-old-temp-file (delete-file diff-old-temp-file))
< (if diff-new-temp-file (delete-file diff-new-temp-file))
to
> (cond ((or (> emacs-major-version 23)
> (and (= emacs-major-version 23) (> emacs-minor-version 2)))
> (when old-temp-file (delete-file old-temp-file))
> (when new-temp-file (delete-file new-temp-file)))
> (t
> (when diff-old-temp-file (delete-file diff-old-temp-file))
> (when diff-new-temp-file (delete-file diff-new-temp-file))))
;;; diff+.el --- Extensions to `diff.el' for Emacs 21 and later. ;; ;; Filename: diff+.el ;; Description: Extensions to `diff.el'. ;; Author: Drew Adams ;; Maintainer: Drew Adams ;; Copyright (C) 1996-2013, Drew Adams, all rights reserved. ;; Created: Fri Mar 15 09:33:29 1996 ;; Version: 21.0 ;; Last-Updated: Fri Dec 28 09:28:32 2012 (-0800) ;; By: dradams ;; Update #: 576 ;; URL: http://www.emacswiki.org/diff+.el ;; Doc URL: http://emacswiki.org/DiffEnhancements ;; Keywords: data, matching, tools, unix, local ;; Compatibility: GNU Emacs: 21.x, 22.x, 23.x, 24.x ;; ;; Features that might be required by this library: ;; ;; None ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Commentary: ;; ;; Extensions to `diff.el' for Emacs 21 and later. ;; The frame is resized to fit buffer "*Diff*". ;; ;; Library `diff.el' changed significantly from Emacs 20 to Emacs 21. ;; For extensions to `diff.el' that work with Emacs 20, see library ;; `diff+20.el'. ;; ;; For extensions to `diff' highlighting in Emacs 21 and later, see ;; library `diff-mode-.el'. ;; ;; ;; ***** NOTE: The following function defined in `diff.el' has ;; been REDEFINED HERE: ;; ;; `diff-sentinel' - Works with multiple Emacs versions. ;; Fits frame to *Diff* buffer. ;; ;; ;; This file should be loaded *after* loading the standard GNU file ;; `diff.el'. So, in your `~/.emacs' file, do this: ;; ;; (eval-after-load "diff" '(require 'diff+)) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Change Log: ;; ;; 2010/12/19 dadams ;; diff-sentinel: Updated for > Emacs 23.2. ;; 2004/11/18 dadams ;; Wrapped diff-sentinel body in conditon-case. ;; 2004/11/09 dadams ;; New for Emacs 21. Renamed previous library diff+.el to diff+20.el. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth ;; Floor, Boston, MA 02110-1301, USA. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Code: ;; Quiet the byte-compiler. (defvar diff-old-temp-file) (defvar diff-new-temp-file) ;;;;;;;;;;;;;;;;;;;;;;;; ;; REPLACES version in `diff.el'. ;; ;; 1. Selects *Diff* buffer's window and calls `fit-frame-if-one-window' at end. ;; 2. Handles Emacs 22 and later. (Emacs 23.3 added the optional args.) ;; (when (>= emacs-major-version 21) (defun diff-sentinel (code &optional old-temp-file new-temp-file) "Code run when the diff process exits. CODE is the exit code of the process. It should be 0 iff no diffs were found." (condition-case nil (progn (cond ((or (> emacs-major-version 23) (and (= emacs-major-version 23) (> emacs-minor-version 2))) (when old-temp-file (delete-file old-temp-file)) (when new-temp-file (delete-file new-temp-file))) (t (when diff-old-temp-file (delete-file diff-old-temp-file)) (when diff-new-temp-file (delete-file diff-new-temp-file)))) (save-excursion (save-window-excursion (select-window (get-buffer-window (current-buffer) t)) (goto-char (point-max)) (insert (format "\nDiff finished%s. %s\n" (if (equal 0 code) " (no differences)" "") (current-time-string))) (when (fboundp 'fit-frame-if-one-window) (fit-frame-if-one-window))))) (error nil)))) ;;;;;;;;;;;;;;;;;;;;;;; (provide 'diff+) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; diff+.el ends here