Skip to content
Browse files

Adds a command and key binding to set the method for comparing file

content.
  • Loading branch information...
1 parent 93c5785 commit 3ece4a6999cd6bd921bef505d844f8490d964a7c @matthewlmcclure committed Mar 9, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 dircmp.el
View
10 dircmp.el
@@ -48,6 +48,7 @@
(define-key dircmp-mode-map "r" 'toggle-include-present-only-on-right)
(define-key dircmp-mode-map "s" 'toggle-preserve-symlinks)
(define-key dircmp-mode-map "t" 'toggle-compare-times)
+(define-key dircmp-mode-map "c" 'set-compare-content)
(defvar rsync-output-buffer " *dircmp-rsync-output*")
(defvar diff-output-buffer " *dircmp-diff-output*")
@@ -116,9 +117,13 @@
:type '(choice (const "size")
(const "checksum")
(const "byte by byte")
- (const "ignore whitespace differences")
+ (const "ignore whitespace")
(const "by file type")))
(make-variable-buffer-local 'dircmp-compare-content)
+(defun set-compare-content (method)
+ (interactive "sCompare file content using: \n")
+ (with-current-buffer comparison-view-buffer
+ (set-variable 'dircmp-compare-content method)))
(defun compare-dirs (dir1 dir2)
(interactive "DLeft directory: \nDRight directory: ")
@@ -162,9 +167,10 @@
(if dircmp-include-present-only-on-right " --delete"))))
(defun refine-comparison-with-diff ()
- (if (equal dircmp-compare-content "ignore whitespace differences")
+ (if (equal (with-current-buffer comparison-view-buffer dircmp-compare-content) "ignore whitespace")
(save-excursion
(get-buffer-create diff-output-buffer)
+ (get-buffer-create diff-output-buffer)
(set-buffer diff-output-buffer)
(erase-buffer)
(set-buffer rsync-output-buffer)

0 comments on commit 3ece4a6

Please sign in to comment.
Something went wrong with that request. Please try again.