From 9edaf8243d0ad0887ae4369bf776df04bf595e38 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 3 Apr 2015 09:43:04 +0200 Subject: [PATCH] Cleanup git-commit slightly --- git-auto-commit-mode.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/git-auto-commit-mode.el b/git-auto-commit-mode.el index 6b41e69..18fb198 100644 --- a/git-auto-commit-mode.el +++ b/git-auto-commit-mode.el @@ -104,11 +104,14 @@ Default to FILENAME." (defun gac-commit () "Commit the current buffer's file to git." - (let* ((filename (file-name-nondirectory (buffer-file-name))) - (commit-msg (gac--commit-msg (buffer-file-name))) - (default-directory (file-name-directory (buffer-file-name)))) + (let* ((buffer-file (buffer-file-name)) + (filename (convert-standard-filename + (file-name-nondirectory buffer-file))) + (commit-msg (gac--commit-msg buffer-file)) + (default-directory (file-name-directory buffer-file))) (shell-command - (concat "git add " (shell-quote-argument (convert-standard-filename filename)) " && git commit -m " (shell-quote-argument commit-msg))))) + (concat "git add " (shell-quote-argument filename) + " && git commit -m " (shell-quote-argument commit-msg))))) (defun gac-push () "Push commits to the current upstream.