]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/ediff-init.el
Merge branch 'emacs-25-merge'
[gnu-emacs] / lisp / vc / ediff-init.el
index 589ea454965ff2efc105e61f13d398e20661f3d4..a1d405ac2a150ef93e55097b5c6549e481c74174 100644 (file)
@@ -1,6 +1,6 @@
 ;;; ediff-init.el --- Macros, variables, and defsubsts used by Ediff
 
-;; Copyright (C) 1994-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2015 Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
 ;; Package: ediff
@@ -24,6 +24,8 @@
 
 ;;; Code:
 
+(require 'cl-lib)
+
 ;; Start compiler pacifier
 (defvar ediff-metajob-name)
 (defvar ediff-meta-buffer)
@@ -118,11 +120,8 @@ It needs to be killed when we quit the session.")
     (?C . ediff-buffer-C)))
 
 ;;; Macros
-(defmacro ediff-odd-p (arg)
-  `(eq (logand ,arg 1) 1))
-
-(defmacro ediff-buffer-live-p (buf)
-  `(and ,buf (get-buffer ,buf) (buffer-name (get-buffer ,buf))))
+(defsubst ediff-buffer-live-p (buf)
+  (and buf (get-buffer buf) (buffer-name (get-buffer buf))))
 
 (defmacro ediff-get-buffer (arg)
   `(cond ((eq ,arg 'A) ediff-buffer-A)
@@ -719,9 +718,9 @@ appropriate symbol: `rcs', `pcl-cvs', or `generic-sc' if you so desire."
 (defcustom ediff-coding-system-for-read 'raw-text
   "The coding system for read to use when running the diff program as a subprocess.
 In most cases, the default will do.  However, under certain circumstances in
-MS-Windows you might need to use something like 'raw-text-dos here.
+MS-Windows you might need to use something like `raw-text-dos' here.
 So, if the output that your diff program sends to Emacs contains extra ^M's,
-you might need to experiment here, if the default or 'raw-text-dos doesn't
+you might need to experiment here, if the default or `raw-text-dos' doesn't
 work."
   :type 'symbol
   :group 'ediff)
@@ -751,7 +750,7 @@ to temp files in buffer jobs and when Ediff needs to find fine differences."
 (defun ediff-check-version (op major minor &optional type-of-emacs)
   "Check the current version against MAJOR and MINOR version numbers.
 The comparison uses operator OP, which may be any of: =, >, >=, <, <=.
-TYPE-OF-EMACS is either 'xemacs or 'emacs."
+TYPE-OF-EMACS is either `emacs' or `xemacs'."
   (declare (obsolete version< "23.1"))
   (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs))
             ((eq type-of-emacs 'emacs) (featurep 'emacs))
@@ -777,7 +776,7 @@ TYPE-OF-EMACS is either 'xemacs or 'emacs."
 
 ;; A var local to each control panel buffer.  Indicates highlighting style
 ;; in effect for this buffer: `face', `ascii',
-;; `off' -- turned off \(on a dumb terminal only\).
+;; `off' -- turned off (on a dumb terminal only).
 (ediff-defvar-local ediff-highlighting-style
   (if (and (ediff-has-face-support-p) ediff-use-faces) 'face 'ascii)
   "")
@@ -1456,7 +1455,7 @@ This default should work without changes."
   ;; The value of dif-num is always 1- the one that user sees.
   ;; This is why even face is used when dif-num is odd.
   (ediff-get-symbol-from-alist
-   buf-type (if (ediff-odd-p dif-num)
+   buf-type (if (cl-oddp dif-num)
                ediff-even-diff-face-alist
              ediff-odd-diff-face-alist)
    ))
@@ -1720,6 +1719,9 @@ Unless optional argument INPLACE is non-nil, return a new string."
            (aset newstr i tochar)))
       newstr)))
 
+(unless (fboundp 'format-message)
+  (defalias 'format-message 'format))
+
 (defun ediff-abbrev-jobname (jobname)
   (cond ((eq jobname 'ediff-directories)
         "Compare two directories")