Skip to content

Commit

Permalink
added egg-log-msg-cancel for quit from buffer commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Plambir committed Oct 30, 2010
1 parent fc5d21a commit 762e3eb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion egg.el
Expand Up @@ -5,6 +5,7 @@
;; Copyright (C) 2008 Marius Vollmer
;; Copyright (C) 2009 Tim Moore
;; Copyright (C) 2009 byplayer
;; Copyright (C) 2010 Alexander Prusov
;;
;; Egg is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -3192,6 +3193,7 @@ If INIT was not nil, then perform 1st-time initializations as well."
(set (make-local-variable 'egg-log-msg-diff-beg) nil))

(define-key egg-log-msg-mode-map (kbd "C-c C-c") 'egg-log-msg-done)
(define-key egg-log-msg-mode-map (kbd "C-c C-k") 'egg-log-msg-cancel)
(define-key egg-log-msg-mode-map (kbd "M-p") 'egg-log-msg-older-text)
(define-key egg-log-msg-mode-map (kbd "M-n") 'egg-log-msg-newer-text)
(define-key egg-log-msg-mode-map (kbd "C-l") 'egg-buffer-cmd-refresh)
Expand Down Expand Up @@ -3232,6 +3234,12 @@ If INIT was not nil, then perform 1st-time initializations as well."
(message "Please enter a log message!")
(ding)))

(defun egg-log-msg-cancel ()
(interactive)
(if (> (length (window-list)) 1)
(delete-window)
(kill-buffer)))

(defun egg-log-msg-hist-cycle (&optional forward)
"Cycle through message log history."
(let ((len (ring-length egg-log-msg-ring)))
Expand Down Expand Up @@ -3333,7 +3341,7 @@ If INIT was not nil, then perform 1st-time initializations as well."
(t "Shit happens!"))
"\n"
"Repository: " (egg-text git-dir 'font-lock-constant-face) "\n"
(egg-text "--------------- Commit Message (type C-c C-c when done) ---------------"
(egg-text "-- Commit Message (type `C-c C-c` when done or `C-c C-k` when cancel) -"
'font-lock-comment-face))
(put-text-property (point-min) (point) 'read-only t)
(put-text-property (point-min) (point) 'rear-sticky nil)
Expand Down

0 comments on commit 762e3eb

Please sign in to comment.