summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-06-07 22:43:46 -0400
committerKyle Meyer <kyle@kyleam.com>2014-06-07 22:43:46 -0400
commit2a1419f623c510699dd5a8cf3c2dfb5ef9acf022 (patch)
tree15fee64654600782531e78073fd76d02fd8a38ad /lisp
parentb68f57928c8e9073163bdf699d00f7cce4c9d7f4 (diff)
downloademacs.d-2a1419f623c510699dd5a8cf3c2dfb5ef9acf022.tar.gz
Reorganize init-external.el
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-external.el37
1 files changed, 20 insertions, 17 deletions
diff --git a/lisp/init-external.el b/lisp/init-external.el
index 43780c7..1c5a0bb 100644
--- a/lisp/init-external.el
+++ b/lisp/init-external.el
@@ -1,14 +1,14 @@
+(define-prefix-command 'external-map)
+(global-set-key (kbd "C-c x") 'external-map)
+
+;;; Terminals
+
(defvar km/terminal "urxvt")
(defun km/open-external-terminal ()
(interactive)
(start-process "ext-term" nil km/terminal))
-(defadvice recompile (around restore-windows activate)
- "Prevent recompiling from spawning new windows."
- (save-window-excursion
- ad-do-it))
-
(defadvice shell-command (around shell-command-restore-windows activate)
"Restore window configuraiton after shell-command.
The hides the *Async Shell Command* buffer that is opened in the
@@ -17,9 +17,6 @@ other window when an asynchronous command is run."
ad-do-it
(jump-to-register :before-shell-command))
-(define-prefix-command 'external-map)
-(global-set-key (kbd "C-c x") 'external-map)
-
(defun km/zsh-ansi-term (&optional new-buffer)
"Open an ansi-term buffer running ZSH.
The buffer is named according to `default-directory'. If a buffer
@@ -39,12 +36,6 @@ is non-nil, switch to the buffer."
(setq buffer-name (km/zsh-ansi-term new-buffer)))
(pop-to-buffer buffer-name)))
-(defun km/display-compilation-other-window ()
- (interactive)
- (-if-let (comp-buffer (get-buffer "*compilation*"))
- (display-buffer comp-buffer)
- (error "No compilation buffer")))
-
(define-key external-map "a" 'km/zsh-ansi-term)
;; This overrides binding for `add-change-log-entry-other-window'.
(define-key ctl-x-4-map "a" 'km/zsh-ansi-term-other-window)
@@ -53,12 +44,24 @@ is non-nil, switch to the buffer."
(define-key external-map "s" 'shell-command)
(define-key external-map "S" 'shell)
+(define-key external-map "w" 'woman)
+
+;;; Compilation
+
+(defadvice recompile (around restore-windows activate)
+ "Prevent recompiling from spawning new windows."
+ (save-window-excursion
+ ad-do-it))
+
+(defun km/display-compilation-other-window ()
+ (interactive)
+ (-if-let (comp-buffer (get-buffer "*compilation*"))
+ (display-buffer comp-buffer)
+ (error "No compilation buffer")))
+
(define-key external-map "c" 'compile)
(define-key external-map "g" 'recompile)
(define-key external-map "o" 'km/display-compilation-other-window)
-
-(define-key external-map "w" 'woman)
-
;; Give frequently-used recompile a shorter binding.
(global-set-key (kbd "C-c g") 'recompile)