]> code.delx.au - gnu-emacs/blobdiff - lisp/vc/ediff-init.el
Update copyright year to 2015
[gnu-emacs] / lisp / vc / ediff-init.el
index af45acd3c37da49f8eecf0565ab1b958927134d8..d6b538cff2bde2fc1789f9e375e7a994340f4cfe 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)
@@ -1346,7 +1345,7 @@ this variable represents.")
 (ediff-defvar-local ediff-current-diff-overlay-Ancestor nil
   "Overlay for the current difference region in the ancestor buffer.")
 
-(defvar ediff-toggle-read-only-function 'toggle-read-only
+(defvar ediff-toggle-read-only-function 'read-only-mode
   "Function to be used to toggle read-only status of the buffer.
 If nil, Ediff tries using the command bound to C-x C-q.")
 
@@ -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)
    ))