Skip to main content
deleted 97 characters in body
Source Link
ideasman42
  • 9.2k
  • 1
  • 35
  • 123
;; 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)
;; 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)
;; 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)
;; 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)
Source Link

ediff - change colors and how to merge code

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?