(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))
(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.