Merge branch 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile
authorMark Wooding <mdw@distorted.org.uk>
Tue, 26 Feb 2008 17:50:21 +0000 (17:50 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 26 Feb 2008 17:50:21 +0000 (17:50 +0000)
* '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.

dot-emacs.el
emacs
emerge-hack [new file with mode: 0755]
gitconfig
setup
vncrc
xinitrc

index 55bd054..e2e8998 100644 (file)
@@ -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 (file)
--- a/emacs
+++ b/emacs
       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 (executable)
index 0000000..dfbaaa1
--- /dev/null
@@ -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"
index 4f63592..4d8eb77 100644 (file)
--- 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 (executable)
--- 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 (file)
--- 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 (executable)
--- 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 ---
 #