1

first question: is how to adjust colors of ediff-revision output, tried various versions - no luck:

;; Customizing colors used in diff mode
(load-library "ediff")
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(setq ediff-split-window-function 'split-window-horizontally)

(defun update-diff-colors ()
  "update the colors for diff faces"
  (set-face-attribute 'diff-added nil
                      :foreground "white" :background "blue")
  (set-face-attribute 'diff-removed nil
                      :foreground "white" :background "red3")
  (set-face-attribute 'diff-changed nil
                      :foreground "white" :background "purple"))

(eval-after-load "diff-mode"
  '(update-diff-colors))

;; Usage: emacs -diff file1 file2
(defun command-line-diff (switch)
      (let ((file1 (pop command-line-args-left))
            (file2 (pop command-line-args-left)))
        (ediff file1 file2)))

(add-to-list 'command-switch-alist '("diff" . command-line-diff))

;; turn off whitespace checking:
(setq ediff-diff-options "-w")

(provide 'ediff-settings)

second: How to merge the changes from left to right but only a selected portion / changed block?

  • 2
    Don't ask multiple questions together, please. Edit out your second question, and post it separately. – phils Jan 8 '16 at 4:50
1

first question: You can custom a face like this:

(custom-set-faces
 '(ediff-current-diff-A ((t (:foreground "White" :background "brown")))))

the ediff faces are:

ediff-current-diff-A 
ediff-current-diff-Ancestor
ediff-current-diff-B 
ediff-current-diff-C 
ediff-even-diff-A 
ediff-even-diff-Ancestor 
ediff-even-diff-B 
ediff-even-diff-C 
ediff-fine-diff-A 
ediff-fine-diff-Ancestor
ediff-fine-diff-B 
ediff-fine-diff-C 
ediff-odd-diff-A 
ediff-odd-diff-Ancestor
ediff-odd-diff-B
ediff-odd-diff-C

second question:

Where you are on the changed region you can use a or b to copy the region from left to right or from right to left.

Hope that helps

3

Move to the coloured text you're interested in, and type C-uC-x= to view details of the character at point, including any faces.

Select the face you're interested in, then select "customize this face", make the desired changes, and save.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.