From: Mark Wooding Date: Tue, 14 Dec 2010 15:37:43 +0000 (+0000) Subject: Merge branch 'master' of metalzone:etc/profile X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/ecbe94f1df94dd73edc2e214b94b6a7c0ad1fc13?ds=inline;hp=-c Merge branch 'master' of metalzone:etc/profile * 'master' of metalzone:etc/profile: el/dot-emacs.el: New command for SSH terminal buffers. dot/emacs, el/Makefile: Random fixes from vampire. --- ecbe94f1df94dd73edc2e214b94b6a7c0ad1fc13 diff --combined el/dot-emacs.el index 1827993,b5bdfd0..8dc5267 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@@ -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))) @@@ -2474,6 -2473,20 +2474,20 @@@ (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.