-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add difftastic-dired-diff #6
Conversation
Thank you for the contribution @SqrtMinusOne! A couple of points that I'd appreciate your responses:
Let me know what your thoughts are. |
I'd rather implement that part with (defun my/test (a b)
(+ a b))
(let ((original-fun (symbol-function 'my/test)))
(cl-letf (((symbol-function 'my/test)
(lambda (a b)
(+ (funcall original-fun a b)
1))))
(my/test 2 2)))
=> 5
(defun difftastic-dired-diff (file &optional lang-override)
"Compare file at point with FILE using difftastic.
The behavior is the same as `dired-diff'."
(interactive
(list 'interactive
(when current-prefix-arg
(completing-read "Language: " (difftastic--languages) nil t))))
(cl-letf (((symbol-function 'diff)
(lambda (current file _switches)
(difftastic-files current file lang-override)))
(current-prefix-arg nil))
(if (eq file 'interactive)
(call-interactively #'dired-diff))
(funcall #'dired-diff file))) However, I see there are a lot of other options in At this point it would have to modify the global |
Perfect!
Let's stay with
I like this approach. Would you mind checking it and updating the PR?
This is a really good point. I'd suggest that for now let's stay with just |
Done 1 and 3, seems to work fine. The issue is #7. |
Would you mind updating documentation to reflect new function name? |
Oh, sure. |
Sorry to bother but linter is bot happy
AFK now. Would you mind taking care of this? |
Ah, I must have copied that from the describe buffer. Fixed now. |
This adds a version of
dired-diff
that makes use of this package.There's a lot going on in the interactive block of the original function, so I thought
cl-letf
would make more sense than just copying the function.