chiark / gitweb /
Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/profile
authorMark Wooding <mdw@distorted.org.uk>
Tue, 22 Mar 2016 21:37:32 +0000 (21:37 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 22 Mar 2016 21:37:32 +0000 (21:37 +0000)
* 'master' of git.distorted.org.uk:~mdw/publish/public-git/profile: (125 commits)
  dot/emacs: Align Org mode tags to the proper column in agenda view.
  el/dot-emacs.el: Distinguish whether diary entries are processed for Org.
  dot/emacs: Put `org-remember' in with the rest of the Org-mode bindings.
  dot/emacs: Better grip on when `M-x calendar' shows things.
  dot/emacs: File organizational stuff under `brain'.
  dot/emacs: Squish Debbugs-style email addresses to the submission address.
  dot/emacs: Don't snarf addresses from boring mailboxes.
  dot/gnus-local.el.distorted: Send letsencrypt.org nagmail away.
  dot/emacs: Pick the right master diary file.
  dot/tmux.conf: Some more bindings.
  dot/tmux.conf: Order roughly by key.
  dot/gnus-local.el.distorted: Set primary newsserver to chiark for now.
  el/dot-emacs.el: Add a (lightly modified) `nntp-open-authinfo-kludge'.
  el/dot-emacs.el: Trim leading spaces from diary entry strings.
  dot/emacs: Fix the date-format regexps to not eat a following time.
  dot/emacs: Display times in 24-hour clock, please.
  el/dot-emacs.el: Add Discordian date conversion.
  dot/emacs: Use newer diary hook functions if they're available.
  dot/emacs: Don't try to sort the diary buffer.
  dot/emacs, el/dot-emacs.el: Better Emacs version checking.
  ...

Conflicts:
dot/bashrc: Various prompt enhancements.

32 files changed:
bg/.gitignore [new file with mode: 0644]
bin/mdw-build
bin/mdw-sbuild [new file with mode: 0755]
bin/mdw-sbuild-server [new file with mode: 0755]
bin/run-with-shell-env [new file with mode: 0755]
bin/start-ssh-pageant [new file with mode: 0755]
bin/update-buildable-branch [new file with mode: 0755]
bin/xpra-start-xdummy [new file with mode: 0755]
dot/Xdefaults
dot/bash_profile
dot/bashrc
dot/e16-bindings
dot/emacs
dot/fonts.conf
dot/gitconfig.in
dot/gnus-local.el.distorted
dot/gnus.el
dot/lisp-init.lisp
dot/mdw-build.conf [new file with mode: 0644]
dot/muttrc
dot/muttrc.local.distorted
dot/parallel-config [new file with mode: 0644]
dot/pulse-daemon.conf [new file with mode: 0644]
dot/pulse-default.pa.in
dot/screenrc
dot/tmux.conf [new file with mode: 0644]
dot/vimrc
dot/xinitrc
el/dot-emacs.el
git/attributes
mdw.conf
setup

diff --git a/bg/.gitignore b/bg/.gitignore
new file mode 100644 (file)
index 0000000..085e8ba
--- /dev/null
@@ -0,0 +1 @@
+Thumbs.db
index a4650403a01c9f5df20e2d57282779dcc3b4dbb3..24ae04adeae90e693846dce1e1cb6f011ef26a1e 100755 (executable)
 
 set -e
 
+###--------------------------------------------------------------------------
+### Configuration.
+
+unset checkout checkoutrev
+unset setup setupcmd
+unset sign signkey
+unset sbuild sbuildsrv
+unset upload uploadpath
+unset dput dputtarget
+unset build distcheck debian clean vpath native
+for i in \
+  "/etc/mdw-build.conf" \
+  "${XDG_CONFIG_HOME-$HOME/.config}/mdw-build.conf" \
+  "./.mdw-build.conf"
+do
+  if [ -f "$i" ]; then . "$i"; fi
+done
+default_depends () {
+  var=$1 want=$2
+  eval "p=\${$var+t} q=\${$want+t}"
+  case $p,$q in t,*) ;; *,t) eval "$var=yes" ;; *) eval "$var=no" ;; esac
+}
+: ${checkout=yes} ${checkoutrev=HEAD}
+: ${build=test}
+: ${setup=yes} ${setupcmd=mdw-setup}
+: ${distcheck=yes}
+: ${debian=yes}
+: ${clean=yes}
+: ${vpath=yes}
+: ${native=yes}
+default_depends sbuild sbuildsrv
+default_depends sign signkey
+default_depends upload uploadpath
+default_depends dput dputtarget
+: ${DEB_BUILD_OPTIONS=parallel=4}; export DEB_BUILD_OPTIONS
+
 ###--------------------------------------------------------------------------
 ### Parse options.
 
+prog=${0##*/}
+
 usage () {
   cat <<EOF
-Usage: $0 [-vr] BUILDOPT
+Usage: $prog [-vr] BUILDOPT
 
 Build options:
 
   [no]checkout[=REV]
   [no]release
-  [no]setup
+  [no]setup[=RUNE]
   [no]distcheck
   [no]debian
-  [no]upload
+  [no]upload[=SERVER:PATH]
+  [no]dput[=TARGET]
   [no]clean
   [no]vpath
+  [no]sbuild[=SERVER]
+  [no]sign[=KEYID]
+  [no]native
 EOF
 }
 
@@ -85,27 +127,36 @@ done
 shift $((OPTIND - 1))
 
 ## Parse the build options.
-checkout=yes
-checkoutrev=HEAD
-build=test
-setup=yes
-distcheck=yes
-debian=yes
-upload=yes
-clean=yes
-vpath=yes
+maybe_set () {
+  var=$1 want=$2
+  eval "p=\${$want+t}\${$want-nil}"
+  case $p in
+    t) eval $var=yes ;;
+    nil) echo >&2 "$prog: $want not set"; exit 1 ;;
+  esac
+}
 for opt; do
   case "$opt" in
     checkout)  checkout=yes checkoutrev=HEAD ;;
     checkout=*) checkout=yes checkoutrev=${opt#*=} ;;
-    nocheckout) checkout=no ;;
     release)   build=release ;;
     norelease) build=test ;;
-
-    setup | distcheck | debian | upload | clean | vpath)
+    setup)     setup=yes setupcmd=mdw-setup ;;
+    setup=*)   setup=yes setupcmd=${opt#*=} ;;
+    upload)    maybe_set upload uploadpath ;;
+    upload=*)  upload=yes uploadpath=${opt#*=} ;;
+    sign)      maybe_set sign signkey ;;
+    sign=*)    sign=yes signkey=${opt#*=} ;;
+    sbuild)    maybe_set sbuild sbuildsrv ;;
+    sbuild=*)  sbuild=yes sbuildsrv=${opt#*=} ;;
+    dput)      maybe_set dput dputtarget ;;
+    dput=*)    dput=yes dputtarget=${opt#*=} ;;
+
+    distcheck | debian | clean | vpath | native)
       eval "$opt=yes"
       ;;
-    nosetup | nodistcheck | nodebian | noupload | noclean | novpath)
+    nocheckout | nosetup | nodistcheck | nodebian | \
+    noupload | nodput | noclean | novpath | nonative | nosbuild | nosign)
       eval "${opt#no}=no"
       ;;
     *)
@@ -192,8 +243,15 @@ while [ ! -f configure.ac -a ! -f configure.in -a \
 done
 assign srcpath $(pwd)
 
+## Build any necessary qualifiers.
+qual= sep=.
+case ${SBOX_SESSION_DIR+t},${DEB_BUILD_ARCH+t} in
+  t,t) qual=$qual$sep$DEB_BUILD_ARCH; sep=- ;;
+  t,*) fail "unknown build arch" ;;
+esac
+
 ## Construct the output directory.
-assign releasepath $srcpath/dist-$build
+assign releasepath $srcpath/dist-$build$qual
 chmod -R +w $releasepath 2>/dev/null || :
 rm -rf $releasepath 2>/dev/null || :
 mkdir $releasepath
@@ -217,7 +275,7 @@ case "$checkout,$setup,$(yesno [ -d $srcpath/.git ])" in
     cd $srcpath
     [ "$(git ls-files -m)" = "" ] ||
       warn "working tree has uncommitted changes"
-    gitver=$(git describe)
+    ;;
 esac
 
 ## Is there Debian build equipment?
@@ -226,18 +284,13 @@ case "$debian,$(yesno [ -d $srcpath/debian ])" in
     info "No debian directory found."
     debian=no debver=none
     ;;
-  yes,yes)
-    debver=$(dpkg-parsechangelog | sed -n 's/^Version: //p')
-    ;;
-esac
-
-## Check the version number.
-case "$gitver,$debver" in
-  none,* | *,none)
+  no,*)
+    debver=none
     ;;
-  *)
-    [ "$gitver" = "$debver" ] ||
-      warn "Git version $gitver doesn't match Debian version $debver"
+  yes,yes)
+    debver=$(dpkg-parsechangelog | sed -n 's/^Version: //p' | tr \~ -)
+    debsrc=$(dpkg-parsechangelog | sed -n 's/^Source: //p')
+    debname=$(git config user.name) debemail=$(git config user.email)
     ;;
 esac
 
@@ -249,13 +302,27 @@ case "$checkout" in
     assign srcpath $releasepath/_source
     cd $srcpath
     run git checkout -b mdw-build $checkoutrev
+    gitver=$(git describe --abbrev=4)
+    ;;
+esac
+
+## Check the version number.
+hack_dch_p=no
+case "$gitver,$debver" in
+  none,* | *,none)
+    ;;
+  *)
+    if [ "$gitver" != "$debver" ]; then
+      warn "Git version $gitver doesn't match Debian version $debver"
+      hack_dch=yes
+    fi
     ;;
 esac
 
 ## Maybe refresh the build machinery.
 case "$setup" in
   yes)
-    run mdw-setup
+    run $setupcmd
     ;;
 esac
 
@@ -302,36 +369,59 @@ esac
 
 cd $releasepath
 
-if ! tar tf $buildpath/$distdir.tar.gz 2>/dev/null | grep -q RELEASE; then
-  fail "missing RELEASE file in distribution"
-fi
+case $native in
+  yes)
+    if ! tar tf $buildpath/$distdir.tar.gz 2>/dev/null | grep -q RELEASE
+    then
+      fail "missing RELEASE file in distribution"
+    fi
+    ;;
+esac
 
 run mv $buildpath/$distdir.tar.gz .
-run gpg -u$(mdw-conf releasekey) -ab -o$distdir.tar.gz.gpg $distdir.tar.gz
+case $build,$sign in
+  release,yes)
+    run gpg -u$signkey -ab -o$distdir.tar.gz.gpg $distdir.tar.gz
+    ;;
+esac
 
 ## Maybe build the Debian packages.
 case "$debian" in
   yes)
     run tar xvfz $distdir.tar.gz
     cd $distdir
-    run dpkg-buildpackage -k$(mdw-conf releasekey)
+    case $hack_dch in
+      yes)
+       dver=$(echo $gitver | sed 's/-/+/; s/-/./g')
+       now=$(date -R)
+       cat - debian/changelog >debian/changelog.new <<EOF
+$debsrc ($dver) experimental; urgency=low
+
+  * Hacking in process, not intended for release.
+
+ -- $debname <$debemail>  $now
+
+EOF
+       mv debian/changelog.new debian/changelog
+       ;;
+    esac
+    case $sbuild,$build,$sign in
+      yes,release,yes) run mdw-sbuild -k$signkey $sbuildsrv ;;
+      yes,*) run mdw-sbuild $sbuildsrv ;;
+      no,release,yes) run dpkg-buildpackage -k$signkey ;;
+      no,*) run dpkg-buildpackage -us -uc ;;
+    esac
     ;;
 esac
 
 ## Maybe upload Debian packages.
 cd $releasepath
 case "$upload,$build" in
-  yes,test)
-    info "Test build: not uploading."
-    ;;
-  yes,release)
-    run rsync $distdir.tar.gz $distdir.tar.gz.gpg \
-      $(mdw-conf upload-target ftp.distorted.org.uk:~ftp/pub/mdw/)
-    case "$debian" in
-      yes)
-       run dput -f $(mdw-conf dput-target distorted) *.changes
-       ;;
-    esac
+  yes,test) info "Test build: not uploading." ;;
+  yes,release) run rsync $distdir.tar.gz $distdir.tar.gz.gpg $uploadpath ;;
+esac
+case "$debian,$upload,$dput,$build" in
+  yes,yes,yes,release) run dput -f $dputtarget *.changes ;;
 esac
 
 ## Tidy up.
diff --git a/bin/mdw-sbuild b/bin/mdw-sbuild
new file mode 100755 (executable)
index 0000000..5630dab
--- /dev/null
@@ -0,0 +1,111 @@
+#! /bin/sh -e
+###
+### Build a Debian package on an sbuild server.
+###
+### (c) 2016 Mark Wooding
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This program is free software; you can redistribute it and/or modify
+### it under the terms of the GNU General Public License as published by
+### the Free Software Foundation; either version 2 of the License, or
+### (at your option) any later version.
+###
+### This program is distributed in the hope that it will be useful,
+### but WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+### GNU General Public License for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with this program; if not, write to the Free Software Foundation,
+### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+###--------------------------------------------------------------------------
+### Some utilities.
+
+prog=${0##*/}
+
+fail () { echo >&2 "$prog: $*"; exit 1; }
+usage () { echo "usage: $prog [-ain] [-k KEYID] [-t TARGET] HOST"; }
+fail_usage () { usage >&2; exit 1; }
+
+###--------------------------------------------------------------------------
+### Parse options.
+
+bogusp=nil noactp=nil signp=nil
+unset buildopts
+while getopts "haik:nt:" opt; do
+  case $opt in
+    h)
+      usage
+      cat <<EOF
+
+Options:
+       -h              Show this help text.
+       -a              Build only architecture-dependent packages.
+       -i              Build only architecture-neutral packages.
+       -k KEYID        Sign the result using KEYID.
+       -n              Don't actually do the build.
+       -t TARGET       Build in TARGET build environment.
+EOF
+      exit 0
+      ;;
+    a) buildopts="${buildopts+$buildopts }-a" ;;
+    i) buildopts="${buildopts+$buildopts }-i" ;;
+    k) signp=t keyid=$OPTARG ;;
+    n) buildopts="${buildopts+$buildopts }-n" noactp=t ;;
+    t) buildopts="${buildopts+$buildopts }-t$OPTARG" ;;
+    *) bogusp=t ;;
+  esac
+done
+shift $(( $OPTIND - 1 ))
+case $# in
+  1) host=$1 ;;
+  *) bogusp=t ;;
+esac
+case $bogusp in t) fail_usage ;; esac
+case $noactp in t) signp=nil ;; esac
+
+###--------------------------------------------------------------------------
+### Main program.
+
+## Figure out the package name and version number.
+unset pkg ver
+while read tag value; do
+  case $tag in
+    Source:) pkg=$value ;;
+    Version:) ver=$value ;;
+  esac
+done <<EOF
+$(dpkg-parsechangelog)
+EOF
+case ${pkg+t} in t) ;; *) fail "can't figure out the package name" ;; esac
+case ${ver+t} in t) ;; *) fail "can't figure out the package version" ;; esac
+
+## Build a Debian source package.  Don't sign anything yet.  That will happen
+## at the end, all in one go.
+dpkg-buildpackage -S -uc -us
+cd ..
+dsc=${pkg}_${ver}.dsc
+[ -f "$dsc" ] || fail "where is my \`.dsc' file?"
+
+## Actually do the build.  Get a build directory assigned by the server,
+## upload the sources, run the build, and collect the results.
+builddir=$(ssh "$host" mdw-sbuild-server dir "$pkg/$ver")
+dcmd rsync -a "$dsc" "$host:$builddir/"
+set +e; ssh "$host" mdw-sbuild-server $buildopts build "$builddir"
+rc=$?; set -e
+rsync -a "$host:$builddir/" ./
+case $rc in 0) ;; *) exit $rc ;; esac
+
+## Merge the change files together, and maybe sign the result.
+chchch=${pkg}_${ver}_source.changes
+for i in "${pkg}_${ver}"_*.changes; do
+  case " $chchch " in *" $i "*) ;; *) chchch="$chchch $i" ;; esac
+done
+mergechanges -f $chchch
+rm $chchch
+case $signp in
+  t) debsign -k"$keyid" "${pkg}_${ver}_multi.changes" ;;
+esac
diff --git a/bin/mdw-sbuild-server b/bin/mdw-sbuild-server
new file mode 100755 (executable)
index 0000000..26043e6
--- /dev/null
@@ -0,0 +1,279 @@
+#! /bin/sh -e
+###
+### Build a Debian package on supported architectures
+###
+### (c) 2016 Mark Wooding
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This program is free software; you can redistribute it and/or modify
+### it under the terms of the GNU General Public License as published by
+### the Free Software Foundation; either version 2 of the License, or
+### (at your option) any later version.
+###
+### This program is distributed in the hope that it will be useful,
+### but WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+### GNU General Public License for more details.
+###
+### You should have received a copy of the GNU General Public License
+### along with this program; if not, write to the Free Software Foundation,
+### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+###--------------------------------------------------------------------------
+### Configuration.
+
+unset buildroot default_targets parallel
+for i in \
+  "/etc/mdw-sbuild.conf" \
+  "${XDG_CONFIG_HOME-$HOME/.config}/mdw-sbuild.conf"
+do
+  if [ -f "$i" ]; then . "$i"; fi
+done
+: ${buildroot=$HOME/build}
+: ${default_targets="wheezy-amd64 wheezy-i386"}
+: ${parallel=-j3}
+: ${DEB_BUILD_OPTIONS=parallel=4}; export DEB_BUILD_OPTIONS
+
+###--------------------------------------------------------------------------
+### Some utilities.
+
+prog=${0##*/}
+
+fail () { echo >&2 "$prog: $*"; exit 1; }
+usage () { echo "usage: $prog [-ain] [-t TARGET] COMMAND [ARGUMENTS ...]"; }
+fail_usage () { usage >&2; exit 1; }
+
+want_1 () {
+  what=$1 pat=$2 type=$3; shift 3
+  for i in "$@"; do
+    [ $type "$i" ] || fail "$what not found: \`$i'"
+  done
+  case $# in
+    1) ;;
+    *) fail "expected exactly one $what matching \`$pat', but found $#" ;;
+  esac
+  echo "$1"
+}
+
+###--------------------------------------------------------------------------
+### Parse options.
+
+bogusp=nil archp=nil indepp=nil makeopts=""
+unset targets
+
+while getopts "haint:" opt; do
+  case $opt in
+    h)
+      usage
+      cat <<EOF
+
+Options:
+       -h              Show this help text.
+       -a              Build only architecture-dependent packages.
+       -i              Build only architecture-neutral packages.
+       -n              Don't actually do the build.
+       -t TARGET       Build in TARGET build environment.
+
+Commands available:
+
+       dir PROJECT/VERSION
+               Return a freshly-made directory for the source code to
+               go in.
+
+       build BUILDDIR
+               Build the package placed in BUILDDIR, which should contain
+               exactly one \`.dsc' file, and whatever source archive files
+               are necessary.
+EOF
+      exit
+      ;;
+    a) archp=t ;;
+    i) indepp=t ;;
+    n) makeopts="${makeopts+$makeopts }-n" ;;
+    t) targets="${targets+$targets }$OPTARG" ;;
+    *) bogusp=nil ;;
+  esac
+done
+shift $(( $OPTIND - 1 ))
+
+case $bogusp in t) fail_usage ;; esac
+case $archp,$indepp in nil,nil) archp=t indepp=t ;; esac
+case ${targets+t} in t) ;; *) targets=$default_targets ;; esac
+
+###--------------------------------------------------------------------------
+### Main work.
+
+case "$#,$1" in
+  0,*) fail_usage ;;
+  *,*,*) fail "bad command name \`$1'" ;;
+
+  2,dir)
+    ## dirname PROJECT/VERSION
+
+    ## Try to create a fresh build directory.
+    dist=$2
+    case "$dist" in */*/*) fail "bad distribution name \`$dist'" ;; esac
+    proj=${dist%/*} ver=${dist#*/}
+    cd "$buildroot"
+    mkdir -p "$proj"
+    cd "$proj"
+    i=0
+    winp=nil
+    while [ $i -lt 50 ]; do
+      i=$(( $i + 1 ))
+
+      ## Find a sequence number different from all of the existing builds of
+      ## this version.
+      nn=1
+      for j in "$ver#"*; do
+       case "$j" in "$ver#*") break ;; esac
+       n=${j##*\#}
+       if [ $nn -le $n ]; then nn=$(( $n + 1 )); fi
+      done
+
+      ## Try to make the build directory.  This might not work if we're
+      ## racing with another process, but that's why we're trying in a loop.
+      if mkdir "$ver#$nn" >/dev/null 2>&1; then
+       winp=t
+       break
+      fi
+
+      ## Make sure it actually failed because a directory appeared, rather
+      ## than for some other reason.
+      [ -e "$ver#$nn" ] || \
+       fail "unexpectedly couldn't create \`$buildroot/$dist#$nn'"
+    done
+
+    ## Make sure we actually succeeded.
+    case $winp in t) ;; *) fail "failed to create build directory" ;; esac
+
+    ## Done.
+    echo "$buildroot/$dist#$nn"
+    ;;
+
+  *,dir)
+    echo >&2 "usage: $prog dir PROJECT/VERSION"; exit 1 ;;
+
+  2,build)
+    ## build BUILDDIR
+
+    ## Track down the build directory.
+    builddir=$2
+    cd "$builddir"
+    dsc=$(want_1 "file" "*.dsc" -f *.dsc)
+
+    ## Figure out which targets need building.  If the `.dsc' file isn't
+    ## telling, assume it needs building everywhere and let sbuild(1) sort
+    ## out the mess.
+    os=$(dpkg-architecture -qDEB_HOST_ARCH_OS)
+    unset first rest; anyp=nil depp=nil allp=nil
+    wantarchs=$(sed -n '/^[Aa]rchitecture:/ s/^[^:]*: *//p' "$dsc")
+    : ${wantarchs:=any}
+
+    ## Work through the available targets assigning builds to them.  This is
+    ## actually a little tricky.
+    for t in $targets; do
+
+      ## Work through the architectures which we can build.
+      for arch in $wantarchs; do
+       case $arch in
+         all)
+           ## Package suitable for all architectures.
+
+           ## If we don't want to build architecture-neutral packages then
+           ## there's nothing to do.
+           case $indepp in nil) continue ;; esac
+
+           ## Pick this up if nobody has volunteered.  However, we should be
+           ## ready to let some other architecture build this if it's going
+           ## to build some architecture-dependent package too.
+           case $anyp in nil) first=$t anyp=t allp=t ;; esac
+           ;;
+         *)
+           ## There's at least one architecture-specific package.
+
+           ## If we don't want to build architecture-specific package then
+           ## there's nothing to do.
+           case $archp in nil) continue ;; esac
+
+           ## If we can't build it then we shouldn't try.
+           if ! dpkg-architecture -a"$os-${t#*-}" -i"$arch"; then
+             continue
+           fi
+
+           ## Decide whether we should take responsibility for the
+           ## architecture-neutral packages.  If nobody's claimed them yet,
+           ## or the previous claimant wasn't building architecture-specific
+           ## packages, we should take over.
+           case $depp in
+             nil) first=$t depp=t anyp=t ;;
+             t) rest="${rest+$rest }$t" ;;
+           esac
+           ;;
+       esac
+      done
+    done
+
+    ## If we never found a match then we can't do anything.
+    case $anyp in nil) echo "$prog: no packages to build"; exit 0 ;; esac
+
+    ## Figure out the right options to use.
+    case $indepp in
+      t) firstopt="--arch-all" ;;
+      nil) firstopt="--no-arch-all" ;;
+    esac
+    case $archp in
+      t) ;;
+      nil) firstopt="$firstopt --debbuildopt=-A" ;;
+    esac
+
+    ## Build a cheesy makefile to run these in parallel.
+    cat >build.mk <<EOF
+### -*-makefile-*-
+DSC = $dsc
+FIRST = $first
+REST = $rest
+sbuild-wrap = \\
+       t=\$@; \\
+       { echo started >build-status.\$\$t; \\
+         sbuild \\
+               --dist=\$\${t%-*} --arch=\$\${t\#*-} \\
+               --chroot=\$@ --verbose \$1 \$(DSC); \\
+         rc=\$\$?; case \$\$rc in \\
+           0) echo ok >build-status.\$\$t ;; \\
+           *) echo failed rc=\$\$rc >build-status.\$\$t ;; \\
+         esac; } | \\
+       while IFS= read -r line; do \\
+         printf "%s: %s\n" "\$\$t" "\$\$line"; \\
+       done; \\
+       read st _ <build-status.\$\$t && \\
+       case \$\$st in ok) exit 0 ;; *) exit 1 ;; esac
+all: \$(FIRST) \$(REST)
+\$(FIRST):; \$(call sbuild-wrap,$firstopt)
+\$(REST):; \$(call sbuild-wrap,--no-arch-all)
+EOF
+
+    ## Make some marker files to say things are in progress.
+    for i in $first $rest; do echo "starting" >build-status.$i; done
+
+    ## And we're ready to go.
+    mkfifo pipeout
+    cat pipeout& catpid=$!
+    set +e; make -fbuild.mk $parallel $makeopts -k all >pipeout
+    rc=$?; set -e
+    wait $!
+    rm build.mk pipeout build-status.*
+    find . -maxdepth 1 -type l -exec rm {} \;
+    exit $rc
+    ;;
+  build,*)
+    echo >&2 "usage: $prog build BUILDDIR"; exit 1 ;;
+
+  *)
+    fail "unknown command \`$1'"
+    ;;
+esac
+
+###----- That's all, folks --------------------------------------------------
diff --git a/bin/run-with-shell-env b/bin/run-with-shell-env
new file mode 100755 (executable)
index 0000000..ba0afcf
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/bash -x
+exec >/tmp/mdw/hacky.log 2>&1
+case ${__mdw_profile+t} in
+  t) ;;
+  *)
+    __mdw_force_secure_session=yes
+    export SHELL=/bin/bash USER=$(/bin/id -un)
+    set +x
+    . $HOME/.bash_profile
+    set -x
+    ;;
+esac
+exec "$@"
diff --git a/bin/start-ssh-pageant b/bin/start-ssh-pageant
new file mode 100755 (executable)
index 0000000..cb704dd
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh -ex
+PATH=/bin:$HOME/bin:$PATH
+eval $(tmpdir -b)
+sockdir=${TMPDIR?}/.ssh-agent.$(hostname).${USER-$(id -un)}
+if [ -S $sockdir/sock ]; then
+  set +e; ssh-add -l >/dev/null 2>&1; rc=$?; set -e
+  case $rc in 0) exit 0 ;; esac
+  kill $(cat $sockdir/pid) || :
+  rm -f $sockdir/pid $sockdir/sock
+fi
+mkdir -p -m700 $sockdir
+(cd /; exec run ssh-pageant -d -a$sockdir/sock >/dev/null 2>&1)&
+echo $! >$sockdir/pid
diff --git a/bin/update-buildable-branch b/bin/update-buildable-branch
new file mode 100755 (executable)
index 0000000..b7f71ff
--- /dev/null
@@ -0,0 +1,110 @@
+#! /bin/sh -e
+
+fail () {
+  echo >&2 "$0: $*"
+  exit 1
+}
+
+usage () {
+  echo "usage: $0 [-c] [UPSTREAM BUILDABLE]"
+}
+
+fail_usage () {
+  usage >&2
+  exit 1
+}
+
+## Parse the command-line.
+bogusp=nil createp=nil
+unset head new
+while getopts "ch" opt; do
+  case $opt in
+    h) usage; exit 0 ;;
+    c) createp=t ;;
+    *) bogusp=t ;;
+  esac
+done
+shift $(( $OPTIND - 1 ))
+case $# in 0) ;; 1) bogusp=t ;; *) head=$1 new=$2; shift 2 ;; esac
+case $# in 0) ;; *) bogusp=t ;; esac
+case $bogusp in nil) ;; *) fail_usage ;; esac
+
+## Get the current branch name.
+case ${head+t} in
+  t) ;;
+  *)
+    head=$(git symbolic-ref HEAD)
+    case $head in
+      refs/heads/*) head=${head#refs/heads/} ;;
+      *) fail "HEAD is not at a branch head" ;;
+    esac
+    case $head in
+      buildable/*) fail "upstream is already a buildable branch" ;;
+    esac
+    ;;
+esac
+
+## Get the output branch name.
+case ${new+t} in
+  t) ;;
+  *)
+    new=buildable/$head
+    ;;
+esac
+case $createp in
+  t)
+    if git rev-parse $new -- >/dev/null 2>&1; then
+      fail "branch $new already exists"
+    fi
+    old=0000000000000000000000000000000000000000
+    ;;
+  nil)
+    old=$(git rev-parse $new --)
+    ;;
+esac
+
+## Make a temporary place.
+git=$(git rev-parse --git-dir)
+git=$(cd $git && pwd)
+dir=$(mktemp -d)
+trap "cd; rm -rf \"$dir\"" EXIT INT TERM
+cd "$dir"
+mkdir work tmp
+
+## Make a nice clean checkout.
+GIT_INDEX_FILE=$dir/idx; export GIT_INDEX_FILE
+GIT_DIR=$git; export GIT_DIR
+GIT_WORK_TREE=$dir/work; export GIT_WORK_TREE
+git read-tree "$head^{}"
+git checkout-index --all
+
+## Go in, and set stuff up.  The business with `RELEASE' is kinda scungy.
+## Sorry 'bout that.
+cd work
+if ! ver=$(git describe --abbrev=4 "$head^{}" 2>/dev/null); then
+  ver=UNKNOWN
+fi
+echo "$ver" >RELEASE
+mdw-setup
+rm -rf autom4te.cache/ RELEASE
+
+## Pick through newly added symlinks and snap them to real files.
+git ls-files -o | while read f; do
+  if [ -L "$f" ]; then
+    cp "$f" ../tmp/snap
+    mv ../tmp/snap "$f"
+  fi
+done
+
+## Add the new files to the tree.
+commit () {
+  tree=$1; shift
+  case $createp in
+    t) git commit-tree -p "$head^{}" "$@" $tree ;;
+    nil) git commit-tree -p "$new" -p "$head^{}" "$@" $tree ;;
+  esac
+}
+git ls-files -oz | xargs -0r git add -f
+tree=$(git write-tree)
+commit=$(commit $tree -m "Update automatically managed build utilities.")
+git update-ref "refs/heads/$new" $commit $old
diff --git a/bin/xpra-start-xdummy b/bin/xpra-start-xdummy
new file mode 100755 (executable)
index 0000000..c8e9d16
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/sh -e
+
+dpy=${1?display}; shift
+exec xpra --xvfb="Xorg -dpi 75 -noreset -nolisten tcp \
+       +extension GLX +extension RANDR +extension RENDER \
+       -config /usr/share/doc/xpra/examples/dummy.xorg.conf \
+       -logfile $HOME/.xpra/xserver-$dpy.log" \
+       "$@" start :$dpy
index 10320e750ade21cc99ce35a8b120e4f02f7c4201..277695d7b7e747c47a171a9a3a37fe4e5889a3b3 100644 (file)
@@ -79,13 +79,14 @@ Emacs.fontBackend:          x,xft
 Emacs.cursorColor:             red
 Emacs.bitmapIcon:              true
 Emacs*foreground:              white
-Emacs*background:              black
+Emacs*background:              darkblue
 Emacs.pane.menubar.foreground: black
 Emacs.pane.menubar.background: lightgrey
 Emacs.menu*foreground:         black
 Emacs.menu*background:         lightgrey
 Emacs.scrollbar*attributeBackground: lightgrey
 Emacs.toolBar:                 0
+Emacs.menuBar:                 on
 Emacs.verticalScrollBars:      right
 
 !! VNC.
index d75c82016800cd1786967c8cd6237ed930657005..4ce6280b9d33241b06c0724a69a71ab014941a43 100644 (file)
@@ -56,7 +56,7 @@ __mdw_programp () { type -t >/dev/null "$1"; }
 ## changes directory and displays the name of the directory in a subshell to
 ## avoid changing the current state.
 HOME=`(set -P; cd $HOME; pwd)`
-cd $HOME
+[ -n "$SCHROOT_SESSION_ID" ] || cd $HOME
 
 ## CDE's session structure is demented and doesn't leave us with a proper
 ## logout hook, so synthesize one here.
@@ -113,6 +113,8 @@ export QMAILINJECT=c
 export MDW_EDITOR=ed
 emacs_startup_args="--no-site-file --mdw-fast-startup -nw"
 for ed in \
+       "emacs23 $emacs_startup_args" \
+       "emacs24 $emacs_startup_args" \
        "emacs22 $emacs_startup_args" \
        "emacs21 $emacs_startup_args" \
        zile mg \
@@ -185,7 +187,7 @@ __mdw_programp distcc && export CCACHE_PREFIX=distcc
 ## graphical one.
 browsers="elinks w3m lynx"
 case "${DISPLAY+t}" in
-  t) browsers="mdw-chrome iceweasel firefox $browsers" ;;
+  t) browsers="mdw-iceweasel mdw-chrome iceweasel firefox $browsers" ;;
 esac
 for i in $browsers; do
   if __mdw_programp $i; then
index f9485c0b3618b63efb568e9c12dbcb395120b8fe..8dc678b308c1bf2e9830ed21326e8193b4f91141 100644 (file)
@@ -63,12 +63,16 @@ if [ -t 0 ]; then
   fi
 
   ## If this session is insecure then highlight that.
-  if [ -z "$SSH_CLIENT" ] &&
-    [ "$__mdw_sechost" != "`hostname`" ]
-    then
+  if [ -z "$SSH_CLIENT" ] && [ -z "$SCHROOT_CHROOT_NAME" ] &&
+     [ "$__mdw_sechost" != "`hostname`" ]
+  then
     sec_l='(' sec_r=')'
   fi
 
+  ## If this is an schroot environment then point this out.
+  hqual=""
+  hqual="$hqual${SCHROOT_CHROOT_NAME+/$SCHROOT_CHROOT_NAME}"
+
   ## Build the prompt string.
   git="" rc=""
   if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
@@ -78,10 +82,10 @@ if [ -t 0 ]; then
     rc="$unbold$rccolour\$(rc=\$?;case \$rc in 0);;"
     rc="$rc*)echo -n \" rc=\$rc\";;esac;exit \$rc)$uncolour$bold"
   fi
-  PS1="$nl$bold$left$sec_l$u\\h$sec_r \\w$git$rc$marker$right$unbold"
+  PS1="$nl$bold$left$sec_l$u\\h$hqual$sec_r \\w$git$rc$marker$right$unbold"
   PS2="$PS1 $bold>$unbold "
   unset nl bold unbold left right sec_l sec_r marker
-  unset gitcolour rccolour uncolour git rc
+  unset gitcolour rccolour uncolour git rc hqual
 fi
 
 ###--------------------------------------------------------------------------
index ebb44cefc600d48a367961f79a798273438d6957..4252cb758e937a4189302dd54e416f8044920007 100644 (file)
@@ -40,11 +40,13 @@ KeyDown    5      Tab focus next
 KeyDown    5     plus desk next
 KeyDown    5    minus desk prev
 KeyDown   C5        a desk arrange
+KeyDown   C5        c exec xsetroot -cursor_name left_ptr
 KeyDown   C5        f wop * fullscreen
 KeyDown   C5        g magwin show
 KeyDown   C5        h wop * tw available
 KeyDown   C5        i wop * iconify
 KeyDown   C5        k wop * kill
+KeyDown          C5        l exec xrepaint -a
 KeyDown   C5        m wop * ts available
 KeyDown   C5        r wop * shade
 KeyDown   C5        s wop * stick
index e7ba08656c1361485b9ec8f8762ecbad9b9be93e..c0257de512bc0790df8279260b69801241e18b66 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
@@ -84,7 +84,7 @@
 
 (require 'paren)
 (trap (show-paren-mode t))
-(or window-system (menu-bar-mode -1))
+(or window-system (mdw-emacs-version-p 22) (menu-bar-mode -1))
 
 ;; Multiple cursors.
 
 (autoload 'mdw-multiple-cursors-keymap "mdw-multiple-cursors.el"
   "A keymap for Magnar Sveen's awesome multiple-cursors." nil 'keymap)
 
+;; Rust mode.
+
+(setq load-path (nconc load-path (list "~/lib/emacs/rust-mode/")))
+(autoload 'rust-mode "rust-mode" nil t)
+(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
+
 ;; Temporary directory handling.
 
 (defun mdw-check-dir-exists (dir)
 
 ;; Emacs server behaviour.
 
-(and (or window-system (>= emacs-major-version 23))
+(and (or window-system (mdw-emacs-version-p 23))
      (progn (setq server-temp-file-regexp (concat "^" tmpdir "\\|/draft$")
                  edit-server-new-frame nil
                  gnuserv-frame t)
 
 (setq mdw-backup-disable-regexps
       '("/\\.git/COMMIT_EDITMSG$"
-       "/\\.stgit\\(-edit\\.txt\\|msg\\.txt\\|\\.msg\\)$"))
+       "/\\.stgit\\(-edit\\.txt\\|msg\\.txt\\|\\.msg\\)$"
+       "^/tmp/" "^/var/tmp/"))
 
 ;; Safe variables.
 
 
 (or mdw-fast-startup
     (trap (bbdb-initialize 'gnus 'sendmail 'message)))
-(setq bbdb-north-american-phone-numbers-p nil)
+(setq bbdb-file "~/etc/brain/bbdb"
+      bbdb-north-american-phone-numbers-p nil
+      bbdb/news-auto-create-p
+      (lambda ()
+       (let ((group gnus-newsgroup-name))
+         (and (string-match "^nnimap\\+" group)
+              (not (string-match ":\\(crap\\|spam\\)\\." group)))))
+      bbdb-user-mail-names
+      (concat "^"
+             "\\(" "\\(mdw\\|markw\\|root\\|postmaster\\)"
+                   "\\([-+][^@]*\\|\\)"
+                   "@\\(\\(dist\\|esc\\)orted\\.org\\.uk\\|odin\\.gg\\)"
+             "\\|" "distorted\\.mdw@g\\(\\|oogle\\)mail.com"
+             "\\|" "mwooding@\\(good\\|blackberry\\)\\.com"
+             "\\)$")
+      bbdb-canonicalize-net-hook
+      (lambda (addr)
+       (cond ((string-match (concat "^reply-[0-9a-f]+-[0-9a-f]+_"
+                                    "HTML-[0-9]+-[0-9]+-[0-9]+"
+                                    "@\\(nationwide-communications\\.co\\.uk\\)")
+                            addr)
+              (concat "nationwide@" (match-string 1 addr)))
+             ((string-match (concat "^[0-9]+@bugs\\."
+                                    "\\(" "debian\\.org"
+                                    "\\|" "distorted\\.org\\.uk"
+                                    "\\)")
+                            addr)
+              (concat "submit@bugs." (match-string 1 addr)))
+             (t addr))))
 
 ;; Customization.
 
 ;;;--------------------------------------------------------------------------
 ;;; Calendar configuration.
 
-(setq diary-file "~/etc/diary")
+(setq diary-file
+      (let ((main-diary "~/etc/brain/diary")
+           (index "~/etc/index.diary"))
+       (if (file-exists-p index)
+           index
+         main-diary)))
 
 ;; Trivial stuff for the sunrise/sunset calculations.
 
 
 ;; Date format fiddling.
 
-(setq european-calendar-style t)
-
-(setq diary-date-forms '((day "[-/]" month "[^-/0-9]")
-                        (day " *" monthname "[ \t]*\\(\^M\\|\n\\)")
-                        (backup day " *" monthname "\\W+\\<[^*0-9]")
-                        (day "[-/]" month "[-/]" year "[^0-9]")
-                        (day " *" monthname " *" year "[^0-9]")
-                        (year "[-/]" month "[-/]" day "[^0-9]")
-                        (dayname "\\W")))
+(setq european-calendar-style t
+      calendar-date-style 'european
+      calendar-time-display-form
+      '(24-hours ":" minutes
+       (if time-zone " (") time-zone (if time-zone ")")))
+
+(setq diary-date-forms
+      '((day "[-/]" month "[^-/0-9]")
+       (day " *" monthname "[ \t]*\\(\^M\\|\n\\)")
+       (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|[0-9]+[:aApP]\\)")
+       (day "[-/]" month "[-/]" year "[^0-9]")
+       (day " *" monthname " *" year "[^0-9]")
+       (year "[-/]" month "[-/]" day "[^0-9]")
+       (dayname "\\W")))
 
 ;; Fancy diary handling.
 
 (add-hook 'diary-display-hook 'fancy-diary-display)
 (setq diary-list-include-blanks t)
-(add-hook 'list-diary-entries-hook 'sort-diary-entries t)
-(add-hook 'list-diary-entries-hook 'include-other-diary-files)
-(add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
+(cond ((mdw-emacs-version-p 23 1)
+       (add-hook 'list-diary-entries-hook 'diary-include-other-diary-files)
+       (add-hook 'mark-diary-entries-hook 'diary-mark-included-diary-files))
+      (t
+       (add-hook 'list-diary-entries-hook 'include-other-diary-files)
+       (add-hook 'mark-diary-entries-hook 'mark-included-diary-files)))
 
 ;; Appointment management.
 
 (setq appt-issue-message t)
 (setq appt-display-interval 3)
 (setq appt-message-warning-time 10)
+(and (not mdw-fast-startup)
+     (trap (appt-activate 1)))
 
 ;; Org-mode agenda.
 
 (setq org-agenda-include-diary t
-      org-tags-column -77)
+      org-directory "~/etc/brain.local/"
+      org-default-notes-file (concat org-directory "local.org")
+      org-tags-column -77
+      org-agenda-align-tags-to-column org-tags-column)
 
 ;; Cosmetic stuff.
 
-(setq calendar-view-diary-initially-flag t
-      calendar-view-holidays-initially-flag t)
+(setq calendar-view-diary-initially-flag nil
+      calendar-view-holidays-initially-flag nil
+      calendar-mark-diary-entries-flag t)
 
 (setq display-time-24hr-format t)
 (display-time)
 (column-number-mode 1)
-(trap (if window-system (calendar)))
+(trap
+  (if window-system
+      (let ((calendar-view-diary-initially-flag t))
+       (calendar))))
 
 ;;;--------------------------------------------------------------------------
 ;;; MailCrypt.
 ;; Default frame size.
 
 (setq default-frame-alist
-      (mdw-uniquify-alist
-       `((width . ,(if (>= emacs-major-version 21) 77 78))
-        (height . 33)
-        (vertical-scroll-bars . right)
-        (cursor-type . bar)
-        (cursor-blink . t)
-        (left-fringe . 5)
-        (right-fringe . 5)
-        (scroll-bar-width . 15)
-        (cursor-color . "red")
-        (background-mode . ,(if mdw-black-background 'dark 'light)))))
-(setq window-system-default-frame-alist
+      `((width . ,(if (>= emacs-major-version 21) 77 78))
+       (height . 33)
+       (vertical-scroll-bars . right)
+       (cursor-type . bar)
+       (cursor-blink . t)
+       (left-fringe . 5)
+       (right-fringe . 5)
+       (scroll-bar-width . 15)
+       (tool-bar-lines . 0)
+       (menu-bar-lines . 1)
+       (cursor-color . "red")
+       (background-mode . ,(if mdw-black-background 'dark 'light)))
+      initial-frame-alist
+      `((width . ,(if (>= emacs-major-version 21) 77 78))
+       (menu-bar-lines . ,(if window-system 1 0)))
+      window-system-default-frame-alist
       '((pm (font . "-os2-System VIO-medium-r-normal--*-40-*-*-m-*-cp850")
            (menu-font . "8.Helv")
            (background-color . "lightgrey"))
+       (w32 (font . "fixed613 10")
+            (background-color . "black")
+            (foreground-color . "white"))
        (nil (menu-bar-lines . 0))))
 
 ;; Other frame fiddling.
 (setq windmove-wrap-around t)
 (trap (iswitchb-mode))
 (progn
-  (global-set-key [?\C-x ?w left] 'windmove-left)
-  (global-set-key [?\C-x ?w ?h] 'windmove-left)
-  (global-set-key [?\C-x ?w up] 'windmove-up)
-  (global-set-key [?\C-x ?w ?k] 'windmove-up)
-  (global-set-key [?\C-x ?w down] 'windmove-down)
-  (global-set-key [?\C-x ?w ?j] 'windmove-down)
-  (global-set-key [?\C-x ?w right] 'windmove-right)
-  (global-set-key [?\C-x ?w ?l] 'windmove-right)
-  (global-set-key [?\C-x ?g ?l] 'org-store-link)
-  (global-set-key [?\C-x ?g ?a] 'org-agenda)
-  (global-set-key [?\C-x ?g ?b] 'org-iswitchb)
-  (global-set-key [?\C-x ?t ?i] 'timeclock-in)
-  (global-set-key [?\C-x ?t ?c] 'timeclock-change)
-  (global-set-key [?\C-x ?t ?o] 'timeclock-out)
-  (global-set-key [?\C-x ?t ?r] 'timeclock-reread-log)
-  (global-set-key [?\C-x ?t ?w] 'timeclock-workday-remaining-string)
-  (global-set-key [?\C-x ?t ?s] 'timeclock-status-string)
-  (global-set-key [?\C-x ?t ?p] 'nc-timesheet-prepare)
-  (global-set-key [?\C-x ?t ?\C-m] 'nc-timesheet-submit)
+  (global-set-key [?\e ?\e] 'mdw-wrong)
+  (global-set-key [?\e ?\C-\] ?\C-\]] 'keyboard-escape-quit)
+  (global-set-key [?\C-c ?w left] 'windmove-left)
+  (global-set-key [?\C-c ?w ?h] 'windmove-left)
+  (global-set-key [?\C-c ?w up] 'windmove-up)
+  (global-set-key [?\C-c ?w ?k] 'windmove-up)
+  (global-set-key [?\C-c ?w down] 'windmove-down)
+  (global-set-key [?\C-c ?w ?j] 'windmove-down)
+  (global-set-key [?\C-c ?w right] 'windmove-right)
+  (global-set-key [?\C-c ?w ?l] 'windmove-right)
+  (global-set-key [?\C-c ?g ?l] 'org-store-link)
+  (global-set-key [?\C-c ?g ?a] 'org-agenda)
+  (global-set-key [?\C-c ?g ?b] 'org-iswitchb)
+  (global-set-key [?\C-c ?t ?i] 'timeclock-in)
+  (global-set-key [?\C-c ?t ?c] 'timeclock-change)
+  (global-set-key [?\C-c ?t ?o] 'timeclock-out)
+  (global-set-key [?\C-c ?t ?r] 'timeclock-reread-log)
+  (global-set-key [?\C-c ?t ?w] 'timeclock-workday-remaining-string)
+  (global-set-key [?\C-c ?t ?s] 'timeclock-status-string)
   (global-set-key [?\C-x ?3] 'mdw-split-window-horizontally)
   (global-set-key [?\M-#] 'calc-dispatch)
   (global-set-key [?\C-x ?/] 'auto-fill-mode)
                  #'(lambda () (interactive)))
   (global-set-key [M-S-mouse-3] 'imenu)
   (global-set-key [XF86WakeUp] "")
+  (global-set-key [?\C-c ?d ?w] 'devhelp-word-at-point)
+  (global-set-key [?\C-c ?d ?a] 'devhelp-assistant-word-at-point)
+  (global-set-key [f11] 'mdw-toggle-full-screen)
   (and (not mdw-fast-startup) (fboundp 'hippie-expand)
        (global-set-key [?\M-/] 'hippie-expand)))
 
 (or mdw-fast-startup
     (trap (progn
            (org-remember-insinuate)
-           (global-set-key [?\C-c ?o ?r] 'org-remember))))
+           (global-set-key [?\C-c ?g ?r] 'org-remember))))
 
 ;; Minor mode listing
 
                ("@BASH@" . sh-mode)
                ("@PYTHON@" . python-mode)
                ("@PERL@" . cperl-mode)
+               ("perl" . cperl-mode)
                ("@TCLSH@" . tcl-mode)
                ("@WISH@" . tcl-mode)
-               ("/tclsh" . tcl-mode)
-               ("/wish" . tcl-mode))
+               ("tclsh" . tcl-mode)
+               ("wish" . tcl-mode))
              interpreter-mode-alist))
 
 (setq completion-ignored-extensions
        tcl-mode-hook go-mode-hook js-mode-hook javascript-mode-hook
        conf-mode-hook m4-mode-hook autoconf-mode-hook autotest-mode-hook
        a68-mode-hook a68-mode-hooks asm-mode-hook fsharp-mode-hook
-       scala-mode-hook TeX-mode-hook LaTeX-mode-hook
+       scala-mode-hook rust-mode-hook TeX-mode-hook LaTeX-mode-hook
        TeXinfo-mode-hook tex-mode-hook latex-mode-hook
        texinfo-mode-hook emacs-lisp-mode-hook scheme-mode-hook
        lisp-mode-hook lisp-interaction-mode-hook makefile-mode-hook
   (add-hook 'linux-c-mode-hook #'(lambda () (setq c-basic-offset 8)))
   (add-hook 'asm-mode-hook 'mdw-fontify-asm t)
   (add-hook 'go-mode-hook 'mdw-fontify-go t)
+  (add-hook 'rust-mode-hook 'mdw-fontify-rust t)
 
   (add-hook 'icon-mode-hook 'mdw-fontify-icon t)
 
index d5b13437834f5f8d542b49c51fbf431e60521b93..a71e415e74f71367a8d477cc7347a39136e6e373 100644 (file)
@@ -5,16 +5,14 @@
 
   <!-- Hacking for the fixed font.
 
-       After many half-hearted attempts to make this work properly, I'm
-       finally settling on this approach: define MiscFixed6x13 as a
-       magic name for the right font, and then hack configuration files
-       as necessary to make them use it.
+       Firstly, make sure that Fixed fonts aren't filtered out when building
+       the font cache.  Secondly, arrange that requests for Fixed find the
+       Trad version by preference.
     -->
   <selectfont>
     <acceptfont>
       <pattern>
        <patelt name="family"><string>Fixed</string></patelt>
-       <patelt name="width"><int>87</int></patelt>
       </pattern>
     </acceptfont>
     <rejectfont>
     </rejectfont>
   </selectfont>
   <match target="pattern">
-    <test name="family"><string>MiscFixed6x13</string></test>
-    <test name="slant" compare="more_eq"><int>10</int></test>
-    <!-- edit name="size"><double>12</double></edit -->
-    <edit name="style"><string>Oblique SemiCondensed</string></edit>
-    <edit name="width"><int>87</int></edit>
-    <edit name="family"><string>Fixed</string></edit>
-    <edit name="foundry"><string>Trad</string></edit>
-    <edit name="dpi"><int>75</int></edit>
-    <edit mode="assign" name="pixelsize"><double>13</double></edit>
+    <test name="family"><string>Fixed</string></test>
+    <edit name="dpi" mode="prepend_first"><int>75</int></edit>
   </match>
   <match target="pattern">
-    <test name="family"><string>MiscFixed6x13</string></test>
-    <test name="weight" compare="more_eq"><int>150</int></test>
-    <!-- edit name="size"><double>12</double></edit -->
-    <edit name="style"><string>Bold SemiCondensed</string></edit>
-    <edit name="width"><int>87</int></edit>
-    <edit name="family"><string>Fixed</string></edit>
-    <edit name="foundry"><string>Trad</string></edit>
-    <edit name="dpi"><int>75</int></edit>
-    <edit mode="assign" name="pixelsize"><double>13</double></edit>
+    <test name="family"><string>Fixed</string></test>
+    <test name="size" compare="more_eq"><double>12</double></test>
+    <test name="size" compare="less_eq"><double>14</double></test>
+    <edit name="foundry" mode="prepend_first"><string>Trad</string></edit>
+    <edit name="size"><double>13</double></edit>
+    <edit name="pixelsize"><double>13</double></edit>
+    <edit name="width"><const>semicondensed</const></edit>
   </match>
   <match target="pattern">
-    <test name="family"><string>MiscFixed6x13</string></test>
-    <!-- edit name="size"><double>12</double></edit -->
-    <edit name="style"><string>SemiCondensed</string></edit>
-    <edit name="width"><int>87</int></edit>
-    <edit name="family"><string>Fixed</string></edit>
-    <edit name="foundry"><string>Trad</string></edit>
-    <edit name="dpi"><int>75</int></edit>
-    <edit mode="assign" name="pixelsize"><double>13</double></edit>
-  </match>
-
-  <match target="pattern">
-    <test name="family"><string>Symbol</string></test>
-    <edit name="foundry"><string>urw</string></edit>
+    <test name="family"><string>Fixed</string></test>
+    <test name="pixelsize" compare="more_eq"><double>10</double></test>
+    <test name="pixelsize" compare="less_eq"><double>14</double></test>
+    <edit name="foundry" mode="prepend_first"><string>Trad</string></edit>
+    <edit name="size"><double>13</double></edit>
+    <edit name="pixelsize"><double>13</double></edit>
+    <edit name="width"><const>semicondensed</const></edit>
   </match>
 
   <!-- Hacking for the symbol font.
@@ -67,7 +50,8 @@
        right thing with MathML and suchlike.
     -->
   <match target="pattern">
-    <test name="family"><string>symbol</string></test>
+    <test name="family"><string>Symbol</string></test>
+    <edit name="foundry"><string>urw</string></edit>
     <edit binding="strong" mode="append" name="family">
       <string>Standard Symbols L</string>
     </edit>
index 47fa3920869aaed796ee3c3ed62d7b7eda91ea54..c642c132ffe246c8aae766720621b4acaf95b00e 100644 (file)
@@ -12,6 +12,9 @@
        email = mdw@distorted.org.uk
        signingkey = @releasekey@
 
+[annex]
+       sshcaching = false
+
 [merge]
        summary = true
        tool = emerge
@@ -34,6 +37,9 @@
 [rebase]
        autosquash = true
 
+[push]
+       default = matching
+
 [format]
        headers = "Organization: Straylight/Edgeware\n"
 
 
 [gui]
        fontui = -family Sans -size 10
-       fontdiff = -family MiscFixed6x13 -size 10
+       fontdiff = -family Fixed -size 13
index 21b65e332a2eac738851edd4fbe07735d4f150a9..64dced6fda1f5db618668f32124f693afeee9802 100644 (file)
           smtpmail-starttls-credentials
           '(("mail.distorted.org.uk" 587 "" ""))))
 
+;;;--------------------------------------------------------------------------
+;;; News via chiark.
+
+;; Currently we assume an SSH tunnel.  This will be fixed later.
+(setq gnus-select-method
+      '(nntp "chiark-ssh-kludge"
+            (nntp-open-connection-function nntp-open-authinfo-kludge)
+            (nntp-address "localhost:10119")
+            (nntp-authinfo-generic "md5cookie1way chiark")))
+
 ;;;--------------------------------------------------------------------------
 ;;; Where we get mail from.
 
                (nnimap-address "mail.distorted.org.uk")
                (nnimap-stream tls)
                (nnimap-authinfo-file "~/.gnus.authinfo"))
+       (nnimap "markw-distorted"
+               (nnimap-address "mail.distorted.org.uk")
+               (nnimap-stream tls)
+               (nnimap-authinfo-file "~/.gnus.authinfo.markw"))
        (nnimap "google"
                (nnimap-address "imap.gmail.com")
                (nnimap-stream tls)
 ;; General splitting configuration.
 (setq nnimap-split-inbox '("INBOX" "to.split")
       nnimap-split-rule 'nnimap-split-fancy
-      nnimap-split-crosspost t
+      nnimap-split-methods 'nnimap-split-fancy
+      nnmail-split-methods 'nnmail-split-fancy
       nnimap-split-predicate "UNDELETED"
+      nnimap-split-crosspost t
+      nnmail-split-crosspost t
       nnmail-split-fancy-match-partial-words nil)
 
 ;; Automatic expiry for particular groups.
 (setq gnus-auto-expirable-newsgroups
       "^nnimap\\+distorted:\\(crap\\|spam\\|admin\\|lists\\|nag\\)\\..*")
 
+;; My various email addresses.
+(setq message-alternative-emails bbdb-user-mail-names
+      message-dont-reply-to-names message-alternative-emails)
+
 ;; Mail sent to `mdw-nospam-THING' should appear to come from this address.
 (setq gnus-posting-styles
       '(((and (string-match "^nnimap\\+distorted:crap\\.\\(.*\\)$"
         ("From" mdw-from-address))))
 
 ;; The actual splitting rules.
-(setq nnimap-split-fancy
-      '(| (to "\\<\\(news\\|newsmaster\\|usenet\\)@" "admin.news" t)
-         (to "\\<hostmaster@" "admin.dns" t)
-         (to "\\<postmaster@" "admin.mail" t)
-         (to "\\<\\(root\\|mirror\\|postgres\\|spamd\\)@" "admin.misc" t)
+(setq nnmail-split-fancy
+      '(|
+         ;; Administrative boxes.
+         (to "\\(root\\|postgres\\|ca\\|noc\\)@" "admin.misc" t)
+         (to "\\(jukebox\\|nobody\\|darchive\\)@" "admin.misc" t)
+         (to "\\(hostmaster\\)@" "admin.dns" t)
+         (to "\\(news\\|newsmaster\\|usenet\\)@" "admin.news" t)
+         (to "\\(postmaster\\|spamd\\|mailer-daemon\\)@" "admin.mail" t)
+         (to "\\(irc\\|blight\\|ircbot\\)@" "admin.irc" t)
+         (to "\\(www\\|webmaster\\|mtos\\)@" "admin.web" t)
+         (to "\\(ftp\\|ftpadmin\\|mirror\\)@" "admin.ftp" t)
+         (to "\\(abuse\\|security\\)@" "admin.keep" t)
+         (from "cron daemon" "admin.misc")
+         (from "uucp@distorted\\.org\\.uk" "admin.uucp")
+         (from "darchive@.*\\.distorted\\.org\\.uk" "admin.misc")
+         (from "bugs@distorted\\.org\\.uk" "admin.bugs")
+
+         ;; Colo provider.
+         (from "\\(accounts\\|support\\)@jump\\.net\\.uk" "keep.colo")
+
+         ;; Mailing lists, not split out earlier.
          (to "python-list@python\\.org" "lists.python")
+         (to "jump-announce@jump\\.net\\.uk" "lists.jump-announce")
+
+         ;; Per-sender addresses.
+         (to "mdw-nospam-justgviing@" "crap.justgiving" t)
          (to "mdw-nospam-\\([^@]+\\)@" "crap.\\1" t)
-         (from "support@jump\\.net\\.uk" "keep.colo")
+         (to "mdw-nopspam-\\([^@]+\\)@" "crap.\\1" t)
+
+         ;; Regular nags.
          (from "\\(sealbot\\|cardbot\\)@ncipher\\.com" "nag.cardbot")
          (from "\\<mailman-owner@" "nag.mailman" t)
-         (from "cron daemon" "admin.misc")
-         (from "uucp@distorted\\.org\\.uk" "admin.uucp")
-         (from "darchive@.*\\.distorted\\.org\\.uk" "admin.misc")
+
+         ;; Uninteresting mail.
+         (from "expiry@letsencrypt\\.org" "spam.letsencrypt" t)
+
+         ;; Other splits I've not given a per-sender address.
          (from "@\\(.*\\.\\)?lovefilm\\.com" "spam.lovefilm" t)
          (from "@amazon\\." "spam.amazon" t)
          (from "@cineworldmail\\.com" "spam.cineworld" t)
          (from "@action\\.openrightsgroup\\.org" "spam.org" t)
          (from "unlimited@cineworld\\.com" "spam.cineworld" t)
          (from "nationwide@securesuiteemail\\.com" "spam.nationwide" t)
+         (from "@liberty-human-rights\\.org\\.uk" "spam.liberty" t)
+         (from "@libertymail\\.org\\.uk" "spam.liberty" t)
+         (from "@openrightsgroup\\.org" "spam.org" t)
          (from "@tshirthell\\.com" "spam.tshirt-hell" t)
-         "mail.misc"))
+         (from "campaigns@jolla\\.com" "crap.jolla" t)
+
+         ;; Default.
+         "mail.misc")
+      nnimap-split-fancy nnmail-split-fancy)
 
 ;;;----- That's all, folks --------------------------------------------------
index fbbf62669ff6e86ed072885169bfd8c11a2907b3..46b0a044371cff019470d118c830da464d287146 100644 (file)
@@ -74,6 +74,11 @@ (setq nnimap-split-crosspost t)
 ;; We may have the misfortune to talk to an Exchange server.
 (setq imap-enable-exchange-bug-workaround t)
 
+;; Save articles in mbox format by default, of course, and save an entire
+;; batch with the same name.
+(setq gnus-prompt-before-saving t
+      gnus-default-article-saver 'gnus-summary-save-in-mail)
+
 ;; Clean up properly when closing the summary.
 (defadvice gnus-summary-exit (before mdw-kill-debris compile activate)
   (gnus-summary-expand-window))
index c77e49444a365a4dff28e272877e0e386b57b8ed..7f6e31600992e00f0bf924affb37a6348a56fee0 100644 (file)
@@ -20,15 +20,32 @@ (setf *load-verbose* nil)
 (setf *compile-verbose* nil)
 #+cmu (setf *gc-verbose* nil)
 
+;; Tell SBCL where to find its source source.
+#+sbcl
+(sb-ext:set-sbcl-source-location #p"/usr/share/sbcl-source/")
+
+;; Tell some Lisps about my home directory.
+#+(and unix (or sbcl clisp))
+(let* ((#1=#:homestring (or #+sbcl (sb-ext:posix-getenv "HOME")
+                           #+clisp (ext:getenv "HOME")
+                           #+cmu (unix:unix-getenv "HOME")
+                           "/home/mdw"))
+       (#2=#:home (pathname (concatenate 'string #1# "/"))))
+  (setf (logical-pathname-translations "HOME")
+       `(("HOME:**;*.*.*" ,(merge-pathnames "**/*.*" #2# nil)))
+       (logical-pathname-translations "CL")
+       '(("CL:SOURCE;**;*.*.*" #p"/usr/share/common-lisp/source/**/*.*")
+         ("CL:SYSTEMS;**;*.*.*" #p"/usr/share/common-lisp/systems/**/*.*"))))
+
 ;; Various fixings.
 #+clisp (setf custom:*parse-namestring-ansi* t)
 
 ;; Shebang.
 (set-dispatch-macro-character
  #\# #\!
- (lambda (stream char arg)
-   (declare (ignore char arg))
-   (values (read-line stream))))
+ (lambda (#1=#:stream . #2=(#:char #:arg))
+   (declare (ignore . #2#))
+   (values (read-line #1#))))
 
 ;; Start up swank.
 (defun mdw-hacks:crank-swank (&rest #1=#:args)
diff --git a/dot/mdw-build.conf b/dot/mdw-build.conf
new file mode 100644 (file)
index 0000000..db3fbd1
--- /dev/null
@@ -0,0 +1,20 @@
+### -*-sh-*-
+
+set_from_mdw_conf () {
+  var=$1 key=$2; shift 2
+  case $# in 0) defaultp=nil ;; *) defaultp=t default=$1; shift ;; esac
+  if value=$(mdw-conf $key 2>/dev/null); then
+    eval "$var=\$value"
+  else
+    case $defaultp in t) eval "$var=\$default" ;; esac
+  fi
+}
+
+setup=yes setupcmd=mdw-setup
+
+set_from_mdw_conf uploadpath upload-target
+set_from_mdw_conf dputtarget dput-target
+set_from_mdw_conf sbuildsrv sbuild-server
+set_from_mdw_conf signkey releasekey
+
+DEB_BUILD_OPTIONS=parallel=4
index 051b577a399ca4da7451f57b2041d536cd5bf809..3d52faf9d94f8b8e598bf395a422866752219bb3 100644 (file)
@@ -31,6 +31,8 @@ set autoedit=yes
 set edit_headers=yes
 set use_domain=no
 set record=+mail.sent
+set use_envelope_from=yes
+set reverse_name=yes
 
 ## Replies.
 set attribution="%n <%a> writes:\n"
index eab2f082f5b457f39a4b26c2bf979e4fdb7332b1..b22323f9eb2f8bfcf1f967c4ef1af0e20efd8744 100644 (file)
@@ -6,7 +6,7 @@
 ### IMAP configuration.
 
 ## Local mail.
-account-hook ^imap://mail\.distorted\.org\.uk \
+account-hook '^imap://mail\.distorted\.org\.uk' \
        'set imap_user=mdw; set imap_pass=$my_distorted_mail_passwd'
 set my_distorted_imap=imap://mail.distorted.org.uk/
 set spoolfile=$my_distorted_imap
@@ -14,7 +14,7 @@ set folder=$my_distorted_imap
 mailboxes $my_distorted_imap
 
 ## Google mail.
-account-hook ^imaps://imap\.gmail\.com \
+account-hook '^imaps://imap\.gmail\.com' \
        'set imap_user=distorted.mdw@gmail.com; set imap_pass=$my_gmail_passwd'
 mailboxes imaps://imap.gmail.com/
 
@@ -29,11 +29,10 @@ set smtp_pass=$my_distorted_mail_passwd
 ### Other issues.
 
 alternates -group me \
-       ^mdw([-+][^@]*|)@distorted\.org\.uk$ \
-       ^(markw|mdw)([-+][^@]*|)@odin\.gg$ \
-       ^distorted\.mdw@(google|g)mail\.com$
+       '^(mdw|markw)([-+][^@]*|)@(distorted\.org\.uk|escorted\.org\.uk|odin\.gg)$' \
+       '^distorted\.mdw@g(oogle|)mail\.com$'
 
 alternates -group admin \
-       ^(root|postmaster|abuse)@distorted\.org\.uk$
+       '^(root|postmaster|abuse)@(distorted\.org\.uk|escorted\.org\.uk|odin\.gg)$' \
 
 ###----- That's all, folks --------------------------------------------------
diff --git a/dot/parallel-config b/dot/parallel-config
new file mode 100644 (file)
index 0000000..34b8e9c
--- /dev/null
@@ -0,0 +1,2 @@
+### -*-conf-*-
+--gnu
diff --git a/dot/pulse-daemon.conf b/dot/pulse-daemon.conf
new file mode 100644 (file)
index 0000000..9b82614
--- /dev/null
@@ -0,0 +1,5 @@
+### -*-conf-*-
+
+## Don't fiddle with master volume controls when sources' volume controls are
+## frobbed.
+flat-volumes = no
index b1187b100044ad95bdd34b1d802b29ec133fbd15..a49dd9148dff11845dd3286874e77f1fe963cd10 100644 (file)
@@ -12,3 +12,7 @@
 ## hardwire the home directory here.
 load-sample-dir-lazy @home@/.local/share/sounds/__custom
 load-module module-x11-bell sample=bell-window-system.ogg
+
+## Include a local configuration hook if there is one.
+.nofail
+.include @home@/.pulse/local.pa
index d3af7d2e028d7c9681fa7f6252f628559276fe5b..2ff931770fa25adacb13e68ba506cc8beabc0011 100644 (file)
@@ -39,3 +39,8 @@ startup_message off
 shelltitle ]|bash:
 caption splitonly "%{=br Cb}%?%F%{Yr}%?%3n %t%=%? [%h]%?"
 hardstatus alwayslastline "%{=r Cb}%-Lw%{+b Y}%n%F %t%{-}%+Lw%=%H %Y-%m-%d %c:%s"
+
+## Arrange for windows whose processes fail to hang around so I can see what
+## happened to them.  The manual says I should use `defzombie' here, but
+## screen doesn't seem to understand that.
+zombie qr onerror
diff --git a/dot/tmux.conf b/dot/tmux.conf
new file mode 100644 (file)
index 0000000..abd37f1
--- /dev/null
@@ -0,0 +1,24 @@
+### -*-conf-*-
+
+## pterm compatibility.  The default settings for these cause tmux to send
+## pterm some control sequences it doesn't understand, with ^G as a
+## terminator, which results in annoying and unnecessary dinging.  Since the
+## problematic control sequences are only to do with frobbing the cursor
+## shape anyway, just clobber them.
+set -g terminal-overrides "*:Cr=:Cs=:Ms="
+set -ga terminal-overrides ",*88col*:colors=88,*256col*:colors=256"
+set -ga terminal-overrides ",xterm*:XT,screen*:XT"
+
+## Sane key-bindings.  I'm used to screen.  Bite me.
+set -g prefix C-z
+bind Tab select-pane -t.+1
+bind M-Tab select-pane -t.-1
+bind C-c new-window
+bind C-l refresh-client
+bind Q break-pane
+bind S split-window
+bind X kill-pane
+bind c new-window
+bind k kill-window
+bind z send C-z
+bind C-z last-window
index 88fde6116ff657380a9baebeb00df8f44856c17a..96dfec953396c4995210d02fde1c6012d40bcd99 100644 (file)
--- a/dot/vimrc
+++ b/dot/vimrc
@@ -7,7 +7,7 @@ set shiftwidth=2
 
 if &t_Co > 2 || has("gui_running")
   syntax on
-  set guifont=MiscFixed6x13\ 12
+  set guifont=Fixed\ 13
   hi Normal guifg=white guibg=black
   set background=dark
 endif
index 7aba2b9831b71c9227077a6c4a94eeaa4a08f0e0..87e5bbd3df550511609d2d3135a4c2077f300ab5 100755 (executable)
@@ -255,7 +255,7 @@ declare -i \
 
 start-emacs () {
   GDK_NATIVE_WINDOWS=1 run bgclients noip \
-    $emacs -geometry ${emacsx}x${emacsy}+0+0
+    $emacs -bg black -geometry ${emacsx}x${emacsy}+0+0
 }
 
 ## Now place some xterms.
@@ -351,7 +351,7 @@ EOF
        exec "$0" wait nostart
        ;;
       :ask-run)
-       req "Shell command" .cmd.hist xcatch -FMiscFixed6x13 -- sh -c&
+       req "Shell command" .cmd.hist xcatch -F"Fixed 13" -- sh -c&
        ;;
       :ask-command)
        req "xinit command" .xinit.hist xatom set XINIT_COMMAND$atomtag&
index 4601e238ed79da17de28e9bade152abba5ab208a..d25415445de53939b4b712ed881a143dd4b5f574 100644 (file)
@@ -52,6 +52,17 @@ (defmacro mdw-regexps (&rest list)
           (debug 0))
   `',(make-regexp list))
 
+(defun mdw-wrong ()
+  "This is not the key sequence you're looking for."
+  (interactive)
+  (error "wrong button"))
+
+(defun mdw-emacs-version-p (major &optional minor)
+  "Return non-nil if the running Emacs is at least version MAJOR.MINOR."
+  (or (> emacs-major-version major)
+      (and (= emacs-major-version major)
+          (>= emacs-minor-version (or minor 0)))))
+
 ;; Some error trapping.
 ;;
 ;; If individual bits of this file go tits-up, we don't particularly want
@@ -91,6 +102,14 @@ (defun mdw-config (sym)
                    (concat "(" (buffer-string) ")")))))))
   (cdr (assq sym mdw-config)))
 
+;; Local variables hacking.
+
+(defun run-local-vars-mode-hook ()
+  "Run a hook for the major-mode after local variables have been processed."
+  (run-hooks (intern (concat (symbol-name major-mode)
+                            "-local-variables-hook"))))
+(add-hook 'hack-local-variables-hook 'run-local-vars-mode-hook)
+
 ;; Set up the load path convincingly.
 
 (dolist (dir (append (and (boundp 'debian-emacs-flavor)
@@ -176,8 +195,7 @@ (defun mdw-divvy-window (&optional width)
   "Split a wide window into appropriate widths."
   (interactive "P")
   (setq width (cond (width (prefix-numeric-value width))
-                   ((and window-system
-                         (>= emacs-major-version 22))
+                   ((and window-system (mdw-emacs-version-p 22))
                     77)
                    (t 78)))
   (let* ((win (selected-window))
@@ -213,6 +231,13 @@ (defmacro mdw-advise-to-inhibit-raise-frame (function)
 
 (mdw-advise-to-inhibit-raise-frame select-frame-set-input-focus)
 
+;; Bug fix for markdown-mode, which breaks point positioning during
+;; `query-replace'.
+(defadvice markdown-check-change-for-wiki-link
+    (around mdw-save-match activate compile)
+  "Save match data around the `markdown-mode' `after-change-functions' hook."
+  (save-match-data ad-do-it))
+
 ;; Transient mark mode hacks.
 
 (defadvice exchange-point-and-mark
@@ -234,6 +259,11 @@ (defadvice exchange-point-and-mark
 
 ;; Functions for sexp diary entries.
 
+(defun mdw-not-org-mode (form)
+  "As FORM, but not in Org mode agenda."
+  (and (not mdw-diary-for-org-mode-p)
+       (eval form)))
+
 (defun mdw-weekday (l)
   "Return non-nil if `date' falls on one of the days of the week in L.
 L is a list of day numbers (from 0 to 6 for Sunday through to
@@ -245,6 +275,50 @@ (defun mdw-weekday (l)
        (memq (nth d '(sunday monday tuesday wednesday
                              thursday friday saturday)) l))))
 
+(defun mdw-discordian-date (date)
+  "Return the Discordian calendar date corresponding to DATE.
+
+The return value is (YOLD . st-tibs-day) or (YOLD SEASON DAYNUM DOW).
+
+The original is by David Pearson.  I modified it to produce date components
+as output rather than a string."
+  (let* ((days ["Sweetmorn" "Boomtime" "Pungenday"
+               "Prickle-Prickle" "Setting Orange"])
+        (months ["Chaos" "Discord" "Confusion"
+                 "Bureaucracy" "Aftermath"])
+        (day-count [0 31 59 90 120 151 181 212 243 273 304 334])
+        (year (- (extract-calendar-year date) 1900))
+        (month (1- (extract-calendar-month date)))
+        (day (1- (extract-calendar-day date)))
+        (julian (+ (aref day-count month) day))
+        (dyear (+ year 3066)))
+    (if (and (= month 1) (= day 28))
+       (cons dyear 'st-tibs-day)
+      (list dyear
+           (aref months (floor (/ julian 73)))
+           (1+ (mod julian 73))
+           (aref days (mod julian 5))))))
+
+(defun mdw-diary-discordian-date ()
+  "Convert the date in `date' to a string giving the Discordian date."
+  (let* ((ddate (mdw-discordian-date date))
+        (tail (format "in the YOLD %d" (car ddate))))
+    (if (eq (cdr ddate) 'st-tibs-day)
+       (format "St Tib's Day %s" tail)
+      (let ((season (cadr ddate))
+           (daynum (caddr ddate))
+           (dayname (cadddr ddate)))
+      (format "%s, the %d%s day of %s %s"
+             dayname
+             daynum
+             (let ((ldig (mod daynum 10)))
+               (cond ((= ldig 1) "st")
+                     ((= ldig 2) "nd")
+                     ((= ldig 3) "rd")
+                     (t "th")))
+             season
+             tail)))))
+
 (defun mdw-todo (&optional when)
   "Return non-nil today, or on WHEN, whichever is later."
   (let ((w (calendar-absolute-from-gregorian (calendar-current-date)))
@@ -264,6 +338,34 @@ (defun mdw-todo (&optional when)
                                (nth 2 when))))))))
     (eq w d)))
 
+(defvar mdw-diary-for-org-mode-p nil)
+
+(defadvice org-agenda-list (around mdw-preserve-links activate)
+  (let ((mdw-diary-for-org-mode-p t))
+    ad-do-it))
+
+(defadvice diary-add-to-list (before mdw-trim-leading-space activate)
+  "Trim leading space from the diary entry string."
+  (save-match-data
+    (let ((str (ad-get-arg 1)))
+      (ad-set-arg 1
+                 (cond ((null str) nil)
+                       ((and mdw-diary-for-org-mode-p
+                             (string-match (concat
+                                            "^[ \t]*"
+                                            "\\(" diary-time-regexp
+                                            "\\(-" diary-time-regexp "\\)?"
+                                            "\\)[ \t]+")
+                                           str))
+                        (replace-match "\\1 " nil nil str))
+                       ((string-match "^[ \t]+" str)
+                        (replace-match "" nil nil str))
+                       ((and (not mdw-diary-for-org-mode-p)
+                             (string-match "\\[\\[[^][]*]\\[\\([^][]*\\)]]"
+                                           str))
+                        (replace-match "\\1" nil nil str))
+                       (t str))))))
+
 ;; Fighting with Org-mode's evil key maps.
 
 (defvar mdw-evil-keymap-keys
@@ -431,6 +533,27 @@ (let ((path exec-path))
          (setenv "REAL_MOVEMAIL" try))
       (setq path (cdr path)))))
 
+;; AUTHINFO GENERIC kludge.
+
+(defvar nntp-authinfo-generic nil
+  "Set to the `NNTPAUTH' string to pass on to `authinfo-kludge'.
+
+Use this to arrange for per-server settings.")
+
+(defun nntp-open-authinfo-kludge (buffer)
+  "Open a connection to SERVER using `authinfo-kludge'."
+  (let ((proc (start-process "nntpd" buffer
+                            "env" (concat "NNTPAUTH="
+                                          (or nntp-authinfo-generic
+                                              (getenv "NNTPAUTH")
+                                              (error "NNTPAUTH unset")))
+                            "authinfo-kludge" nntp-address)))
+    (set-buffer buffer)
+    (nntp-wait-for-string "^\r*200")
+    (beginning-of-line)
+    (delete-region (point-min) (point))
+    proc))
+
 (eval-after-load "erc"
     '(load "~/.ercrc.el"))
 
@@ -797,6 +920,8 @@ (defun mdw-whitespace-mode (&optional arg)
       (whitespace-mode arg))
     (setq show-trailing-whitespace whitespace-mode)))
 
+(defvar mdw-do-misc-mode-hacking nil)
+
 (defun mdw-misc-mode-config ()
   (and mdw-auto-indent
        (cond ((eq major-mode 'lisp-mode)
@@ -806,14 +931,13 @@ (defun mdw-misc-mode-config ()
              nil)
             (t
              (local-set-key "\C-m" 'newline-and-indent))))
+  (set (make-local-variable 'mdw-do-misc-mode-hacking) t)
   (local-set-key [C-return] 'newline)
   (make-local-variable 'page-delimiter)
   (setq page-delimiter "\f\\|^.*-\\{6\\}.*$")
   (setq comment-column 40)
   (auto-fill-mode 1)
   (setq fill-column 77)
-  (setq show-trailing-whitespace t)
-  (mdw-whitespace-mode 1)
   (and (fboundp 'gtags-mode)
        (gtags-mode))
   (if (fboundp 'hs-minor-mode)
@@ -822,8 +946,17 @@ (defun mdw-misc-mode-config ()
   (reveal-mode t)
   (trap (turn-on-font-lock)))
 
-(defun mdw-post-config-mode-hack ()
-  (mdw-whitespace-mode 1))
+(defun mdw-post-local-vars-misc-mode-config ()
+  (when (and mdw-do-misc-mode-hacking
+            (not buffer-read-only))
+    (setq show-trailing-whitespace t)
+    (mdw-whitespace-mode 1)))
+(add-hook 'hack-local-variables-hook 'mdw-post-local-vars-misc-mode-config)
+
+(defadvice toggle-read-only (after mdw-angry-fruit-salad activate)
+  (when mdw-do-misc-mode-hacking
+    (setq show-trailing-whitespace (not buffer-read-only))
+    (mdw-whitespace-mode (if buffer-read-only 0 1))))
 
 (eval-after-load 'gtags
   '(progn
@@ -871,6 +1004,97 @@ (defun mdw-last-one-out-turn-off-the-lights (frame)
       (run-with-idle-timer 0 nil #'x-close-connection frame-display))))
 (add-hook 'delete-frame-functions 'mdw-last-one-out-turn-off-the-lights)
 
+;;;--------------------------------------------------------------------------
+;;; Where is point?
+
+(defvar mdw-point-overlay
+  (let ((ov (make-overlay 0 0))
+       (s "."))
+    (overlay-put ov 'priority 2)
+    (put-text-property 0 1 'display '(left-fringe vertical-bar) s)
+    (overlay-put ov 'before-string s)
+    (delete-overlay ov)
+    ov)
+  "An overlay used for showing where point is in the selected window.")
+
+(defun mdw-remove-point-overlay ()
+  "Remove the current-point overlay."
+  (delete-overlay mdw-point-overlay))
+
+(defun mdw-update-point-overlay ()
+  "Mark the current point position with an overlay."
+  (if (not mdw-point-overlay-mode)
+      (mdw-remove-point-overlay)
+    (overlay-put mdw-point-overlay 'window (selected-window))
+    (if (bolp)
+       (move-overlay mdw-point-overlay
+                     (point) (1+ (point)) (current-buffer))
+      (move-overlay mdw-point-overlay
+                   (1- (point)) (point) (current-buffer)))))
+
+(defvar mdw-point-overlay-buffers nil
+  "List of buffers using `mdw-point-overlay-mode'.")
+
+(define-minor-mode mdw-point-overlay-mode
+  "Indicate current line with an overlay."
+  :global nil
+  (let ((buffer (current-buffer)))
+    (setq mdw-point-overlay-buffers
+         (mapcan (lambda (buf)
+                   (if (and (buffer-live-p buf)
+                            (not (eq buf buffer)))
+                       (list buf)))
+                 mdw-point-overlay-buffers))
+    (if mdw-point-overlay-mode
+       (setq mdw-point-overlay-buffers
+             (cons buffer mdw-point-overlay-buffers))))
+  (cond (mdw-point-overlay-buffers
+        (add-hook 'pre-command-hook 'mdw-remove-point-overlay)
+        (add-hook 'post-command-hook 'mdw-update-point-overlay))
+       (t
+        (mdw-remove-point-overlay)
+        (remove-hook 'pre-command-hook 'mdw-remove-point-overlay)
+        (remove-hook 'post-command-hook 'mdw-update-point-overlay))))
+
+(define-globalized-minor-mode mdw-global-point-overlay-mode
+  mdw-point-overlay-mode
+  (lambda () (if (not (minibufferp)) (mdw-point-overlay-mode t))))
+
+;;;--------------------------------------------------------------------------
+;;; Fullscreen-ness.
+
+(defvar mdw-full-screen-parameters
+  '((menu-bar-lines . 0)
+    ;(vertical-scroll-bars . nil)
+    )
+  "Frame parameters to set when making a frame fullscreen.")
+
+(defvar mdw-full-screen-save
+  '(width height)
+  "Extra frame parameters to save when setting fullscreen.")
+
+(defun mdw-toggle-full-screen (&optional frame)
+  "Show the FRAME fullscreen."
+  (interactive)
+  (when window-system
+    (cond ((frame-parameter frame 'fullscreen)
+          (set-frame-parameter frame 'fullscreen nil)
+          (modify-frame-parameters
+           nil
+           (or (frame-parameter frame 'mdw-full-screen-saved)
+               (mapcar (lambda (assoc)
+                         (assq (car assoc) default-frame-alist))
+                       mdw-full-screen-parameters))))
+         (t
+          (let ((saved (mapcar (lambda (param)
+                                 (cons param (frame-parameter frame param)))
+                               (append (mapcar #'car
+                                               mdw-full-screen-parameters)
+                                       mdw-full-screen-save))))
+            (set-frame-parameter frame 'mdw-full-screen-saved saved))
+          (modify-frame-parameters frame mdw-full-screen-parameters)
+          (set-frame-parameter frame 'fullscreen 'fullboth)))))
+
 ;;;--------------------------------------------------------------------------
 ;;; General fontification.
 
@@ -893,7 +1117,7 @@ (mdw-define-face fixed-pitch
   (((type w32)) :family "courier new" :height 85)
   (((type x)) :family "6x13" :foundry "trad" :height 130)
   (t :foreground "white" :background "black"))
-(if (>= emacs-major-version 23)
+(if (mdw-emacs-version-p 23)
     (mdw-define-face variable-pitch
       (((type x)) :family "sans" :height 100))
   (mdw-define-face variable-pitch
@@ -1052,7 +1276,7 @@ (mdw-define-face magit-diff-hunk-header
   (t :foreground "SkyBlue1"))
 (mdw-define-face magit-item-highlight
   (((type tty)) :background "blue")
-  (t :background "DarkSeaGreen4"))
+  (t :background "grey11"))
 (mdw-define-face magit-log-head-label-remote
   (((type tty)) :background "cyan" :foreground "green")
   (t :background "grey11" :foreground "DarkSeaGreen2" :box t))
@@ -1122,7 +1346,7 @@ (mdw-define-face whizzy-error-face
 (mdw-define-face mdw-ellipsis-face
   (((type tty)) :foreground "blue") (t :foreground "grey60"))
 (let ((dollar (make-glyph-code ?$ 'mdw-ellipsis-face))
-      (backslash (make-glyph-code ?\ 'mdw-ellipsis-face))
+      (backslash (make-glyph-code ?\\ 'mdw-ellipsis-face))
       (dot (make-glyph-code ?. 'mdw-ellipsis-face))
       (bar (make-glyph-code ?| mdw-ellipsis-face)))
   (set-display-table-slot standard-display-table 0 dollar)
@@ -1212,69 +1436,82 @@ (defun mdw-fontify-c-and-c++ ()
   ;; Now define things to be fontified.
   (make-local-variable 'font-lock-keywords)
   (let ((c-keywords
-        (mdw-regexps "and"             ;C++
-                     "and_eq"          ;C++
-                     "asm"             ;K&R, GCC
-                     "auto"            ;K&R, C89
-                     "bitand"          ;C++
-                     "bitor"           ;C++
-                     "bool"            ;C++, C9X macro
-                     "break"           ;K&R, C89
-                     "case"            ;K&R, C89
-                     "catch"           ;C++
-                     "char"            ;K&R, C89
-                     "class"           ;C++
-                     "complex"         ;C9X macro, C++ template type
-                     "compl"           ;C++
-                     "const"           ;C89
-                     "const_cast"      ;C++
-                     "continue"        ;K&R, C89
-                     "defined"         ;C89 preprocessor
-                     "default"         ;K&R, C89
-                     "delete"          ;C++
-                     "do"              ;K&R, C89
-                     "double"          ;K&R, C89
-                     "dynamic_cast"    ;C++
-                     "else"            ;K&R, C89
-                     ;; "entry"        ;K&R -- never used
-                     "enum"            ;C89
-                     "explicit"        ;C++
-                     "export"          ;C++
-                     "extern"          ;K&R, C89
-                     "float"           ;K&R, C89
-                     "for"             ;K&R, C89
-                     ;; "fortran"      ;K&R
-                     "friend"          ;C++
-                     "goto"            ;K&R, C89
-                     "if"              ;K&R, C89
-                     "imaginary"       ;C9X macro
-                     "inline"          ;C++, C9X, GCC
-                     "int"             ;K&R, C89
-                     "long"            ;K&R, C89
-                     "mutable"         ;C++
-                     "namespace"       ;C++
-                     "new"             ;C++
-                     "operator"        ;C++
-                     "or"              ;C++
-                     "or_eq"           ;C++
-                     "private"         ;C++
-                     "protected"       ;C++
-                     "public"          ;C++
-                     "register"        ;K&R, C89
+        (mdw-regexps "alignas"          ;C11 macro, C++11
+                     "alignof"          ;C++11
+                     "and"              ;C++, C95 macro
+                     "and_eq"           ;C++, C95 macro
+                     "asm"              ;K&R, C++, GCC
+                     "atomic"           ;C11 macro, C++11 template type
+                     "auto"             ;K&R, C89
+                     "bitand"           ;C++, C95 macro
+                     "bitor"            ;C++, C95 macro
+                     "bool"             ;C++, C99 macro
+                     "break"            ;K&R, C89
+                     "case"             ;K&R, C89
+                     "catch"            ;C++
+                     "char"             ;K&R, C89
+                     "char16_t"         ;C++11, C11 library type
+                     "char32_t"         ;C++11, C11 library type
+                     "class"            ;C++
+                     "complex"          ;C99 macro, C++ template type
+                     "compl"            ;C++, C95 macro
+                     "const"            ;C89
+                     "constexpr"        ;C++11
+                     "const_cast"       ;C++
+                     "continue"         ;K&R, C89
+                     "decltype"         ;C++11
+                     "defined"          ;C89 preprocessor
+                     "default"          ;K&R, C89
+                     "delete"           ;C++
+                     "do"               ;K&R, C89
+                     "double"           ;K&R, C89
+                     "dynamic_cast"     ;C++
+                     "else"             ;K&R, C89
+                     ;; "entry"         ;K&R -- never used
+                     "enum"             ;C89
+                     "explicit"         ;C++
+                     "export"           ;C++
+                     "extern"           ;K&R, C89
+                     "float"            ;K&R, C89
+                     "for"              ;K&R, C89
+                     ;; "fortran"       ;K&R
+                     "friend"           ;C++
+                     "goto"             ;K&R, C89
+                     "if"               ;K&R, C89
+                     "imaginary"        ;C99 macro
+                     "inline"           ;C++, C99, GCC
+                     "int"              ;K&R, C89
+                     "long"             ;K&R, C89
+                     "mutable"          ;C++
+                     "namespace"        ;C++
+                     "new"              ;C++
+                     "noexcept"         ;C++11
+                     "noreturn"         ;C11 macro
+                     "not"              ;C++, C95 macro
+                     "not_eq"           ;C++, C95 macro
+                     "nullptr"          ;C++11
+                     "operator"         ;C++
+                     "or"               ;C++, C95 macro
+                     "or_eq"            ;C++, C95 macro
+                     "private"          ;C++
+                     "protected"        ;C++
+                     "public"           ;C++
+                     "register"         ;K&R, C89
                      "reinterpret_cast" ;C++
-                     "restrict"         ;C9X
+                     "restrict"         ;C99
                      "return"           ;K&R, C89
                      "short"            ;K&R, C89
                      "signed"           ;C89
                      "sizeof"           ;K&R, C89
                      "static"           ;K&R, C89
+                     "static_assert"    ;C11 macro, C++11
                      "static_cast"      ;C++
                      "struct"           ;K&R, C89
                      "switch"           ;K&R, C89
                      "template"         ;C++
                      "throw"            ;C++
                      "try"              ;C++
-                     "this"             ;C++
+                     "thread_local"     ;C11 macro, C++11
                      "typedef"          ;C89
                      "typeid"           ;C++
                      "typeof"           ;GCC
@@ -1287,12 +1524,19 @@ (defun mdw-fontify-c-and-c++ ()
                      "volatile"         ;C89
                      "wchar_t"          ;C++, C89 library type
                      "while"            ;K&R, C89
-                     "xor"              ;C++
-                     "xor_eq"           ;C++
-                     "_Bool"            ;C9X
-                     "_Complex"         ;C9X
-                     "_Imaginary"       ;C9X
-                     "_Pragma"          ;C9X preprocessor
+                     "xor"              ;C++, C95 macro
+                     "xor_eq"           ;C++, C95 macro
+                     "_Alignas"         ;C11
+                     "_Alignof"         ;C11
+                     "_Atomic"          ;C11
+                     "_Bool"            ;C99
+                     "_Complex"         ;C99
+                     "_Generic"         ;C11
+                     "_Imaginary"       ;C99
+                     "_Noreturn"        ;C11
+                     "_Pragma"          ;C99 preprocessor
+                     "_Static_assert"   ;C11
+                     "_Thread_local"    ;C11
                      "__alignof__"      ;GCC
                      "__asm__"          ;GCC
                      "__attribute__"    ;GCC
@@ -1308,9 +1552,9 @@ (defun mdw-fontify-c-and-c++ ()
                      "__volatile__"     ;GCC
                      ))
        (c-constants
-        (mdw-regexps "false"           ;C++, C9X macro
+        (mdw-regexps "false"            ;C++, C99 macro
                      "this"             ;C++
-                     "true"             ;C++, C9X macro
+                     "true"             ;C++, C99 macro
                      ))
        (preprocessor-keywords
         (mdw-regexps "assert" "define" "elif" "else" "endif" "error"
@@ -1357,9 +1601,7 @@ (defun mdw-fontify-c-and-c++ ()
 
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face))))
-
-    (mdw-post-config-mode-hack)))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; AP calc mode.
@@ -1411,9 +1653,7 @@ (defun mdw-fontify-apcalc ()
 
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Java programming configuration.
@@ -1479,9 +1719,7 @@ (defun mdw-fontify-java ()
 
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Javascript programming configuration.
@@ -1539,9 +1777,7 @@ (defun mdw-fontify-javascript ()
 
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Scala programming configuration.
@@ -1614,9 +1850,7 @@ (defun mdw-fontify-scala ()
                         "\\|" "\\\\" "." "\\)"
                         "\\('\\)")
                 '(1 "\"")
-                '(4 "\"")))))
-
-  (mdw-post-config-mode-hack))
+                '(4 "\""))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; C# programming configuration.
@@ -1687,9 +1921,7 @@ (defun mdw-fontify-csharp ()
 
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 (define-derived-mode csharp-mode java-mode "C#"
   "Major mode for editing C# code.")
@@ -1804,9 +2036,7 @@ (defun mdw-fontify-fsharp ()
                      '(0 mdw-number-face))
 
                (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                     '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                     '(0 mdw-punct-face))))))
 
 (defun mdw-fontify-inferior-fsharp ()
   (mdw-fontify-fsharp)
@@ -1873,11 +2103,85 @@ (defun mdw-fontify-go ()
                         "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)\\)")
                 '(0 mdw-number-face))
 
+          ;; And anything else is punctuation.
+          (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
+                '(0 mdw-punct-face))))))
+
+;;;--------------------------------------------------------------------------
+;;; Rust programming configuration.
+
+(setq-default rust-indent-offset 2)
+
+(defun mdw-self-insert-and-indent (count)
+  (interactive "p")
+  (self-insert-command count)
+  (indent-according-to-mode))
+
+(defun mdw-fontify-rust ()
+
+  ;; Hack syntax categories.
+  (modify-syntax-entry ?= ".")
+
+  ;; Fontify keywords and things.
+  (make-local-variable 'font-lock-keywords)
+  (let ((rust-keywords
+        (mdw-regexps "abstract" "alignof" "as"
+                     "become" "box" "break"
+                     "const" "continue" "create"
+                     "do"
+                     "else" "enum" "extern"
+                     "false" "final" "fn" "for"
+                     "if" "impl" "in"
+                     "let" "loop"
+                     "macro" "match" "mod" "move" "mut"
+                     "offsetof" "override"
+                     "priv" "pub" "pure"
+                     "ref" "return"
+                     "self" "sizeof" "static" "struct" "super"
+                     "true" "trait" "type" "typeof"
+                     "unsafe" "unsized" "use"
+                     "virtual"
+                     "where" "while"
+                     "yield"))
+       (rust-builtins
+        (mdw-regexps "array" "pointer" "slice" "tuple"
+                     "bool" "true" "false"
+                     "f32" "f64"
+                     "i8" "i16" "i32" "i64" "isize"
+                     "u8" "u16" "u32" "u64" "usize"
+                     "char" "str")))
+    (setq font-lock-keywords
+         (list
+
+          ;; Handle the keywords defined above.
+          (list (concat "\\<\\(" rust-keywords "\\)\\>")
+                '(0 font-lock-keyword-face))
+          (list (concat "\\<\\(" rust-builtins "\\)\\>")
+                '(0 font-lock-variable-name-face))
+
+          ;; Handle numbers too.
+          (list (concat "\\<\\("
+                              "[0-9][0-9_]*"
+                              "\\(" "\\(\\.[0-9_]+\\)?[eE][-+]?[0-9_]+"
+                              "\\|" "\\.[0-9_]+"
+                              "\\)"
+                              "\\(f32\\|f64\\)?"
+                        "\\|" "\\(" "[0-9][0-9_]*"
+                              "\\|" "0x[0-9a-fA-F_]+"
+                              "\\|" "0o[0-7_]+"
+                              "\\|" "0b[01_]+"
+                              "\\)"
+                              "\\([ui]\\(8\\|16\\|32\\|64\\|s\\|size\\)\\)?"
+                        "\\)\\>")
+                '(0 mdw-number-face))
+
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
                 '(0 mdw-punct-face)))))
 
-  (mdw-post-config-mode-hack))
+  ;; Hack key bindings.
+  (local-set-key [?{] 'mdw-self-insert-and-indent)
+  (local-set-key [?}] 'mdw-self-insert-and-indent))
 
 ;;;--------------------------------------------------------------------------
 ;;; Awk programming configuration.
@@ -1935,15 +2239,15 @@ (defun mdw-fontify-awk ()
 
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Perl programming style.
 
 ;; Perl indentation style.
 
+(setq perl-indent-level 2)
+
 (setq cperl-indent-level 2)
 (setq cperl-continued-statement-offset 2)
 (setq cperl-continued-brace-offset 0)
@@ -1958,16 +2262,29 @@ (defun mdw-fontify-perl ()
   ;; Miscellaneous fiddling.
   (modify-syntax-entry ?$ "\\")
   (modify-syntax-entry ?$ "\\" font-lock-syntax-table)
+  (modify-syntax-entry ?: "." font-lock-syntax-table)
   (mdw-standard-fill-prefix "\\([ \t]*#+[ \t]*\\)")
 
   ;; Now define fontification things.
   (make-local-variable 'font-lock-keywords)
   (let ((perl-keywords
-        (mdw-regexps "and" "break" "cmp" "continue" "do" "else" "elsif" "eq"
-                     "for" "foreach" "ge" "given" "gt" "goto" "if"
-                     "last" "le" "lt" "local" "my" "ne" "next" "or"
-                     "our" "package" "redo" "require" "return" "sub"
-                     "undef" "unless" "until" "use" "when" "while")))
+        (mdw-regexps "and"
+                     "break"
+                     "cmp" "continue"
+                     "default" "do"
+                     "else" "elsif" "eq"
+                     "for" "foreach"
+                     "ge" "given" "gt" "goto"
+                     "if"
+                     "last" "le" "local" "lt"
+                     "my"
+                     "ne" "next"
+                     "or" "our"
+                     "package"
+                     "redo" "require" "return"
+                     "sub"
+                     "undef" "unless" "until" "use"
+                     "when" "while")))
 
     (setq font-lock-keywords
          (list
@@ -1984,9 +2301,7 @@ (defun mdw-fontify-perl ()
 
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 (defun perl-number-tests (&optional arg)
   "Assign consecutive numbers to lines containing `#t'.  With ARG,
@@ -2029,9 +2344,7 @@ (defun mdw-fontify-pythonic (keywords)
 
         ;; And anything else is punctuation.
         (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-              '(0 mdw-punct-face))))
-
-  (mdw-post-config-mode-hack))
+              '(0 mdw-punct-face)))))
 
 ;; Define Python fontification styles.
 
@@ -2105,94 +2418,7 @@ (defun mdw-fontify-icon ()
 
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
-
-;;;--------------------------------------------------------------------------
-;;; ARM assembler programming configuration.
-
-;; There doesn't appear to be an Emacs mode for this yet.
-;;
-;; Better do something about that, I suppose.
-
-(defvar arm-assembler-mode-map nil)
-(defvar arm-assembler-abbrev-table nil)
-(defvar arm-assembler-mode-syntax-table (make-syntax-table))
-
-(or arm-assembler-mode-map
-    (progn
-      (setq arm-assembler-mode-map (make-sparse-keymap))
-      (define-key arm-assembler-mode-map "\C-m" 'arm-assembler-newline)
-      (define-key arm-assembler-mode-map [C-return] 'newline)
-      (define-key arm-assembler-mode-map "\t" 'tab-to-tab-stop)))
-
-(defun arm-assembler-mode ()
-  "Major mode for ARM assembler programs"
-  (interactive)
-
-  ;; Do standard major mode things.
-  (kill-all-local-variables)
-  (use-local-map arm-assembler-mode-map)
-  (setq local-abbrev-table arm-assembler-abbrev-table)
-  (setq major-mode 'arm-assembler-mode)
-  (setq mode-name "ARM assembler")
-
-  ;; Set up syntax table.
-  (set-syntax-table arm-assembler-mode-syntax-table)
-  (modify-syntax-entry ?;   ; Nasty hack
-                      "<" arm-assembler-mode-syntax-table)
-  (modify-syntax-entry ?\n ">" arm-assembler-mode-syntax-table)
-  (modify-syntax-entry ?_ "_" arm-assembler-mode-syntax-table)
-  (modify-syntax-entry ?' "\"'" arm-assembler-mode-syntax-table)
-
-  (make-local-variable 'comment-start)
-  (setq comment-start ";")
-  (make-local-variable 'comment-end)
-  (setq comment-end "")
-  (make-local-variable 'comment-column)
-  (setq comment-column 48)
-  (make-local-variable 'comment-start-skip)
-  (setq comment-start-skip ";+[ \t]*")
-
-  ;; Play with indentation.
-  (make-local-variable 'indent-line-function)
-  (setq indent-line-function 'indent-relative-maybe)
-
-  ;; Set fill prefix.
-  (mdw-standard-fill-prefix "\\([ \t]*;+[ \t]*\\)")
-
-  ;; Fiddle with fontification.
-  (make-local-variable 'font-lock-keywords)
-  (setq font-lock-keywords
-       (list
-
-        ;; Handle numbers too.
-        ;;
-        ;; The following isn't quite right, but it's close enough.
-        (list (concat "\\("
-                      "&[0-9a-fA-F]+\\|"
-                      "\\<[0-9]+\\(\\.[0-9]*\\|_[0-9a-zA-Z]+\\|\\)"
-                      "\\)")
-              '(0 mdw-number-face))
-
-        ;; Do something about operators.
-        (list "^[^ \t]*[ \t]+\\(GET\\|LNK\\)[ \t]+\\([^;\n]*\\)"
-              '(1 font-lock-keyword-face)
-              '(2 font-lock-string-face))
-        (list ":[a-zA-Z]+:"
-              '(0 font-lock-keyword-face))
-
-        ;; Do menemonics and directives.
-        (list "^[^ \t]*[ \t]+\\([a-zA-Z]+\\)"
-              '(1 font-lock-keyword-face))
-
-        ;; And anything else is punctuation.
-        (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-              '(0 mdw-punct-face))))
-
-  (mdw-post-config-mode-hack)
-  (run-hooks 'arm-assembler-mode-hook))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Assembler mode.
@@ -2200,9 +2426,18 @@ (defun arm-assembler-mode ()
 (defun mdw-fontify-asm ()
   (modify-syntax-entry ?' "\"")
   (modify-syntax-entry ?. "w")
+  (modify-syntax-entry ?\n ">")
   (setf fill-prefix nil)
   (mdw-standard-fill-prefix "\\([ \t]*;+[ \t]*\\)"))
 
+(defun mdw-asm-set-comment ()
+  (modify-syntax-entry ?; "."
+                      )
+  (modify-syntax-entry asm-comment-char "<b")
+  (setq comment-start (string asm-comment-char ? )))
+(add-hook 'asm-mode-local-variables-hook 'mdw-asm-set-comment)
+(put 'asm-comment-char 'safe-local-variable 'characterp)
+
 ;;;--------------------------------------------------------------------------
 ;;; TCL configuration.
 
@@ -2217,8 +2452,7 @@ (defun mdw-fontify-tcl ()
                       "\\([eE]\\([-+]\\|\\)[0-9_]+\\|\\)")
               '(0 mdw-number-face))
         (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-              '(0 mdw-punct-face))))
-  (mdw-post-config-mode-hack))
+              '(0 mdw-punct-face)))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Dylan programming configuration.
@@ -2284,9 +2518,7 @@ (defun mdw-fontify-dylan ()
                              "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\|"
                              "\\_<[-+*/=<>:&|]+\\_>"
                              "\\)")
-                     '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                     '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Algol 68 configuration.
@@ -2328,9 +2560,7 @@ (defun mdw-fontify-algol-68 ()
                              "\\>")
                      '(0 mdw-number-face))
                (list "\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/"
-                     '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                     '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; REXX configuration.
@@ -2403,9 +2633,7 @@ (defun mdw-fontify-rexx ()
 
           ;; And everything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Standard ML programming style.
@@ -2455,9 +2683,7 @@ (defun mdw-fontify-sml ()
 
           ;; And anything else is punctuation.
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Haskell configuration.
@@ -2535,9 +2761,7 @@ (defun mdw-fontify-haskell ()
                         "\\([eE]\\([-+]\\|\\)[0-9]+\\|\\)")
                 '(0 mdw-number-face))
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Erlang configuration.
@@ -2570,9 +2794,7 @@ (defun mdw-fontify-erlang ()
           (list "\\<[0-9]+\\(\\|#[0-9a-zA-Z]+\\|[eE][+-]?[0-9]+\\)\\>"
                 '(0 mdw-number-face))
           (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                '(0 mdw-punct-face)))))
-
-  (mdw-post-config-mode-hack))
+                '(0 mdw-punct-face))))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Texinfo configuration.
@@ -2606,9 +2828,7 @@ (defun mdw-fontify-texinfo ()
 
         ;; Fontify TeX special characters as punctuation.
         (list "[{}]+"
-              '(0 mdw-punct-face))))
-
-  (mdw-post-config-mode-hack))
+              '(0 mdw-punct-face)))))
 
 ;;;--------------------------------------------------------------------------
 ;;; TeX and LaTeX configuration.
@@ -2622,6 +2842,10 @@ (defun mdw-fontify-tex ()
   (modify-syntax-entry ?$ "." font-lock-syntax-table)
   (local-set-key [?$] 'self-insert-command)
 
+  ;; Make `tab' be useful, given that tab stops in TeX don't work well.
+  (local-set-key "\C-i" 'indent-relative)
+  (setq indent-tabs-mode nil)
+
   ;; Set fill prefix.
   (mdw-standard-fill-prefix "\\([ \t]*%+[ \t]*\\)")
 
@@ -2674,9 +2898,7 @@ (defun mdw-fontify-tex ()
 
         ;; Fontify TeX special characters as punctuation.
         (list "[$^_{}#&]"
-              '(0 mdw-punct-face))))
-
-  (mdw-post-config-mode-hack))
+              '(0 mdw-punct-face)))))
 
 ;;;--------------------------------------------------------------------------
 ;;; SGML hacking.
@@ -2715,8 +2937,8 @@ (defun mdw-conf-quote-normal-acceptable-value-p (value)
   (or (booleanp value)
       (every (lambda (v) (memq v '(?\" ?')))
             (if (listp value) value (list value)))))
-(put 'mdw-conf-quote-normal 'safe-local-variable '
-     mdw-conf-quote-normal-acceptable-value-p)
+(put 'mdw-conf-quote-normal 'safe-local-variable
+     'mdw-conf-quote-normal-acceptable-value-p)
 
 (defun mdw-fix-up-quote ()
   "Apply the setting of `mdw-conf-quote-normal'."
@@ -2731,15 +2953,7 @@ (defun mdw-fix-up-quote ()
                   (if (listp flag) flag (list flag)))
             (set-syntax-table table)
             (and font-lock-mode (font-lock-fontify-buffer)))))))
-(defun mdw-fix-up-quote-hack ()
-  "Unpleasant hack to call `mdw-fix-up-quote' at the right time.
-Annoyingly, `hack-local-variables' is done after `set-auto-mode'
-so we wouldn't see a local-variable setting of
-`mdw-conf-quote-normal' in `conf-mode-hook'.  Instead, wire
-ourselves onto `hack-local-variables-hook' here, and check the
-setting once it's actually been made."
-  (add-hook 'hack-local-variables-hook 'mdw-fix-up-quote t t))
-(add-hook 'conf-mode-hook 'mdw-fix-up-quote-hack t)
+(add-hook 'conf-mode-local-variables-hook 'mdw-fix-up-quote t t)
 
 ;;;--------------------------------------------------------------------------
 ;;; Shell scripts.
@@ -2761,6 +2975,9 @@ (defun mdw-setup-sh-script-mode ()
     (let ((executable-set-magic #'(lambda (s &rest r) s)))
       (sh-set-shell shell-name)))
 
+  ;; Don't insert here-document scaffolding automatically.
+  (local-set-key "<" 'self-insert-command)
+
   ;; Now enable my keys and the fontification.
   (mdw-misc-mode-config)
 
@@ -3041,8 +3258,7 @@ (defun mdw-fontify-smalltalk ()
                       "\\([eE]\\([-+]\\|\\)[0-9_]+\\|\\)")
               '(0 mdw-number-face))
         (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-              '(0 mdw-punct-face))))
-  (mdw-post-config-mode-hack))
+              '(0 mdw-punct-face)))))
 
 ;; Lispy languages.
 
@@ -3099,9 +3315,7 @@ (defun mdw-fontify-lispy ()
                            "\\)\\_>")
                    '(0 mdw-number-face))
              (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
-                   '(0 mdw-punct-face))))
-
-  (mdw-post-config-mode-hack))
+                   '(0 mdw-punct-face)))))
 
 (defun comint-send-and-indent ()
   (interactive)
index 858068d0f8268c1d8baa815afce917c9070fefb7..0738f57ae8f5966e2dcd2e978108a3efc01a8592 100644 (file)
@@ -5,3 +5,4 @@
 *.lisp         diff=lisp
 
 *.py           whitespace=trailing-space,space-before-tab,tab-in-indent
+*.tex          whitespace=trailing-space,space-before-tab,tab-in-indent
index 1512732ecf0979fbc3e7e8284c400f7a4be649cf..5dac44346809bcac8627afc4653626cd707cc969 100644 (file)
--- a/mdw.conf
+++ b/mdw.conf
@@ -7,8 +7,11 @@ http-proxy = www-cache.distorted.org.uk:3128
 nntp-server = news.distorted.org.uk
 cvs-root = metalzone.distorted.org.uk:/home/cvs/cvs
 svn-root = svn+ssh://metalzone.distorted.org.uk/home/cvs/svn
-cltl-url = http://www.distorted.org.uk/doc/cltl/
-hyperspec-url = http://www.distorted.org.uk/doc/hyperspec/
-console-ctype = en_GB.iso885915
+cltl-url = https://www.distorted.org.uk/doc/cltl/
+hyperspec-url = https://www.distorted.org.uk/doc/hyperspec/
+console-ctype = en_GB.utf8
 x-ctype = en_GB.utf8
-releasekey = 481334C2
+releasekey = E359CA55
+upload-target = ftp.distorted.org.uk:~ftp/pub/mdw/
+dput-target = distorted
+sbuild-server = universe.distorted.org.uk
diff --git a/setup b/setup
index d808814f51122ed20e0d10f6d686c6366bc27961..b64b0a5e8c973f5608dc8cc6878736caca64b7c9 100755 (executable)
--- a/setup
+++ b/setup
@@ -134,6 +134,7 @@ dotfiles="
   bash_profile bash_logout bashrc inputrc bash_completion
   emacs emacs-calc vm gnus.el ercrc.el
   vimrc mg zile lesskey
+  parallel-config:.parallel/config
   ditz-config
   mailrc signature muttrc
   cgrc tigrc
@@ -142,6 +143,7 @@ dotfiles="
   rcrc
   toprc
   mc-ini:.mc/ini mc-panels.ini:.mc/panels.ini
+  pulse-daemon.conf:.pulse/daemon.conf
   aspell.conf
   tclshrc:.tclshrc tclshrc:.wishrc
   lisp-init.lisp:.cmucl-init.lisp
@@ -149,10 +151,11 @@ dotfiles="
     lisp-init.lisp:.clisprc.lisp
     lisp-init.lisp:.eclrc
   swank.lisp
+  mdw-build.conf:.config/mdw-build.conf
   w3m-config:.w3m/config elinks.conf:.elinks/elinks.conf
-  dircolors colordiffrc screenrc cvsrc indent.pro"
+  dircolors colordiffrc screenrc tmux.conf cvsrc indent.pro"
 [ "$xstuff" ] && dotfiles="$dotfiles
-  xinitrc xsession xmodmap Xdefaults vncrc vncsession
+  xinitrc xsession xmodmap vncrc vncsession
   fonts.conf
   stalonetrayrc
   putty-defaults:.putty/sessions/Default%20Settings
@@ -176,6 +179,25 @@ for d in $dotfiles; do
 done
 echo " all done."
 
+## CPP-hack files which need it.
+cppfiles=""
+[ "$xstuff" ] && cppfiles="$cppfiles
+  Xdefaults"
+echo "Hacking files with C preprocessor..."
+for c in $cppfiles; do
+  target=.$c
+  case $c in
+    *:*) target=${c#*:} c=${c%%:*};;
+  esac
+  ft=$HOME$sub/$target
+  dir=${ft%/*}
+  mkdir -p $dir
+  cpp -P dot/$c -o $ft.new
+  mv $ft.new $ft
+  echo "  $target"
+done
+echo " all done."
+
 ## Substitute things which need substituting.
 dotfilessubst="
   gitconfig
@@ -237,14 +259,17 @@ scripts="
   mdw-editor
   mdw-pager
   mdw-conf
-  mdw-build
+  mdw-build mdw-sbuild mdw-sbuild-server
+  update-buildable-branch
   emacsclient-hack
   movemail-hack
   sendmail-hack
   aspell-hack
   emerge-hack
   lesspipe.sh
+  run-with-shell-env
   start-ssh-agent
+  start-ssh-pageant
   svnwrap
   guest-console
   hyperspec"
@@ -252,6 +277,7 @@ scripts="
   xinitcmd
   un-backslashify-selection
   lock-screen
+  xpra-start-xdummy
   xshutdown"
 echo "Installing scripts..."
 mkdir -p $HOME$sub/bin
@@ -281,7 +307,7 @@ echo "      all done."
 
 $echon "Finding a suitable emacs:$echoc"
 emacs=no
-for i in emacs22 emacs23 emacs21 emacs; do
+for i in emacs23 emacs24 emacs22 emacs21 emacs; do
   if type -p >/dev/null $i; then
     emacs=$i
     break