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.

1  2 
el/dot-emacs.el

diff --combined el/dot-emacs.el
index 182799376a6e10ff4401a461e0c9cb9df20bf74b,b5bdfd07cde0142d645235b65d45dcc1735af0d0..8dc526771f4a0341600ad14606a580a753339ce2
@@@ -1026,14 -1026,13 +1026,14 @@@ doesn't match any of the regular expres
                  (arglist-cont-nonempty . mdw-c-lineup-arglist)
                  (topmost-intro . mdw-c-indent-extern-mumble)
                  (cpp-define-intro . 0)
 +                (knr-argdecl . 0)
                  (inextern-lang . [0])
                  (label . 0)
                  (case-label . +)
                  (access-label . -)
                  (inclass . +)
                  (inline-open . ++)
 -                (statement-cont . 0)
 +                (statement-cont . +)
                  (statement-case-intro . +)))
               t))
  
@@@ -2140,8 -2139,8 +2140,8 @@@ strip numbers instead.
                   (home (expand-file-name "~")) (nhome (length home)))
              (if (and (>= npwd nhome)
                       (or (= nhome npwd)
 -                         (= (elt pwd nhome) ?/)
 -                     (string= (substring pwd 0 nhome) home)))
 +                         (= (elt pwd nhome) ?/))
 +                     (string= (substring pwd 0 nhome) home))
                  (concat "~" (substring pwd (length home)))
                pwd))
            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.