gnu: Add perl-getopt-tabular.
[jackhill/guix/guix.git] / emacs / guix-utils.el
index 8787814..823c646 100644 (file)
@@ -154,6 +154,22 @@ accessed with KEYS."
     (dolist (key keys val)
       (setq val (cdr (assq key val))))))
 
+(defun guix-find-file (file)
+  "Find FILE if it exists."
+  (if (file-exists-p file)
+      (find-file file)
+    (message "File '%s' does not exist." file)))
+
+\f
+;;; Diff
+
+(defvar guix-diff-switches "-u"
+  "A string or list of strings specifying switches to be passed to diff.")
+
+(defun guix-diff (old new &optional switches no-async)
+  "Same as `diff', but use `guix-diff-switches' as default."
+  (diff old new (or switches guix-diff-switches) no-async))
+
 (provide 'guix-utils)
 
 ;;; guix-utils.el ends here