Skip to content

Commit

Permalink
Added a menu for Egg-Stash mode
Browse files Browse the repository at this point in the history
The menu did not show up before at all when in Egg-Stash mode.
Enabled it and set the order of menu keybindings to appear as:

SPC:load details
h:hide/show details
a:apply
o:pop and apply stash
x:delete stash  X:delete all

The logic behind such arrangement is: first load to see the details
of the stash. Then apply it or pop & apply it. If not happy with the
stash delete it or delete all stashes.
  • Loading branch information
dotemacs committed May 7, 2012
1 parent ee191ad commit 1570310
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions egg.el
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ Different versions of git have different names for this subdir."
string))

(defcustom egg-show-key-help-in-buffers
'(:log :status :diff :file-log :reflog)
'(:log :status :diff :file-log :reflog :stash)
"Display keybinding help in egg special buffers."
:group 'egg
:type '(set (const :tag "Status Buffer" :status)
Expand Down Expand Up @@ -5844,10 +5844,9 @@ Each remote ref on the commit line has extra extra extra keybindings:\\<egg-log-
(define-key map "n" 'egg-stash-buffer-next-stash)
(define-key map "s" 'egg-status)
(define-key map "p" 'egg-stash-buffer-prev-stash)
(define-key map (kbd "RET") 'egg-stash-buffer-pop)
(define-key map (kbd "o") 'egg-stash-buffer-pop)
(define-key map "RET" 'egg-stash-buffer-pop)
(define-key map "o" 'egg-stash-buffer-pop)
(define-key map "l" 'egg-log)

map))

(defconst egg-stash-map
Expand All @@ -5859,6 +5858,7 @@ Each remote ref on the commit line has extra extra extra keybindings:\\<egg-log-
(define-key map (kbd "DEL") 'egg-stash-buffer-drop)
(define-key map "x" 'egg-stash-buffer-drop)
(define-key map "X" 'egg-stash-buffer-clear)
(define-key map "o" 'egg-stash-buffer-pop)
map))

(defun egg-stash-buffer-next-stash ()
Expand All @@ -5885,11 +5885,12 @@ Each remote ref on the commit line has extra extra extra keybindings:\\<egg-log-
(egg-text "Extra Key Bindings for a Stash line:" 'egg-help-header-2) "\n"
(egg-pretty-help-text
"\\<egg-stash-map>"
"\\[egg-stash-buffer-apply]:apply\n"
"\\[egg-stash-buffer-show]:load details\n"
"\\[egg-stash-buffer-drop]:delete stash\n"
"\\[egg-stash-buffer-show]:load details "
"\\[egg-section-cmd-toggle-hide-show]:hide/show details "
"\\[egg-stash-buffer-apply]:apply "
"\\[egg-stash-buffer-pop]:pop and apply stash\n"
"\\[egg-stash-buffer-clear]:delete all\n"
"\\[egg-stash-buffer-drop]:delete stash "
"\\[egg-stash-buffer-clear]:delete all "
)
"\n"
))
Expand Down

0 comments on commit 1570310

Please sign in to comment.