After running recover-this-file and accepting the autosave version, you'll have a modified buffer containing the autosave contents. At this point you can use M-x diff-buffer-with-file RET to see the differences between the modified buffer and the saved file.
The key I've bound for this actually runs a custom function, in order to produce a unified diff, and ...
You can advise ediff-quit so it dynamically rebinds y-or-n-p to a function that returns t.
(defun disable-y-or-n-p (orig-fun &rest args)
(cl-letf (((symbol-function 'y-or-n-p) (lambda (prompt) t)))
(apply orig-fun args)))
(advice-add 'ediff-quit :around #'disable-y-or-n-p)
This is more robust to upstream changes than redefining ediff-quit.
I'm pretty sure there are other solutions, but you can do this using --eval instead of -f (--funcall):
emacs --eval '(ediff-files "file1" "file2")'
In fact, the Emacs manual on "Command Line Arguments for Emacs Invocation" says that -f function and --funcall function
Call Lisp function function. If it is an interactive function (a command), it reads the ...
As @nanny said in comments, solution is having installed Cygwin with diffutils.
Here is how to do it:
Download Cygwin from its homepage.
Install Cygwin with diffutils: A GNU collection of diff utilities package. This package can be found in Utils section in one of few steps of Cygwin installation.
Add Cygwin directories to the PATH windows system variable. ...
Move point to the file you want to partially stage/unstage using Ediff and press e (magit-ediff-dwim). Alternatively you can also leave point where it is and press E s (magit-ediff-stage) but then you will be asked about the file in the minibuffer - so moving to the file first might be more convenient.
In the resulting Ediff session use c b to stage and a b ...
What you want can be achieved cleanly using hook provided by ediff (which if read the documentation seem to be provided for this exact purpose), advices are not needed. The relevant hooks are
1) ediff-quit-hook, from the documentation
Hooks to run in the Ediff control buffer after finishing Ediff.
Hooks to run before Ediff ...
It sounds like your goal is to have org-mode files always show everything when in ediff. The simplest solution is probably to avoid the local variables approach and just put show-all in the relevant hook, ediff-prepare-buffer-hook which is run after buffers A, B, & C are set up:
(add-hook 'ediff-prepare-buffer-hook #'...
When using magit:
Use l -al l to view the revisions of all branches in your history
go to the line containing the revision you want to compare your current buffer content against.
Type d and you are asked for which revision to compare the current working tree against (the default is the revision at point). Confirm.
You'll get a diff overview over changes of ...
Emacs is doing what you told it to do instead of what you meant. ediff-revision asks for three pieces of information:
The file to work on — default: the file that the current buffer is visiting.
The old revision — default: the latest revision.
The new revision — default: the current state.
At step 1, you select the file, you aren't telling Emacs that you ...
See this StackOverflow answer.
Pressing d will copy both A and B to buffer C.
(defun ediff-copy-both-to-C ()
(ediff-copy-diff ediff-current-difference nil 'C nil
(ediff-get-region-contents ediff-current-difference 'A ediff-control-buffer)
It's really quite simple; don't do that:
I use (setq vc-follow-symlinks nil) to not prompt to ask yes/no and not follow to the real file
It doesn't make much sense to set this variable to nil and find-file-visit-truename to t. Both variables control whether Emacs should follow symlinks when visiting files. But the latter is much more aggressive. vc-...
I had the same problem and added
;;; When opening a file that is a symbolic link, don't ask whether I
;;; want to follow the link. Just do it
(setq find-file-visit-truename t)
to my .emacs file.
Unfortunately I can't remember where on the web I found this, so no source credits.
Unfortunately I think you do have to either rebind q or adjust the source of ediff-quit. As is apparent in the source of ediff-quit the prompt always happens.
(defun ediff-quit (reverse-default-keep-variants)
"Finish an Ediff session and exit Ediff.
Unselects the selected difference, if any, restores the read-only and modified
flags of the compared file ...
Look at what you made me do, I was so happy with my ugly hack, and now
(defvar ediff-last-windows nil
"Last ediff window configuration.")
(defun ediff-restore-windows ()
"Restore window configuration to `ediff-last-windows'."
You can tweak the options used by Ediff by customizing ediff-diff-options, but options controlling the display (like context) are not supported.
You can however call ediff-show-diff-output from an ediff session (bound to D). This command will create a new buffer containing the 'raw' diff output. This command can have its own set of options, e.g.
Good question. This feels like it should be standard. With a little digging into the code and experimenting,
this seems at first glance to work:
From the ediff control window:
M-: (setq ediff-word-mode t) RET
! to run ediff-update-diffs
Which we can encapsulate in a command (which I've bound to . in the ediff control buffer) like so:
ediff-mode has built-in bindings to apply and revert diff hunks.
Let's say you are running ediff between files/buffers A and B.
To copy A's region to B, press a
To undo that, i.e. to restore the original region in buffer B, do rb
To copy B's region to A, press b
To undo that, i.e. to restore the original region in buffer A, do ra
While the ...
There is an internal predicate in ediff-init.el, called ediff-window-display-p. When I redefined it (after loading ediff, of course) like so, everything works in a single frame, including the function you mentioned as a problem:
(defun ediff-window-display-p () nil)
I do agree with @lawlist that this is a nice feature request -- to fix ediff-window-setup-...
Edit: The duplicate Q&A on StackOverflow has answers to this question (as pointed out by Tianxiang Xiong in the comments).
My answer below is no use, as you evidentially can't get the desired result that way. I'm only not deleting it because the information it does give is somewhat relevant, and might still prove interesting information to someone.
Move to the coloured text you're interested in, and type C-uC-x= to view details of the character at point, including any faces.
Select the face you're interested in, then select "customize this face", make the desired changes, and save.
Another option can be found on the worg page. The basic idea is to use ediff-select-hook to unfold an element whenever given region is selected in ediff and folding them back in the ediff-unselect-hook. I am posting the code here for completeness
;; Check for org mode and existence of buffer
(defun f-ediff-org-showhide (buf command &rest cmdargs)