From: Mark Wooding Date: Tue, 26 Feb 2008 17:50:21 +0000 (+0000) Subject: Merge branch 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile X-Git-Url: https://git.distorted.org.uk/~mdw/profile/commitdiff_plain/56c3a7e735236be7ff43f95fe1a001f5245cdd81?hp=52696e46085eb452409261a6bae0a069a78144a9 Merge branch 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile * 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile: emerge-hack: A new script for Git merging. vncrc, xinitrc: Don't do so much Gnome fiddling. dot-emacs: Fiddle C indentation settings. emacs: Make postscript printing more sensible. --- diff --git a/dot-emacs.el b/dot-emacs.el index 55bd054..e2e8998 100644 --- a/dot-emacs.el +++ b/dot-emacs.el @@ -661,7 +661,7 @@ doesn't cope with anything approximating a complicated case." (label . 0) (case-label . +) (access-label . -) - (inclass . ++) + (inclass . +) (inline-open . ++) (statement-cont . 0) (statement-case-intro . +))) diff --git a/emacs b/emacs index 6d34822..877bbe2 100644 --- a/emacs +++ b/emacs @@ -128,7 +128,7 @@ ps-landscape-mode t ps-number-of-columns 3 ps-font-family 'Courier - ps-font-size 9) + ps-font-size 4) ;; --- Splash screen stuff --- diff --git a/emerge-hack b/emerge-hack new file mode 100755 index 0000000..dfbaaa1 --- /dev/null +++ b/emerge-hack @@ -0,0 +1,84 @@ +#! /bin/sh +set -e + +### Huh? +### +### This script is an adaptor for git mergetool so that, while /it/ thinks +### it's using emerge, it's really using ediff, which is much better, and +### maybe a long-running Emacs via gnuserv. + +## Find out what we're supposed to be doing. The command line looks like +## +## emerge-hack -f emerge-mumble FILE FILE ... OUTPUT + +dashf=$1 +command=$2 +shift 2 +case "$dashf" in + -f) ;; + *) echo >&2 "$0: expected -f emerge-mumble"; exit 1;; +esac + +case "$command" in + emerge-files-with-ancestor-command) + func=ediff-merge-files-with-ancestor + ;; + emerge-merge-files-command) + func=ediff-files + ;; + *) + echo >&2 "$0: unexpected command $command" + exit 1 + ;; +esac + +## Find out whether there's a plausible-looking gnuserv. + +if gnuclient -batch -eval t >/dev/null 2>&1; then + emacs="gnuclient" +else + emacs="emacs" +fi + +## Now build the command line. +## +## The hairy-looking seddery is there to quotify file names properly for +## Lisp. We also need to make sure that the filenames are absolute. +## Finally, there's a little tweak to separate off the last name because of +## the strange argument order ediff uses. + +expr="" +sep="" +last="$func" + +for i; do + name=$i + case "$name" in + /*);; + *) name=`pwd`/$name;; + esac + quot=$(echo -n "$name" | + sed -n ' + 1 h + 2,$ H + $ { + g + s/["\\]/\\&/ + s/^/"/ + s/$/"/ + s/\ +/\\n/ + p + } +') + expr="$expr$sep$last" + sep=" " + last=$quot + output=$name +done + +## Done. Note that we pass the output filename again, as an explicit +## argument. This will make gnuclient wait until we've finished with the +## merge. + +exec "$emacs" -eval "($expr${sep}nil $last)" "$output" diff --git a/gitconfig b/gitconfig index 4f63592..4d8eb77 100644 --- a/gitconfig +++ b/gitconfig @@ -7,6 +7,10 @@ [merge] summary = true + tool = emerge + +[mergetool "emerge"] + path = emerge-hack [diff] renames = copies @@ -54,6 +58,7 @@ [mail "alias"] git = git@vger.kernel.org mdw = mdw@distorted.org.uk + [gui] fontui = -family helvetica -size 11 -weight normal -slant roman -underline 0 -overstrike 0 fontdiff = -family fixed -size 10 -weight normal -slant roman -underline 0 -overstrike 0 diff --git a/setup b/setup index 47eac25..8ca3066 100755 --- a/setup +++ b/setup @@ -179,7 +179,8 @@ echo " all done." ### Install useful scripts included in this package scripts=" - mdw-editor" + mdw-editor + emerge-hack" echo "Installing scripts..." mkdir -p $HOME$sub/bin for s in $scripts; do diff --git a/vncrc b/vncrc index 00f0627..a4c6d6b 100644 --- a/vncrc +++ b/vncrc @@ -1,5 +1,5 @@ ## VNC settings -$geometry = "1270x960"; +$geometry = "1280x1024"; $depth = 16; $vncStartup = "$ENV{HOME}/.vncsession"; diff --git a/xinitrc b/xinitrc index 4ef815b..43ca142 100755 --- a/xinitrc +++ b/xinitrc @@ -11,7 +11,6 @@ cleanup=":" xset b 10 2000 50 xset r rate 500 50 xset m 1 1 -$xx gnome-settings-daemon& $xx mail-notification& $xx $VNCSESSION || $xx gkrellm& if [ "$XINIT_TEST" = "" ] || [ "$XWIDTH" = "" ] || [ "$XHEIGHT" = "" ]; then @@ -45,8 +44,9 @@ $xx $wm $EOPTS& if ! $xx $VNCSESSION; then xscreensaver-command -exit xscreensaver -no-splash& + $xx gnome-settings-daemon& + $xx gnome-panel& fi -$xx gnome-panel& # --- Emacs window measurements --- #