;;; ediff-init.el --- Macros, variables, and defsubsts used by Ediff
;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-;; 2004, 2005 Free Software Foundation, Inc.
+;; 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
;; GNU Emacs 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)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
(boundp 'ediff-use-toolbar-p)
ediff-use-toolbar-p)) ;Does the user want it ?
-;; Defines SYMBOL as an advertised local variable.
+;; Defines VAR as an advertised local variable.
;; Performs a defvar, then executes `make-variable-buffer-local' on
;; the variable. Also sets the `permanent-local' property,
;; so that `kill-all-local-variables' (called by major-mode setting
;;
;; Plagiarised from `emerge-defvar-local' for XEmacs.
(defmacro ediff-defvar-local (var value doc)
+ "Defines VAR as a local variable."
+ (declare (indent defun))
`(progn
(defvar ,var ,value ,doc)
(make-variable-buffer-local ',var)
;; Doesn't save the point and mark.
;; This is `with-current-buffer' with the added test for live buffers."
(defmacro ediff-with-current-buffer (buffer &rest body)
+ "Evaluates BODY in BUFFER."
+ (declare (indent 1) (debug (form body)))
`(if (ediff-buffer-live-p ,buffer)
(save-current-buffer
(set-buffer ,buffer)
this-command)))
(defgroup ediff-highlighting nil
- "Hilighting of difference regions in Ediff"
+ "Hilighting of difference regions in Ediff."
:prefix "ediff-"
:group 'ediff)
(defgroup ediff-merge nil
- "Merging utilities"
+ "Merging utilities."
:prefix "ediff-"
:group 'ediff)
(defgroup ediff-hook nil
- "Hooks run by Ediff"
+ "Hooks run by Ediff."
:prefix "ediff-"
:group 'ediff)
;; Highlighting
-(defcustom ediff-before-flag-bol (if ediff-xemacs-p (make-glyph "->>") "->>")
+(defcustom ediff-before-flag-bol (if (featurep 'xemacs) (make-glyph "->>") "->>")
"*Flag placed before a highlighted block of differences, if block starts at beginning of a line."
:type 'string
:tag "Region before-flag at beginning of line"
:group 'ediff)
-(defcustom ediff-after-flag-eol (if ediff-xemacs-p (make-glyph "<<-") "<<-")
+(defcustom ediff-after-flag-eol (if (featurep 'xemacs) (make-glyph "<<-") "<<-")
"*Flag placed after a highlighted block of differences, if block ends at end of a line."
:type 'string
:tag "Region after-flag at end of line"
:group 'ediff)
-(defcustom ediff-before-flag-mol (if ediff-xemacs-p (make-glyph "->>") "->>")
+(defcustom ediff-before-flag-mol (if (featurep 'xemacs) (make-glyph "->>") "->>")
"*Flag placed before a highlighted block of differences, if block starts in mid-line."
:type 'string
:tag "Region before-flag in the middle of line"
:group 'ediff)
-(defcustom ediff-after-flag-mol (if ediff-xemacs-p (make-glyph "<<-") "<<-")
+(defcustom ediff-after-flag-mol (if (featurep 'xemacs) (make-glyph "<<-") "<<-")
"*Flag placed after a highlighted block of differences, if block ends in mid-line."
:type 'string
:tag "Region after-flag in the middle of line"
;; A-list of current-diff-face-* symbols associated with buf types
(defconst ediff-current-diff-face-alist
- '((A . ediff-current-diff-face-A)
- (B . ediff-current-diff-face-B)
- (C . ediff-current-diff-face-C)
- (Ancestor . ediff-current-diff-face-Ancestor)))
+ '((A . ediff-current-diff-A)
+ (B . ediff-current-diff-B)
+ (C . ediff-current-diff-C)
+ (Ancestor . ediff-current-diff-Ancestor)))
(defun ediff-set-overlay-face (extent face)
(t (:inverse-video t))))
"Face for highlighting the selected difference in buffer A."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-current-diff-face-A 'face-alias 'ediff-current-diff-A)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-current-diff-face-A 'ediff-current-diff-A
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-current-diff-A'
this variable represents.")
-(ediff-hide-face 'ediff-current-diff-A)
+(ediff-hide-face ediff-current-diff-face-A)
;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
;; This means that some user customization may be trashed.
(if (and ediff-xemacs-p
(ediff-has-face-support-p)
(not (ediff-color-display-p)))
- (copy-face 'modeline 'ediff-current-diff-A))
+ (copy-face 'modeline ediff-current-diff-face-A))
(t (:inverse-video t))))
"Face for highlighting the selected difference in buffer B."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-current-diff-face-B 'face-alias 'ediff-current-diff-B)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-current-diff-face-B 'ediff-current-diff-B
this variable. Instead, use the customization
widget to customize the actual face `ediff-current-diff-B'
this variable represents.")
-(ediff-hide-face 'ediff-current-diff-B)
+(ediff-hide-face ediff-current-diff-face-B)
;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
;; This means that some user customization may be trashed.
(if (and ediff-xemacs-p
(ediff-has-face-support-p)
(not (ediff-color-display-p)))
- (copy-face 'modeline 'ediff-current-diff-B))
+ (copy-face 'modeline ediff-current-diff-face-B))
(defface ediff-current-diff-C
(t (:inverse-video t))))
"Face for highlighting the selected difference in buffer C."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-current-diff-face-C 'face-alias 'ediff-current-diff-C)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-current-diff-face-C 'ediff-current-diff-C
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-current-diff-C'
this variable represents.")
-(ediff-hide-face 'ediff-current-diff-C)
+(ediff-hide-face ediff-current-diff-face-C)
;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
;; This means that some user customization may be trashed.
(if (and ediff-xemacs-p
(ediff-has-face-support-p)
(not (ediff-color-display-p)))
- (copy-face 'modeline 'ediff-current-diff-C))
+ (copy-face 'modeline ediff-current-diff-face-C))
(defface ediff-current-diff-Ancestor
(t (:inverse-video t))))
"Face for highlighting the selected difference in buffer Ancestor."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-current-diff-face-Ancestor 'face-alias 'ediff-current-diff-Ancestor)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-current-diff-face-Ancestor 'ediff-current-diff-Ancestor
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-current-diff-Ancestor'
this variable represents.")
-(ediff-hide-face 'ediff-current-diff-Ancestor)
+(ediff-hide-face ediff-current-diff-face-Ancestor)
;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
;; This means that some user customization may be trashed.
(if (and ediff-xemacs-p
(ediff-has-face-support-p)
(not (ediff-color-display-p)))
- (copy-face 'modeline 'ediff-current-diff-Ancestor))
+ (copy-face 'modeline ediff-current-diff-face-Ancestor))
(defface ediff-fine-diff-A
(t (:underline t :stipple "gray3"))))
"Face for highlighting the refinement of the selected diff in buffer A."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-fine-diff-face-A 'face-alias 'ediff-fine-diff-A)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-fine-diff-face-A 'ediff-fine-diff-A
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-fine-diff-A'
this variable represents.")
-(ediff-hide-face 'ediff-fine-diff-A)
+(ediff-hide-face ediff-fine-diff-face-A)
(defface ediff-fine-diff-B
(if ediff-emacs-p
(t (:underline t :stipple "gray3"))))
"Face for highlighting the refinement of the selected diff in buffer B."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-fine-diff-face-B 'face-alias 'ediff-fine-diff-B)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-fine-diff-face-B 'ediff-fine-diff-B
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-fine-diff-B'
this variable represents.")
-(ediff-hide-face 'ediff-fine-diff-B)
+(ediff-hide-face ediff-fine-diff-face-B)
(defface ediff-fine-diff-C
(if ediff-emacs-p
(t (:underline t :stipple "gray3"))))
"Face for highlighting the refinement of the selected diff in buffer C."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-fine-diff-face-C 'face-alias 'ediff-fine-diff-C)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-fine-diff-face-C 'ediff-fine-diff-C
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-fine-diff-C'
this variable represents.")
-(ediff-hide-face 'ediff-fine-diff-C)
+(ediff-hide-face ediff-fine-diff-face-C)
(defface ediff-fine-diff-Ancestor
(if ediff-emacs-p
At present, this face is not used and no fine differences are computed for the
ancestor buffer."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-fine-diff-face-Ancestor 'face-alias 'ediff-fine-diff-Ancestor)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-fine-diff-face-Ancestor 'ediff-fine-diff-Ancestor
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-fine-diff-Ancestor'
this variable represents.")
-(ediff-hide-face 'ediff-fine-diff-Ancestor)
+(ediff-hide-face ediff-fine-diff-face-Ancestor)
;; Some installs don't have stipple or Stipple. So, try them in turn.
(defvar stipple-pixmap
(t (:italic t :stipple ,stipple-pixmap))))
"Face for highlighting even-numbered non-current differences in buffer A."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-even-diff-face-A 'face-alias 'ediff-even-diff-A)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-even-diff-face-A 'ediff-even-diff-A
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-even-diff-A'
this variable represents.")
-(ediff-hide-face 'ediff-even-diff-A)
+(ediff-hide-face ediff-even-diff-face-A)
(defface ediff-even-diff-B
(if ediff-emacs-p
(t (:italic t :stipple ,stipple-pixmap))))
"Face for highlighting even-numbered non-current differences in buffer B."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-even-diff-face-B 'face-alias 'ediff-even-diff-B)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-even-diff-face-B 'ediff-even-diff-B
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-even-diff-B'
this variable represents.")
-(ediff-hide-face 'ediff-even-diff-B)
+(ediff-hide-face ediff-even-diff-face-B)
(defface ediff-even-diff-C
(if ediff-emacs-p
(t (:italic t :stipple ,stipple-pixmap))))
"Face for highlighting even-numbered non-current differences in buffer C."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-even-diff-face-C 'face-alias 'ediff-even-diff-C)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-even-diff-face-C 'ediff-even-diff-C
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-even-diff-C'
this variable represents.")
-(ediff-hide-face 'ediff-even-diff-C)
+(ediff-hide-face ediff-even-diff-face-C)
(defface ediff-even-diff-Ancestor
(if ediff-emacs-p
(t (:italic t :stipple ,stipple-pixmap))))
"Face for highlighting even-numbered non-current differences in the ancestor buffer."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-even-diff-face-Ancestor 'face-alias 'ediff-even-diff-Ancestor)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-even-diff-face-Ancestor 'ediff-even-diff-Ancestor
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-even-diff-Ancestor'
this variable represents.")
-(ediff-hide-face 'ediff-even-diff-Ancestor)
+(ediff-hide-face ediff-even-diff-face-Ancestor)
;; Association between buffer types and even-diff-face symbols
(defconst ediff-even-diff-face-alist
(t (:italic t :stipple "gray1"))))
"Face for highlighting odd-numbered non-current differences in buffer A."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-odd-diff-face-A 'face-alias 'ediff-odd-diff-A)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-odd-diff-face-A 'ediff-odd-diff-A
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-odd-diff-A'
this variable represents.")
-(ediff-hide-face 'ediff-odd-diff-A)
+(ediff-hide-face ediff-odd-diff-face-A)
(defface ediff-odd-diff-B
(t (:italic t :stipple "gray1"))))
"Face for highlighting odd-numbered non-current differences in buffer B."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-odd-diff-face-B 'face-alias 'ediff-odd-diff-B)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-odd-diff-face-B 'ediff-odd-diff-B
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-odd-diff-B'
this variable represents.")
-(ediff-hide-face 'ediff-odd-diff-B)
+(ediff-hide-face ediff-odd-diff-face-B)
(defface ediff-odd-diff-C
(if ediff-emacs-p
(t (:italic t :stipple "gray1"))))
"Face for highlighting odd-numbered non-current differences in buffer C."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-odd-diff-face-C 'face-alias 'ediff-odd-diff-C)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-odd-diff-face-C 'ediff-odd-diff-C
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-odd-diff-C'
this variable represents.")
-(ediff-hide-face 'ediff-odd-diff-C)
+(ediff-hide-face ediff-odd-diff-face-C)
(defface ediff-odd-diff-Ancestor
(if ediff-emacs-p
(t (:italic t :stipple "gray1"))))
"Face for highlighting odd-numbered non-current differences in the ancestor buffer."
:group 'ediff-highlighting)
-;; backward-compatibility alias
-(put 'ediff-odd-diff-face-Ancestor 'face-alias 'ediff-odd-diff-Ancestor)
;; An internal variable. Ediff takes the face from here. When unhighlighting,
;; this variable is set to nil, then again to the appropriate face.
(defvar ediff-odd-diff-face-Ancestor 'ediff-odd-diff-Ancestor
DO NOT CHANGE this variable. Instead, use the customization
widget to customize the actual face object `ediff-odd-diff-Ancestor'
this variable represents.")
-(ediff-hide-face 'ediff-odd-diff-Ancestor)
+(ediff-hide-face ediff-odd-diff-face-Ancestor)
;; Association between buffer types and odd-diff-face symbols
(defconst ediff-odd-diff-face-alist
- '((A . ediff-odd-diff-face-A)
- (B . ediff-odd-diff-face-B)
- (C . ediff-odd-diff-face-C)
- (Ancestor . ediff-odd-diff-face-Ancestor)))
+ '((A . ediff-odd-diff-A)
+ (B . ediff-odd-diff-B)
+ (C . ediff-odd-diff-C)
+ (Ancestor . ediff-odd-diff-Ancestor)))
;; A-list of fine-diff face symbols associated with buffer types
(defconst ediff-fine-diff-face-alist
- '((A . ediff-fine-diff-face-A)
- (B . ediff-fine-diff-face-B)
- (C . ediff-fine-diff-face-C)
- (Ancestor . ediff-fine-diff-face-Ancestor)))
+ '((A . ediff-fine-diff-A)
+ (B . ediff-fine-diff-B)
+ (C . ediff-fine-diff-C)
+ (Ancestor . ediff-fine-diff-Ancestor)))
;; Help echo
-(put 'ediff-fine-diff-A 'ediff-help-echo
+(put ediff-fine-diff-face-A 'ediff-help-echo
"A `refinement' of the current difference region")
-(put 'ediff-fine-diff-B 'ediff-help-echo
+(put ediff-fine-diff-face-B 'ediff-help-echo
"A `refinement' of the current difference region")
-(put 'ediff-fine-diff-C 'ediff-help-echo
+(put ediff-fine-diff-face-C 'ediff-help-echo
"A `refinement' of the current difference region")
-(put 'ediff-fine-diff-Ancestor 'ediff-help-echo
+(put ediff-fine-diff-face-Ancestor 'ediff-help-echo
"A `refinement' of the current difference region")
(add-hook 'ediff-quit-hook 'ediff-cleanup-mess)
;;; Misc
;; if nil, this silences some messages
-(defconst ediff-verbose-p t)
+(defvar ediff-verbose-p t)
(defcustom ediff-autostore-merges 'group-jobs-only
"*Save the results of merge jobs automatically.
-nil means don't save automatically. t means always save. Anything else
-means save automatically only if the merge job is part of a group of jobs, such
-as `ediff-merge-directory' or `ediff-merge-directory-revisions'."
+With value nil, don't save automatically. With value t, always
+save. Anything else means save automatically only if the merge
+job is part of a group of jobs, such as `ediff-merge-directory'
+or `ediff-merge-directory-revisions'."
:type '(choice (const nil) (const t) (const group-jobs-only))
:group 'ediff-merge)
(make-variable-buffer-local 'ediff-autostore-merges)
:group 'ediff)
;; needed to simulate frame-char-width in XEmacs.
-(defvar ediff-H-glyph (if ediff-xemacs-p (make-glyph "H")))
+(defvar ediff-H-glyph (if (featurep 'xemacs) (make-glyph "H")))
;; Temporary file used for refining difference regions in buffer A.
"Merge dir versions via ancestors")
(t
(capitalize
- (subst-char-in-string ?- ?\ (substring (symbol-name jobname) 6))))
+ (subst-char-in-string ?- ?\s (substring (symbol-name jobname) 6))))
))
(set-syntax-table ,old-table)))))))
+(provide 'ediff-init)
-;;; Local Variables:
-;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
-;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
-;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
-;;; End:
-(provide 'ediff-init)
-;;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5
+;; Local Variables:
+;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
+;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
+;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
+;; End:
+
+;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5
;;; ediff-init.el ends here