Permalink
Browse files

added a quit-window function, blatantly stolen from the magit project

  • Loading branch information...
fred-o committed Sep 24, 2012
1 parent d69121f commit dad9b430df4cc4fddd5c2a29d89264b878ca0ff7
Showing with 8 additions and 2 deletions.
  1. +1 −1 eclim-problems.el
  2. +1 −1 eclim-project.el
  3. +6 −0 eclim.el
View
@@ -56,7 +56,7 @@
(define-key map (kbd "a") 'eclim-problems-show-all)
(define-key map (kbd "e") 'eclim-problems-show-errors)
(define-key map (kbd "g") 'eclim-problems-buffer-refresh)
- (define-key map (kbd "q") 'quit-window)
+ (define-key map (kbd "q") 'eclim-quit-window)
(define-key map (kbd "w") 'eclim-problems-show-warnings)
(define-key map (kbd "f") 'eclim-problems-toggle-filefilter)
(define-key map (kbd "RET") 'eclim-problems-open-current)
View
@@ -47,7 +47,7 @@
(define-key map (kbd "p") 'eclim-project-update)
(define-key map (kbd "g") 'eclim-project-mode-refresh)
(define-key map (kbd "R") 'eclim-project-rename)
- (define-key map (kbd "q") 'quit-window)
+ (define-key map (kbd "q") 'eclim-quit-window)
map))
View
@@ -127,6 +127,12 @@ saved."
(defvar eclim--compressed-file-path-replacement-regexp "\\\\")
(defvar eclim--compressed-file-path-removal-regexp "^/")
+(defun eclim-quit-window (&optional kill-buffer)
+ "Bury the buffer and delete its window. With a prefix argument, kill the
+buffer instead."
+ (interactive "P")
+ (quit-window kill-buffer (selected-window)))
+
(defun string-startswith-p (string prefix)
(eq t (compare-strings string nil (string-width prefix) prefix nil nil)))

0 comments on commit dad9b43

Please sign in to comment.