diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-01-27 01:25:25 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-01-27 01:25:25 -0500 |
commit | 3557df9912c22ca77a2fd6d678781a3afc46fb1a (patch) | |
tree | a924dd8dcbefaaa9510084b892432be4404d0961 /lisp | |
parent | dde18243db3828da9b257e1efbc82b23854705ef (diff) | |
download | emacs.d-3557df9912c22ca77a2fd6d678781a3afc46fb1a.tar.gz |
Rewrite diff advice as separate function
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-external.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/init-external.el b/lisp/init-external.el index 3d44f64..10d0142 100644 --- a/lisp/init-external.el +++ b/lisp/init-external.el @@ -140,7 +140,10 @@ monitor setup)." (setq ediff-window-setup-function 'ediff-setup-windows-plain) -(defadvice diff (after diff-select-and-view activate) +(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)) @@ -164,7 +167,7 @@ monitor setup)." (ediff file-a file-b) (user-error "At least one buffer is not visiting a file")))) -(define-key km/external-map "d" 'diff) +(define-key km/external-map "d" 'km/diff) (define-key km/external-map "e" 'ediff) (define-key km/external-map "o" 'km/ediff-with-other-window) |