branch: externals/agitate commit 0ee85a971bf358d1fa0bf66864a04a037022f078 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Add agitate-diff-buffer-or-file command --- agitate.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/agitate.el b/agitate.el index 808a96ff55..8f83c663e9 100644 --- a/agitate.el +++ b/agitate.el @@ -74,6 +74,21 @@ fontification." (setq agitate--refine-diff-state 'current) (message "Diff refine %s" (propertize "current" 'face 'success)))))) +;;;###autoload +(defun agitate-diff-buffer-or-file () + "Produce a diff against the file or latest revision. + +If the buffer is modified, produce a diff that compares its state +to that of the corresponding file. In simple terms, show the +latest unsaved changes. + +If the buffer is not modified, produce a diff of the file +relative to its latest revision." + (interactive) + (if (buffer-modified-p) + (diff-buffer-with-file (current-buffer)) + (vc-diff))) + ;;;; Commands for log-view (listings of commits) ;;;###autoload