chiark / gitweb /
Merge branch 'master' of metalzone:etc/profile
authorMark Wooding <mdw@distorted.org.uk>
Tue, 14 Dec 2010 15:37:43 +0000 (15:37 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 14 Dec 2010 15:37:43 +0000 (15:37 +0000)
* 'master' of metalzone:etc/profile:
  el/dot-emacs.el: New command for SSH terminal buffers.
  dot/emacs, el/Makefile: Random fixes from vampire.

dot/emacs
el/Makefile
el/dot-emacs.el

index cb7c39393a778cbbcb7fe1cc38ae3719c7b6b7f1..6d873dd0fd1fdf46c61a3614bc6f3a92ed6575c5 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
@@ -23,6 +23,7 @@
 
 (setq load-path (nconc load-path (list "~/lib/emacs")))
 (require 'dot-emacs)
+(require 'cl)
 
 ;;;--------------------------------------------------------------------------
 ;;; Some random initialisation.
index 987378abce50dec68a35e8828ada83c832658ec8..6549fde35fb0fcaac4a20cd07c3e7e2a583f3673 100644 (file)
@@ -6,4 +6,4 @@ all: dot-emacs.elc
 
 .SUFFIXES: .el .elc
 .el.elc:
-       $(EMACS) --batch --no-site-file --eval '(byte-compile-file "$<")'
+       $(EMACS) -L . --batch --no-site-file --eval '(byte-compile-file "$<")'
index 182799376a6e10ff4401a461e0c9cb9df20bf74b..8dc526771f4a0341600ad14606a580a753339ce2 100644 (file)
@@ -2474,6 +2474,20 @@      (define-key term-raw-map [?\e ?\M-O ?C] 'term-send-meta-right)
      (define-key term-raw-map [M-left] 'term-send-meta-left)
      (define-key term-raw-map [?\e ?\M-O ?D] 'term-send-meta-left)))
 
+(defadvice term-exec (before program-args-list compile activate)
+  "If the PROGRAM argument is a list, interpret it as (PROGRAM . SWITCHES).
+This allows you to pass a list of arguments through `ansi-term'."
+  (let ((program (ad-get-arg 2)))
+    (if (listp program)
+       (progn
+         (ad-set-arg 2 (car program))
+         (ad-set-arg 4 (cdr program))))))
+
+(defun ssh (host)
+  "Open a terminal containing an ssh session to the HOST."
+  (interactive "sHost: ")
+  (ansi-term (list "ssh" host) (format "ssh@%s" host)))
+
 ;;;--------------------------------------------------------------------------
 ;;; Inferior Emacs Lisp.