diff options
author | Kyle Meyer <kyle@kyleam.com> | 2016-02-14 12:41:18 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2016-02-14 12:41:18 -0500 |
commit | c41c945776558eca41f3be05598410882e85f5c6 (patch) | |
tree | 943a2329a001fa51d2a05771f3dd5332cf81aa78 | |
parent | 6f9b5ac9c8972baa62bc2865b194d88a19ffcfe7 (diff) | |
download | emacs.d-c41c945776558eca41f3be05598410882e85f5c6.tar.gz |
diff: Don't use custom diff command
-rw-r--r-- | init.el | 19 | ||||
-rw-r--r-- | lisp/km-diff.el | 16 |
2 files changed, 11 insertions, 24 deletions
@@ -1421,10 +1421,18 @@ (use-package diff :defer t + :init + (define-key km/external-map "d" #'diff) :config (setq diff-command "/bin/diff" - diff-switches "-u") - (add-hook 'diff-mode-hook #'toggle-truncate-lines)) + diff-switches "-u")) + +(use-package diff-mode + :after diff + :config + (setq diff-default-read-only t) + (add-hook 'diff-mode-hook #'toggle-truncate-lines) + (define-key diff-mode-map (kbd "C-c C-g") #'revert-buffer)) (use-package ediff :defer t @@ -1436,12 +1444,7 @@ (use-package km-diff :defer t :init - (bind-keys :map km/external-map - ("o" . km/ediff-with-other-window) - ("d" . km/diff)) - :config - (after 'diff-mode - (define-key diff-mode-map (kbd "C-c C-g") #'km/revert-buffer-and-view))) + (define-key km/external-map "o" #'km/ediff-with-other-window)) ;;; Text modes diff --git a/lisp/km-diff.el b/lisp/km-diff.el index 69a5a64..371d1c9 100644 --- a/lisp/km-diff.el +++ b/lisp/km-diff.el @@ -21,23 +21,7 @@ ;;; Code: (require 'dash) -(require 'diff) (require 'ediff) -(require 'view) - -;;;###autoload -(defun km/diff () - "Run `diff' and then select buffer and turn on View mode." - (interactive) - (call-interactively #'diff) - (select-window (get-buffer-window "*Diff*")) - (view-mode 1)) - -;;;###autoload -(defun km/revert-buffer-and-view () - (interactive) - (revert-buffer) - (view-mode 1)) ;;;###autoload (defun km/ediff-with-other-window () |