2019-06-21 05:16:54 +00:00
|
|
|
;;; ediff-vers.el --- version control interface to Ediff -*- lexical-binding:t -*-
|
1996-01-20 05:32:51 +00:00
|
|
|
|
2019-01-01 00:59:58 +00:00
|
|
|
;; Copyright (C) 1995-1997, 2001-2019 Free Software Foundation, Inc.
|
1996-01-20 05:32:51 +00:00
|
|
|
|
2002-01-07 Michael Kifer <kifer@cs.stonybrook.edu>
* viper-init.el (viper-cond-compile-for-xemacs-or-emacs):
new macro that replaces viper-emacs-p and viper-xemacs-p in many
cases. Used to reduce the number of warnings.
* viper-cmd.el: use viper-cond-compile-for-xemacs-or-emacs.
(viper-standard-value): moved here from viper.el.
(viper-set-unread-command-events): moved to viper-util.el
(viper-check-minibuffer-overlay): make sure
viper-minibuffer-overlay is moved to cover the entire input field.
* viper-util.el: use viper-cond-compile-for-xemacs-or-emacs.
(viper-read-key-sequence, viper-set-unread-command-events,
viper-char-symbol-sequence-p, viper-char-array-p): moved here.
* viper-ex.el: use viper-cond-compile-for-xemacs-or-emacs.
* viper-keym.el: use viper-cond-compile-for-xemacs-or-emacs.
* viper-mous.el: use viper-cond-compile-for-xemacs-or-emacs.
* viper-macs.el (viper-char-array-p, viper-char-symbol-sequence-p,
viper-event-vector-p): moved to viper-util.el
* viper.el (viper-standard-value): moved to viper-cmd.el.
Use viper-cond-compile-for-xemacs-or-emacs.
* ediff-help.el: use ediff-cond-compile-for-xemacs-or-emacs.
* ediff-hook.el: use ediff-cond-compile-for-xemacs-or-emacs.
* ediff-init.el (ediff-cond-compile-for-xemacs-or-emacs): new
macro designed to be used in many places where ediff-emacs-p or
ediff-xemacs-p was previously used. Reduces the number of
warnings.
Use ediff-cond-compile-for-xemacs-or-emacs in many places in lieue
of ediff-xemacs-p.
(ediff-make-current-diff-overlay, ediff-highlight-diff-in-one-buffer,
ediff-convert-fine-diffs-to-overlays, ediff-empty-diff-region-p,
ediff-whitespace-diff-region-p, ediff-get-region-contents):
moved to ediff-util.el.
(ediff-event-key): moved here.
* ediff-merge.el: got rid of unreferenced variables.
* ediff-mult.el: use ediff-cond-compile-for-xemacs-or-emacs.
* ediff-util.el: use ediff-cond-compile-for-xemacs-or-emacs.
(ediff-cleanup-mess): improved the way windows are set up after
quitting ediff.
(ediff-janitor): use ediff-dispose-of-variant-according-to-user.
(ediff-dispose-of-variant-according-to-user): new function
designed to be smarter and also understands indirect buffers.
(ediff-highlight-diff-in-one-buffer,
ediff-unhighlight-diff-in-one-buffer,
ediff-unhighlight-diffs-totally-in-one-buffer,
ediff-highlight-diff, ediff-highlight-diff,
ediff-unhighlight-diff, ediff-unhighlight-diffs-totally,
ediff-empty-diff-region-p, ediff-whitespace-diff-region-p,
ediff-get-region-contents, ediff-make-current-diff-overlay):
moved here.
(ediff-format-bindings-of): new function by Hannu Koivisto
<azure@iki.fi>.
(ediff-setup): make sure the merge buffer is always widened and
modifiable.
(ediff-write-merge-buffer-and-maybe-kill): refuse to write the
result of a merge into a file visited by another buffer.
(ediff-arrange-autosave-in-merge-jobs): check if the merge file
is visited by another buffer and ask to save/delete that buffer.
(ediff-verify-file-merge-buffer): new function to do the above.
* ediff-vers.el: load ediff-init.el at compile time.
* ediff-wind.el: use ediff-cond-compile-for-xemacs-or-emacs.
* ediff.el (ediff-windows, ediff-regions-wordwise,
ediff-regions-linewise): use indirect buffers to improve
robustness and make it possible to compare regions of the same
buffer (even overlapping regions).
(ediff-clone-buffer-for-region-comparison,
ediff-clone-buffer-for-window-comparison): new functions.
(ediff-files-internal): refuse to compare identical files.
(ediff-regions-internal): get rid of the warning about comparing
regions of the same buffer.
* ediff-diff.el (ediff-convert-fine-diffs-to-overlays): moved here.
Plus the following fixes courtesy of Dave Love:
Doc fixes.
(ediff-word-1): Use word class and move - to the
front per regexp documentation.
(ediff-wordify): Bind forward-word-function outside loop.
(ediff-copy-to-buffer): Use insert-buffer-substring rather than
consing buffer contents.
(ediff-goto-word): Move syntax table setting outside loop.
2002-01-08 04:36:01 +00:00
|
|
|
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
|
2010-08-29 16:17:13 +00:00
|
|
|
;; Package: ediff
|
1996-01-20 05:32:51 +00:00
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 08:06:51 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1996-01-20 05:32:51 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 08:06:51 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
1996-01-20 05:32:51 +00:00
|
|
|
|
|
|
|
;; GNU Emacs 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
|
2017-09-13 22:52:52 +00:00
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
1996-01-20 05:32:51 +00:00
|
|
|
|
2001-07-16 07:46:48 +00:00
|
|
|
;;; Commentary:
|
1996-01-20 05:32:51 +00:00
|
|
|
|
|
|
|
;;; Code:
|
1996-06-22 01:54:34 +00:00
|
|
|
|
|
|
|
;; Compiler pacifier
|
|
|
|
(defvar rcs-default-co-switches)
|
|
|
|
|
1996-09-20 01:10:05 +00:00
|
|
|
(and noninteractive
|
|
|
|
(eval-when-compile
|
2008-04-06 19:26:02 +00:00
|
|
|
(condition-case nil
|
|
|
|
;; for compatibility with current stable version of xemacs
|
|
|
|
(progn
|
|
|
|
;;(require 'pcvs nil 'noerror)
|
|
|
|
;;(require 'rcs nil 'noerror)
|
|
|
|
(require 'pcvs)
|
|
|
|
(require 'rcs))
|
|
|
|
(error nil))
|
2008-04-04 07:51:27 +00:00
|
|
|
(require 'vc)
|
|
|
|
(require 'ediff-init)
|
|
|
|
))
|
1996-06-22 01:54:34 +00:00
|
|
|
;; end pacifier
|
2003-02-04 11:26:42 +00:00
|
|
|
|
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
* viper-cmd.el (viper-special-read-and-insert-char): use
read-key-sequence.
(viper-after-change-undo-hook): enhancements.
(viper-after-change-undo-hook): new hook.
(viper-undo): use viper-after-change-undo-hook.
(viper-add-newline-at-eob-if-necessary): widen before making changes.
(viper-next-line-at-bol): If point is on a widget or a button, simulate
clicking on that widget/button.
* viper.el (viper-mode): allow for a separate cursor color in Emacs
state.
* ediff-diff (ediff-test-patch-utility): catch errors.
(ediff-actual-diff-options, ediff-actual-diff3-options): new variables.
(ediff-set-actual-diff-options): new function.
(ediff-reset-diff-options, ediff-toggle-ignore-case):
use ediff-set-actual-diff-options.
(ediff-extract-diffs): catch errors.
(ediff-whitespace): add nonbreakable space.
(ediff-same-file-contents): catch errors.
* ediff-mult.el (ediff-collect-custom-diffs): save
coding-system-for-read.
* ediff-vers.el (ediff-keep-tmp-versions): new var.
(ediff-vc-internal, ediff-vc-merge-internal): use
ediff-delete-version-file.
(ediff-delete-version-file): new function.
* ediff-wind.el (ediff-control-frame-parameters): set frame fringes.
* ediff.el (ediff-directories, ediff-directory-revisions,
ediff-merge-directories, ediff-merge-directories-with-ancestor,
ediff-directories-internal, ediff-merge-directory-revisions,
ediff-merge-directory-revisions-with-ancestor,
ediff-directories3): use read-directory-name.
2006-06-18 17:08:24 +00:00
|
|
|
(defcustom ediff-keep-tmp-versions nil
|
2008-12-03 05:48:14 +00:00
|
|
|
"If t, do not delete temporary previous versions for the files on which
|
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
* viper-cmd.el (viper-special-read-and-insert-char): use
read-key-sequence.
(viper-after-change-undo-hook): enhancements.
(viper-after-change-undo-hook): new hook.
(viper-undo): use viper-after-change-undo-hook.
(viper-add-newline-at-eob-if-necessary): widen before making changes.
(viper-next-line-at-bol): If point is on a widget or a button, simulate
clicking on that widget/button.
* viper.el (viper-mode): allow for a separate cursor color in Emacs
state.
* ediff-diff (ediff-test-patch-utility): catch errors.
(ediff-actual-diff-options, ediff-actual-diff3-options): new variables.
(ediff-set-actual-diff-options): new function.
(ediff-reset-diff-options, ediff-toggle-ignore-case):
use ediff-set-actual-diff-options.
(ediff-extract-diffs): catch errors.
(ediff-whitespace): add nonbreakable space.
(ediff-same-file-contents): catch errors.
* ediff-mult.el (ediff-collect-custom-diffs): save
coding-system-for-read.
* ediff-vers.el (ediff-keep-tmp-versions): new var.
(ediff-vc-internal, ediff-vc-merge-internal): use
ediff-delete-version-file.
(ediff-delete-version-file): new function.
* ediff-wind.el (ediff-control-frame-parameters): set frame fringes.
* ediff.el (ediff-directories, ediff-directory-revisions,
ediff-merge-directories, ediff-merge-directories-with-ancestor,
ediff-directories-internal, ediff-merge-directory-revisions,
ediff-merge-directory-revisions-with-ancestor,
ediff-directories3): use read-directory-name.
2006-06-18 17:08:24 +00:00
|
|
|
comparison or merge operations are being performed."
|
|
|
|
:type 'boolean
|
|
|
|
:group 'ediff-vers
|
|
|
|
)
|
|
|
|
|
2007-11-02 06:03:12 +00:00
|
|
|
(defalias 'ediff-vc-revision-other-window
|
|
|
|
(if (fboundp 'vc-revision-other-window)
|
|
|
|
'vc-revision-other-window
|
|
|
|
'vc-version-other-window))
|
|
|
|
|
|
|
|
(defalias 'ediff-vc-working-revision
|
|
|
|
(if (fboundp 'vc-working-revision)
|
|
|
|
'vc-working-revision
|
2007-11-02 15:24:29 +00:00
|
|
|
'vc-workfile-version))
|
2007-11-02 06:03:12 +00:00
|
|
|
|
1996-01-20 05:32:51 +00:00
|
|
|
;; VC.el support
|
2003-01-25 08:09:16 +00:00
|
|
|
|
2007-11-02 06:03:12 +00:00
|
|
|
(eval-when-compile
|
|
|
|
(require 'vc-hooks)) ;; for vc-call macro
|
|
|
|
|
|
|
|
|
2003-01-25 08:09:16 +00:00
|
|
|
(defun ediff-vc-latest-version (file)
|
|
|
|
"Return the version level of the latest version of FILE in repository."
|
|
|
|
(if (fboundp 'vc-latest-version)
|
|
|
|
(vc-latest-version file)
|
2009-05-23 12:46:55 +00:00
|
|
|
(or (vc-file-getprop file 'vc-latest-revision)
|
2003-01-25 08:09:16 +00:00
|
|
|
(cond ((vc-backend file)
|
|
|
|
(vc-call state file)
|
2009-05-23 12:46:55 +00:00
|
|
|
(vc-file-getprop file 'vc-latest-revision))
|
2003-01-25 08:09:16 +00:00
|
|
|
(t (error "File %s is not under version control" file))))
|
|
|
|
))
|
|
|
|
|
|
|
|
|
1996-09-20 01:10:05 +00:00
|
|
|
(defun ediff-vc-internal (rev1 rev2 &optional startup-hooks)
|
2003-01-25 08:09:16 +00:00
|
|
|
;; Run Ediff on versions of the current buffer.
|
|
|
|
;; If REV1 is "", use the latest version of the current buffer's file.
|
|
|
|
;; If REV2 is "" then compare current buffer with REV1.
|
|
|
|
;; If the current buffer is named `F', the version is named `F.~REV~'.
|
|
|
|
;; If `F.~REV~' already exists, it is used instead of being re-created.
|
1996-01-20 05:32:51 +00:00
|
|
|
(let (file1 file2 rev1buf rev2buf)
|
2003-02-04 11:26:42 +00:00
|
|
|
(if (string= rev1 "")
|
2003-01-25 08:09:16 +00:00
|
|
|
(setq rev1 (ediff-vc-latest-version (buffer-file-name))))
|
2000-10-29 04:56:45 +00:00
|
|
|
(save-window-excursion
|
|
|
|
(save-excursion
|
2007-11-02 06:03:12 +00:00
|
|
|
(ediff-vc-revision-other-window rev1)
|
2000-10-29 04:56:45 +00:00
|
|
|
(setq rev1buf (current-buffer)
|
|
|
|
file1 (buffer-file-name)))
|
|
|
|
(save-excursion
|
|
|
|
(or (string= rev2 "") ; use current buffer
|
2007-11-02 06:03:12 +00:00
|
|
|
(ediff-vc-revision-other-window rev2))
|
2000-10-29 04:56:45 +00:00
|
|
|
(setq rev2buf (current-buffer)
|
|
|
|
file2 (buffer-file-name)))
|
2019-06-21 05:16:54 +00:00
|
|
|
(push (lambda ()
|
|
|
|
(ediff-delete-version-file file1)
|
|
|
|
(or (string= rev2 "") (ediff-delete-version-file file2)))
|
|
|
|
startup-hooks))
|
1996-01-20 05:32:51 +00:00
|
|
|
(ediff-buffers
|
|
|
|
rev1buf rev2buf
|
|
|
|
startup-hooks
|
|
|
|
'ediff-revision)))
|
2003-02-04 11:26:42 +00:00
|
|
|
|
1996-01-20 05:32:51 +00:00
|
|
|
;; RCS.el support
|
|
|
|
(defun rcs-ediff-view-revision (&optional rev)
|
|
|
|
;; View previous RCS revision of current file.
|
|
|
|
;; With prefix argument, prompts for a revision name.
|
2003-02-04 11:26:42 +00:00
|
|
|
(interactive (list (if current-prefix-arg
|
1996-01-20 05:32:51 +00:00
|
|
|
(read-string "Revision: "))))
|
|
|
|
(let* ((filename (buffer-file-name (current-buffer)))
|
|
|
|
(switches (append '("-p")
|
|
|
|
(if rev (list (concat "-r" rev)) nil)))
|
|
|
|
(buff (concat (file-name-nondirectory filename) ".~" rev "~")))
|
|
|
|
(message "Working ...")
|
|
|
|
(setq filename (expand-file-name filename))
|
|
|
|
(with-output-to-temp-buffer buff
|
2000-11-10 22:34:55 +00:00
|
|
|
(ediff-with-current-buffer standard-output
|
|
|
|
(fundamental-mode))
|
1996-01-20 05:32:51 +00:00
|
|
|
(let ((output-buffer (ediff-rcs-get-output-buffer filename buff)))
|
|
|
|
(delete-windows-on output-buffer)
|
* x-dnd.el (x-dnd-maybe-call-test-function):
* window.el (split-window-vertically):
* whitespace.el (whitespace-help-on):
* vc-rcs.el (vc-rcs-consult-headers):
* userlock.el (ask-user-about-lock-help)
(ask-user-about-supersession-help):
* type-break.el (type-break-force-mode-line-update):
* time-stamp.el (time-stamp-conv-warn):
* terminal.el (te-set-output-log, te-more-break, te-filter)
(te-sentinel,terminal-emulator):
* term.el (make-term, term-exec, term-sentinel, term-read-input-ring)
(term-write-input-ring, term-check-source, term-start-output-log):
(term-display-buffer-line, term-dynamic-list-completions):
(term-ansi-make-term, serial-term):
* subr.el (selective-display):
* strokes.el (strokes-xpm-to-compressed-string, strokes-decode-buffer)
(strokes-encode-buffer, strokes-xpm-for-compressed-string):
* speedbar.el (speedbar-buffers-tail-notes, speedbar-buffers-item-info)
(speedbar-reconfigure-keymaps, speedbar-add-localized-speedbar-support)
(speedbar-remove-localized-speedbar-support)
(speedbar-set-mode-line-format, speedbar-create-tag-hierarchy)
(speedbar-update-special-contents, speedbar-buffer-buttons-engine)
(speedbar-buffers-line-directory):
* simple.el (shell-command-on-region, append-to-buffer)
(prepend-to-buffer):
* shadowfile.el (shadow-save-todo-file):
* scroll-bar.el (scroll-bar-set-window-start, scroll-bar-drag-1)
(scroll-bar-maybe-set-window-start):
* sb-image.el (speedbar-image-dump):
* saveplace.el (save-place-alist-to-file, save-places-to-alist)
(load-save-place-alist-from-file):
* ps-samp.el (ps-print-message-from-summary):
* ps-print.el (ps-flush-output, ps-insert-file, ps-get-boundingbox)
(ps-background-image, ps-begin-job, ps-do-despool):
* ps-bdf.el (bdf-find-file, bdf-read-font-info):
* printing.el (pr-interface, pr-ps-file-print, pr-find-buffer-visiting)
(pr-ps-message-from-summary, pr-lpr-message-from-summary):
(pr-call-process, pr-file-list, pr-interface-save):
* novice.el (disabled-command-function)
(enable-command, disable-command):
* mouse.el (mouse-buffer-menu-alist):
* mouse-copy.el (mouse-kill-preserving-secondary):
* macros.el (kbd-macro-query):
* ledit.el (ledit-go-to-lisp, ledit-go-to-liszt):
* informat.el (batch-info-validate):
* ido.el (ido-copy-current-word, ido-initiate-auto-merge):
* hippie-exp.el (try-expand-dabbrev-visible):
* help-mode.el (help-make-xrefs):
* help-fns.el (describe-variable):
* generic-x.el (bat-generic-mode-run-as-comint):
* finder.el (finder-mouse-select):
* find-dired.el (find-dired-sentinel):
* filesets.el (filesets-file-close):
* files.el (list-directory):
* faces.el (list-faces-display, describe-face):
* facemenu.el (list-colors-display):
* ezimage.el (ezimage-image-association-dump, ezimage-image-dump):
* epg.el (epg--process-filter, epg-cancel):
* epa.el (epa--marked-keys, epa--select-keys, epa-display-info)
(epa--read-signature-type):
* emerge.el (emerge-copy-as-kill-A, emerge-copy-as-kill-B)
(emerge-file-names):
* ehelp.el (electric-helpify):
* ediff.el (ediff-regions-wordwise, ediff-regions-linewise):
* ediff-vers.el (rcs-ediff-view-revision):
* ediff-util.el (ediff-setup):
* ediff-mult.el (ediff-append-custom-diff):
* ediff-diff.el (ediff-exec-process, ediff-process-sentinel)
(ediff-wordify):
* echistory.el (Electric-command-history-redo-expression):
* dos-w32.el (find-file-not-found-set-buffer-file-coding-system):
* disp-table.el (describe-display-table):
* dired.el (dired-find-buffer-nocreate):
* dired-aux.el (dired-rename-subdir, dired-dwim-target-directory):
* dabbrev.el (dabbrev--same-major-mode-p):
* chistory.el (list-command-history):
* apropos.el (apropos-documentation):
* allout.el (allout-obtain-passphrase):
(allout-copy-exposed-to-buffer):
(allout-verify-passphrase): Use with-current-buffer.
2009-11-13 22:19:45 +00:00
|
|
|
(with-current-buffer output-buffer
|
2019-06-21 05:16:54 +00:00
|
|
|
(apply #'call-process "co" nil t nil
|
1996-01-20 05:32:51 +00:00
|
|
|
;; -q: quiet (no diagnostics)
|
|
|
|
(append switches rcs-default-co-switches
|
2003-02-04 11:26:42 +00:00
|
|
|
(list "-q" filename)))))
|
1996-01-20 05:32:51 +00:00
|
|
|
(message "")
|
2003-02-04 11:26:42 +00:00
|
|
|
buff)))
|
|
|
|
|
1996-01-20 05:32:51 +00:00
|
|
|
(defun ediff-rcs-get-output-buffer (file name)
|
|
|
|
;; Get a buffer for RCS output for FILE, make it writable and clean it up.
|
|
|
|
;; Optional NAME is name to use instead of `*RCS-output*'.
|
1999-11-01 07:16:15 +00:00
|
|
|
;; This is a modified version from rcs.el v1.1. I use it here to make
|
1996-01-20 05:32:51 +00:00
|
|
|
;; Ediff immune to changes in rcs.el
|
2009-11-24 03:16:38 +00:00
|
|
|
(let ((buf (get-buffer-create name)))
|
2009-08-28 16:29:25 +00:00
|
|
|
(with-current-buffer buf
|
1996-01-20 05:32:51 +00:00
|
|
|
(setq buffer-read-only nil
|
|
|
|
default-directory (file-name-directory (expand-file-name file)))
|
|
|
|
(erase-buffer))
|
|
|
|
buf))
|
|
|
|
|
1996-09-20 01:10:05 +00:00
|
|
|
(defun ediff-rcs-internal (rev1 rev2 &optional startup-hooks)
|
1996-01-20 05:32:51 +00:00
|
|
|
;; Run Ediff on versions of the current buffer.
|
|
|
|
;; If REV2 is "" then use current buffer.
|
2000-10-29 04:56:45 +00:00
|
|
|
(let (rev2buf rev1buf)
|
|
|
|
(save-window-excursion
|
|
|
|
(setq rev2buf (if (string= rev2 "")
|
|
|
|
(current-buffer)
|
|
|
|
(rcs-ediff-view-revision rev2))
|
|
|
|
rev1buf (rcs-ediff-view-revision rev1)))
|
2003-02-04 11:26:42 +00:00
|
|
|
|
1996-01-20 05:32:51 +00:00
|
|
|
;; rcs.el doesn't create temp version files, so we don't have to delete
|
|
|
|
;; anything in startup hooks to ediff-buffers
|
|
|
|
(ediff-buffers rev1buf rev2buf startup-hooks 'ediff-revision)
|
|
|
|
))
|
|
|
|
|
|
|
|
;;; Merge with Version Control
|
|
|
|
|
2003-02-04 11:26:42 +00:00
|
|
|
(defun ediff-vc-merge-internal (rev1 rev2 ancestor-rev
|
1997-11-01 01:46:51 +00:00
|
|
|
&optional startup-hooks merge-buffer-file)
|
1996-01-20 05:32:51 +00:00
|
|
|
;; If ANCESTOR-REV non-nil, merge with ancestor
|
|
|
|
(let (buf1 buf2 ancestor-buf)
|
2000-10-29 04:56:45 +00:00
|
|
|
(save-window-excursion
|
|
|
|
(save-excursion
|
2007-11-02 06:03:12 +00:00
|
|
|
(ediff-vc-revision-other-window rev1)
|
2000-10-29 04:56:45 +00:00
|
|
|
(setq buf1 (current-buffer)))
|
|
|
|
(save-excursion
|
|
|
|
(or (string= rev2 "")
|
2007-11-02 06:03:12 +00:00
|
|
|
(ediff-vc-revision-other-window rev2))
|
2000-10-29 04:56:45 +00:00
|
|
|
(setq buf2 (current-buffer)))
|
|
|
|
(if ancestor-rev
|
|
|
|
(save-excursion
|
|
|
|
(if (string= ancestor-rev "")
|
2019-06-21 05:16:54 +00:00
|
|
|
(setq ancestor-rev (ediff-vc-working-revision
|
|
|
|
buffer-file-name)))
|
2007-11-02 06:03:12 +00:00
|
|
|
(ediff-vc-revision-other-window ancestor-rev)
|
2000-10-29 04:56:45 +00:00
|
|
|
(setq ancestor-buf (current-buffer))))
|
2019-06-21 05:16:54 +00:00
|
|
|
(push (let ((f1 (buffer-file-name buf1))
|
|
|
|
(f2 (unless (string= rev2 "") (buffer-file-name buf2)))
|
|
|
|
(fa (unless (or (string= ancestor-rev "")
|
|
|
|
(not ancestor-rev))
|
|
|
|
(buffer-file-name ancestor-buf))))
|
|
|
|
(lambda ()
|
|
|
|
(ediff-delete-version-file f1)
|
|
|
|
(if f2 (ediff-delete-version-file f2))
|
|
|
|
(if fa (ediff-delete-version-file fa))))
|
|
|
|
startup-hooks))
|
1996-01-20 05:32:51 +00:00
|
|
|
(if ancestor-rev
|
|
|
|
(ediff-merge-buffers-with-ancestor
|
|
|
|
buf1 buf2 ancestor-buf
|
1997-11-01 01:46:51 +00:00
|
|
|
startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file)
|
|
|
|
(ediff-merge-buffers
|
|
|
|
buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file))
|
1996-01-20 05:32:51 +00:00
|
|
|
))
|
|
|
|
|
1996-09-20 01:10:05 +00:00
|
|
|
(defun ediff-rcs-merge-internal (rev1 rev2 ancestor-rev
|
1997-11-01 01:46:51 +00:00
|
|
|
&optional
|
|
|
|
startup-hooks merge-buffer-file)
|
1996-01-20 05:32:51 +00:00
|
|
|
;; If ANCESTOR-REV non-nil, merge with ancestor
|
|
|
|
(let (buf1 buf2 ancestor-buf)
|
2000-10-29 04:56:45 +00:00
|
|
|
(save-window-excursion
|
|
|
|
(setq buf1 (rcs-ediff-view-revision rev1)
|
|
|
|
buf2 (if (string= rev2 "")
|
|
|
|
(current-buffer)
|
|
|
|
(rcs-ediff-view-revision rev2))
|
|
|
|
ancestor-buf (if ancestor-rev
|
|
|
|
(if (string= ancestor-rev "")
|
|
|
|
(current-buffer)
|
|
|
|
(rcs-ediff-view-revision ancestor-rev)))))
|
1996-01-20 05:32:51 +00:00
|
|
|
;; rcs.el doesn't create temp version files, so we don't have to delete
|
|
|
|
;; anything in startup hooks to ediff-buffers
|
|
|
|
(if ancestor-rev
|
|
|
|
(ediff-merge-buffers-with-ancestor
|
|
|
|
buf1 buf2 ancestor-buf
|
1997-11-01 01:46:51 +00:00
|
|
|
startup-hooks 'ediff-merge-revisions-with-ancestor merge-buffer-file)
|
|
|
|
(ediff-merge-buffers
|
|
|
|
buf1 buf2 startup-hooks 'ediff-merge-revisions merge-buffer-file))))
|
1996-01-20 05:32:51 +00:00
|
|
|
|
2006-06-18 Michael Kifer <kifer@cs.stonybrook.edu>
* viper-cmd.el (viper-special-read-and-insert-char): use
read-key-sequence.
(viper-after-change-undo-hook): enhancements.
(viper-after-change-undo-hook): new hook.
(viper-undo): use viper-after-change-undo-hook.
(viper-add-newline-at-eob-if-necessary): widen before making changes.
(viper-next-line-at-bol): If point is on a widget or a button, simulate
clicking on that widget/button.
* viper.el (viper-mode): allow for a separate cursor color in Emacs
state.
* ediff-diff (ediff-test-patch-utility): catch errors.
(ediff-actual-diff-options, ediff-actual-diff3-options): new variables.
(ediff-set-actual-diff-options): new function.
(ediff-reset-diff-options, ediff-toggle-ignore-case):
use ediff-set-actual-diff-options.
(ediff-extract-diffs): catch errors.
(ediff-whitespace): add nonbreakable space.
(ediff-same-file-contents): catch errors.
* ediff-mult.el (ediff-collect-custom-diffs): save
coding-system-for-read.
* ediff-vers.el (ediff-keep-tmp-versions): new var.
(ediff-vc-internal, ediff-vc-merge-internal): use
ediff-delete-version-file.
(ediff-delete-version-file): new function.
* ediff-wind.el (ediff-control-frame-parameters): set frame fringes.
* ediff.el (ediff-directories, ediff-directory-revisions,
ediff-merge-directories, ediff-merge-directories-with-ancestor,
ediff-directories-internal, ediff-merge-directory-revisions,
ediff-merge-directory-revisions-with-ancestor,
ediff-directories3): use read-directory-name.
2006-06-18 17:08:24 +00:00
|
|
|
|
|
|
|
;; delete version file on exit unless ediff-keep-tmp-versions is true
|
|
|
|
(defun ediff-delete-version-file (file)
|
|
|
|
(or ediff-keep-tmp-versions (delete-file file)))
|
1996-01-20 05:32:51 +00:00
|
|
|
|
2005-07-10 18:46:24 +00:00
|
|
|
|
|
|
|
(provide 'ediff-vers)
|
1996-01-20 05:32:51 +00:00
|
|
|
;;; ediff-vers.el ends here
|