emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 2e76655: Convert the last :subtrees listed in externals-li


From: Stefan Monnier
Subject: [elpa] master 2e76655: Convert the last :subtrees listed in externals-list
Date: Sat, 28 Nov 2020 00:36:23 -0500 (EST)

branch: master
commit 2e76655fa8c9aa34513d64fca40ba64cac3bd04a
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Convert the last :subtrees listed in externals-list
    
    This affects the following packages:
    
        bug-hunter cobol-mode dbus-codegen enwc gnorb muse pinentry vlf
---
 externals-list                                    |   22 +-
 packages/bug-hunter/README.org                    |   92 -
 packages/bug-hunter/bug-hunter.el                 |  533 ---
 packages/cobol-mode/cobol-mode.el                 | 3096 --------------
 packages/dbus-codegen/dbus-codegen.el             |  942 -----
 packages/dbus-codegen/tests/dbus-codegen-tests.el |  130 -
 packages/enwc/.bzrignore                          |    1 -
 packages/enwc/.hgignore                           |    4 -
 packages/enwc/.hgtags                             |    7 -
 packages/enwc/COPYING                             |  674 ---
 packages/enwc/Makefile                            |   59 -
 packages/enwc/doc/enwc.texi                       |   78 -
 packages/enwc/doc/fdl.texi                        |  505 ---
 packages/enwc/doc/version.texi                    |    4 -
 packages/enwc/enwc-backend.el                     |  157 -
 packages/enwc/enwc-cm.el                          |  372 --
 packages/enwc/enwc-edit.el                        |  434 --
 packages/enwc/enwc-nm.el                          |  725 ----
 packages/enwc/enwc-test.el                        |   66 -
 packages/enwc/enwc-wicd.el                        |  483 ---
 packages/enwc/enwc.el                             |  835 ----
 packages/gnorb/.elpaignore                        |    1 -
 packages/gnorb/.gitignore                         |    5 -
 packages/gnorb/NEWS                               |   47 -
 packages/gnorb/README.org                         |  116 -
 packages/gnorb/dir                                |   18 -
 packages/gnorb/gnorb-bbdb.el                      |  637 ---
 packages/gnorb/gnorb-gnus.el                      | 1271 ------
 packages/gnorb/gnorb-helm.el                      |  109 -
 packages/gnorb/gnorb-org.el                       |  837 ----
 packages/gnorb/gnorb-registry.el                  |  343 --
 packages/gnorb/gnorb-utils.el                     |  682 ---
 packages/gnorb/gnorb.el                           |   41 -
 packages/gnorb/gnorb.info                         |  858 ----
 packages/gnorb/gnorb.org                          |  609 ---
 packages/gnorb/gnorb.texi                         |  819 ----
 packages/gnorb/nngnorb.el                         |  194 -
 packages/muse/README                              |    7 -
 packages/muse/cgi.el                              |  218 -
 packages/muse/dir                                 |   18 -
 packages/muse/htmlize-hack.el                     |   20 -
 packages/muse/httpd.el                            |  288 --
 packages/muse/muse-backlink.el                    |  327 --
 packages/muse/muse-blosxom.el                     |  307 --
 packages/muse/muse-book.el                        |  284 --
 packages/muse/muse-colors.el                      | 1019 -----
 packages/muse/muse-context.el                     |  458 --
 packages/muse/muse-docbook.el                     |  352 --
 packages/muse/muse-groff.el                       |  274 --
 packages/muse/muse-html.el                        |  756 ----
 packages/muse/muse-http.el                        |  239 --
 packages/muse/muse-ikiwiki.el                     |  219 -
 packages/muse/muse-import-docbook.el              |  137 -
 packages/muse/muse-import-latex.el                |  149 -
 packages/muse/muse-import-xml.el                  |   88 -
 packages/muse/muse-ipc.el                         |  194 -
 packages/muse/muse-journal.el                     |  774 ----
 packages/muse/muse-latex.el                       |  669 ---
 packages/muse/muse-latex2png.el                   |  277 --
 packages/muse/muse-mode.el                        | 1012 -----
 packages/muse/muse-poem.el                        |  263 --
 packages/muse/muse-project.el                     |  979 -----
 packages/muse/muse-protocols.el                   |  251 --
 packages/muse/muse-publish.el                     | 2195 ----------
 packages/muse/muse-regexps.el                     |  270 --
 packages/muse/muse-texinfo.el                     |  346 --
 packages/muse/muse-wiki.el                        |  498 ---
 packages/muse/muse-xml-common.el                  |  201 -
 packages/muse/muse-xml.el                         |  274 --
 packages/muse/muse.el                             |  881 ----
 packages/muse/muse.info                           | 4656 ---------------------
 packages/muse/texi/Makefile                       |   29 -
 packages/muse/texi/dir-template                   |   15 -
 packages/muse/texi/doclicense.texi                |  416 --
 packages/muse/texi/muse.texi                      | 4247 -------------------
 packages/pinentry/pinentry.el                     |  460 --
 packages/vlf/vlf-base.el                          |  456 --
 packages/vlf/vlf-ediff.el                         |  331 --
 packages/vlf/vlf-follow.el                        |   85 -
 packages/vlf/vlf-occur.el                         |  481 ---
 packages/vlf/vlf-search.el                        |  355 --
 packages/vlf/vlf-setup.el                         |  160 -
 packages/vlf/vlf-tune.el                          |  464 --
 packages/vlf/vlf-write.el                         |  202 -
 packages/vlf/vlf.el                               |  364 --
 85 files changed, 10 insertions(+), 42761 deletions(-)

diff --git a/externals-list b/externals-list
index dfe6402..84a0087 100644
--- a/externals-list
+++ b/externals-list
@@ -6,7 +6,6 @@
 ;; Where NAME is the name of the package;
 ;;
 ;; KIND can be one of:
-;;  :subtree  = a "git subtree" in the `master' branch.
 ;;  :external = kept in a separate `externals/<name>' branch.
 ;;  :core     = part of GNU Emacs repository.
 ;;
@@ -14,8 +13,7 @@
 ;; For KIND :external URL is the URL of the remote git repository that we want
 ;; to track, or `nil' if there is no upstream, i.e., if development of this
 ;; package takes place directly on the `externals/<name>' branch of the
-;; `elpa.git' repository.  In the case of :subtree URL is useless.  For 
packages
-;; of KIND :core URL must be a list of:
+;; `elpa.git' repository.  For packages of KIND :core URL must be a list of:
 ;;    STRING = A file-name to copy from Emacs repo.
 ;;    (STRING STRING) = A file-name to copy renamed from Emacs repo.
 
@@ -40,7 +38,7 @@
  ("bluetooth"          :external "https://gitlab.com/rstocker/emacs-bluetooth";)
  ("bnf-mode"           :external "https://github.com/sergeyklay/bnf-mode";)
  ("buffer-expose"      :external "https://github.com/clemera/buffer-expose";)
- ("bug-hunter"         :subtree 
"https://github.com/Malabarba/elisp-bug-hunter";)
+ ("bug-hunter"         :external 
"https://github.com/Malabarba/elisp-bug-hunter";)
  ;;FIXME:("cedet"      :external "??")
  ;; ("cc-mode"         :core ("lisp/progmodes/cc-align.el"
  ;;                               "lisp/progmodes/cc-awk.el"
@@ -59,7 +57,7 @@
  ;;                               ;; the .info file from this texi file!
  ;;                               "doc/misc/cc-mode.texi"))
  ("chess"              :external nil) ;; Was 
https://github.com/jwiegley/emacs-chess.git
- ;; ("cobol-mode"          :subtree 
"https://gist.github.com/Edward-H/6768e7dc53ea3dd2adca";)
+ ("cobol-mode"          :external 
"https://gist.github.com/Edward-H/6768e7dc53ea3dd2adca";)
  ("cl-print"           :core "lisp/emacs-lisp/cl-print.el")
  ("clipboard-collector" :external 
"https://github.com/clemera/clipboard-collector";)
  ("coffee-mode"                :external 
"https://github.com/defunkt/coffee-mode";)
@@ -70,7 +68,7 @@
  ("cpio-mode"          :external "https://github.com/dlewan/cpio-mode";)
  ("darkroom"            :external 
"https://github.com/capitaomorte/darkroom.git";)
  ("dash"                :external "https://github.com/magnars/dash.el.git";)
- ("dbus-codegen"       :subtree "https://github.com/ueno/dbus-codegen-el.git";)
+ ("dbus-codegen"       :external "https://github.com/ueno/dbus-codegen-el.git";)
  ("delight"            :external "https://git.savannah.gnu.org/r/delight.git";)
  ("diffview"            :external 
"https://github.com/mgalgs/diffview-mode.git";)
  ("diff-hl"            :external "https://github.com/dgutov/diff-hl.git";)
@@ -86,7 +84,7 @@
  ("eldoc-eval"         :external 
"https://github.com/thierryvolpiatto/eldoc-eval.git";)
  ("elisp-benchmarks"   :external nil)
  ("emms"               :external "https://git.savannah.gnu.org/git/emms.git";)
- ("enwc"               :subtree 
"bzr::bzr://bzr.savannah.nongnu.org/enwc/trunk")
+ ("enwc"               :external 
"hg::https://hg.savannah.nongnu.org/hgweb/enwc/";)
  ("ergoemacs-mode"     :external 
"https://github.com/ergoemacs/ergoemacs-mode.git";)
  ("expand-region"      :external "https://github.com/magnars/expand-region.el";)
  ("exwm"               :external "https://github.com/ch11ng/exwm.git";)
@@ -96,7 +94,7 @@
  ("gcmh"               :external "https://gitlab.com/koral/gcmh";)
  ("ggtags"             :external "https://github.com/leoliu/ggtags";)
  ("gnome-c-style"      :external "https://github.com/ueno/gnome-c-style.git";)
- ("gnorb"               :subtree "https://github.com/girzel/gnorb";)
+ ("gnorb"               :external nil) ;; Was "https://github.com/girzel/gnorb";
  ("gnu-elpa"           :external nil)
  ("gpastel"            :external 
"https://gitlab.petton.fr/DamienCassou/gpastel";)
  ("greader"            :external 
"https://gitlab.com/michelangelo-rodriguez/greader";)
@@ -115,7 +113,7 @@
  ("mmm-mode"            :external "https://github.com/purcell/mmm-mode.git";)
  ("modus-operandi-theme":external 
"https://gitlab.com/protesilaos/modus-themes";)
  ("modus-vivendi-theme"        :external 
"https://gitlab.com/protesilaos/modus-themes";)
- ("muse"               :subtree "https://github.com/alexott/muse";)
+ ("muse"               :external "https://github.com/alexott/muse";) ;FIXME: 
Not nearly in-sync
  ("nameless"           :external "https://github.com/Malabarba/Nameless";)
  ("names"              :external "http://github.com/Malabarba/names";)
  ("objed"              :external "https://github.com/clemera/objed";)
@@ -129,7 +127,7 @@
  ("peg"                        :external) ;Was in 
"https://github.com/ellerh/peg.el";
  ("persist"             :external "https://gitlab.com/phillord/persist.git";)
  ("phps-mode"          :external 
"https://github.com/cjohansson/emacs-phps-mode";)
- ("pinentry"           :subtree "https://github.com/ueno/pinentry-el.git";)
+ ("pinentry"           :external "https://github.com/ueno/pinentry-el.git";)
  ("posframe"           :external "https://github.com/tumashu/posframe";)
  ("prefixed-core"      :external nil)
  ("project"            :core "lisp/progmodes/project.el")
@@ -139,7 +137,7 @@
  ;;         --index-filter "git read-tree --empty;                  \
  ;;                         git reset \$GIT_COMMIT -- pspp-mode.el" \
  ;;         -- -- pspp-mode.el
- ("pspp-mode"          :external "https://git.sv.gnu.org/r/pspp.git";)
+ ("pspp-mode"          :external nil) ;; Was 
"https://git.sv.gnu.org/r/pspp.git";
  ("python"             :core "lisp/progmodes/python.el")
  ;;FIXME:("org"                :external ??) ;; Need to introduce snapshots!!
  ("realgud"             :external "https://github.com/realgud/realgud";)
@@ -173,7 +171,7 @@
  ("vcl-mode"           :external "git://git.gnu.org.ua/vcl-mode")
  ("tramp"              :external 
"https://git.savannah.gnu.org/cgit/tramp.git/?h=elpa";)
  ("transient"          :external "https://github.com/magit/transient";)
- ;;FIXME:("vlf"                :subtree ??)
+ ("vlf"                        :external "https://github.com/m00natic/vlfi";)
  ("verilog-mode"        :core "lisp/progmodes/verilog-mode.el")
  ("wcheck-mode"                :external 
"https://github.com/tlikonen/wcheck-mode";)
  ("web-server"         :external 
"https://github.com/eschulte/emacs-web-server.git";)
diff --git a/packages/bug-hunter/README.org b/packages/bug-hunter/README.org
deleted file mode 100644
index d8c9463..0000000
--- a/packages/bug-hunter/README.org
+++ /dev/null
@@ -1,92 +0,0 @@
-#+OPTIONS: toc:nil num:nil
-#+TITLE: [[file:hunter.png]] The Bug Hunter 
[[https://travis-ci.org/Malabarba/elisp-bug-hunter][file:https://travis-ci.org/Malabarba/elisp-bug-hunter.svg?branch=master]]
-
-/Automatically debug and bisect your init (.emacs) file!/
-
-The Bug Hunter is an Emacs library that finds the source of an error
-or unexpected behavior inside an elisp configuration file (typically
-~init.el~ or ~.emacs~).
-
-[[file:hunter-screencast.gif]]
-
-* Usage Examples
-
-** Automated error hunting
-If your Emacs init file signals an error during startup, but you don’t
-know why, simply issue
-#+BEGIN_SRC text
-M-x bug-hunter-init-file RET e
-#+END_SRC
-and The Bug Hunter will find it for you.  Note that your ~init.el~
-(or ~.emacs~) must be idempotent for this to work.
-
-** Interactive hunt
-
-If Emacs starts up without errors but something is not working as it
-should, invoke the same command, but choose the interactive option:
-#+BEGIN_SRC text
-M-x bug-hunter-init-file RET i
-#+END_SRC
-The Bug Hunter will start a separate Emacs instance several times, and
-then it will ask you each time whether that instance presented the
-problem you have. After doing this about 5--12 times, you’ll be given
-the results.
-
-** Assertion hunt
-
-The Bug Hunter can also find your issue based on an assertion.
-Essentially, if you can write a code snippet that returns non-nil when
-it detects the issue, just provide this snippet as the assertion and
-the Bug Hunter will do the rest.
-
-For example, let’s say there’s something in your init file that’s
-loading the ~cl~ library, and you don’t want that. You /know/ you’re
-not loading it yourself, but how can you figure out which external
-package is responsible for this outrage?
-
-#+BEGIN_SRC text
-M-x bug-hunter-init-file RET a (featurep 'cl) RET
-#+END_SRC
-
-*That’s it!* You’ll be given a nice buffer reporting the results:
-
-[[file:cl-example.png]]
-- Are you getting obscure errors when trying to open /“.tex”/ files?
-  - Don’t despair! Just use ~(find-file "dummy.tex")~ as the assertion.
-- Did ~ox-html~ stop working due to some arcane misconfiguration?
-  - Just write an assertion that does an export and checks the result.
-- Does some random command suddenly bind itself to ~C-j~ and you can’t figure 
out why?
-  - ~(eq (key-binding "\n") 'unwanted-command)~ is the assertion for you!
-
-Finally, you can also use ~bug-hunter-file~ to hunt in other files.
-
-* Installation
-The Bug Hunter is available from 
[[https://elpa.gnu.org/packages/bug-hunter.html][GNU Elpa]] to all Emacs 
versions since
-~24.1~. To install, just issue
-
-#+BEGIN_SRC text
-M-x package-install RET bug-hunter
-#+END_SRC
-
-* init.org and other literate-style configs
-
-Some people (me included) like to organize their init files by
-writting it in ~org-mode~ instead of Emacs-Lisp. This usually involves
-adding something like this to ~init.el~,
-#+BEGIN_SRC emacs-lisp
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Maybe some code up here ;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(require 'org)
-(org-babel-tangle-file "~/.emacs.d/org-init.org"
-                       "~/.emacs.d/org-init.el")
-(load "~/.emacs.d/org-init.el")
-#+END_SRC
-
-At first, this makes the Bug-Hunter essentially useless, for it will
-do the hunting in ~init.el~ instead of the much more extensive
-~org-init.el~. The name of the second file (~org-init.el~) will vary,
-but the point is the same. But fear not! There’s a simple solution:
-
-1. If you have any code above the call to ~org-babel-tangle-file~, copy that 
to the top of ~org-init.el~ (or whatever is the name of your tangled file). 
This includes that ~(require 'org)~ over there.
-2. Invoke ~M-x~ ~bug-hunter-file~ (instead of ~bug-hunter-init-file~). It will 
ask you which file to debug, and you need to point it to your tangled output 
file ~org-init.el~.
diff --git a/packages/bug-hunter/bug-hunter.el 
b/packages/bug-hunter/bug-hunter.el
deleted file mode 100644
index 30c2c8e..0000000
--- a/packages/bug-hunter/bug-hunter.el
+++ /dev/null
@@ -1,533 +0,0 @@
-;;; bug-hunter.el --- Hunt down errors by bisecting elisp files  -*- 
lexical-binding: t; -*-
-
-;; Copyright (C) 2015 Free Software Foundation, Inc.
-
-;; Author: Artur Malabarba <emacs@endlessparentheses.com>
-;; URL: https://github.com/Malabarba/elisp-bug-hunter
-;; Version: 1.3.1
-;; Keywords: lisp
-;; Package-Requires: ((seq "1.3") (cl-lib "0.5"))
-
-;; 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 3 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, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;; An Emacs library that finds the source of an error or unexpected
-;; behavior inside an elisp configuration file (typically `init.el' or
-;; `.emacs').
-;;
-;; Usage Examples
-;; ==============
-;;
-;; Automated error hunting
-;; ~~~~~~~~~~~~~~~~~~~~~~~
-;;
-;;   If your Emacs init file signals an error during startup, but you don’t
-;;   know why, simply issue
-;;   ,----
-;;   | M-x bug-hunter-init-file RET e
-;;   `----
-;;   and The Bug Hunter will find it for you. Note that your `init.el' (or
-;;   `.emacs') must be idempotent for this to work.
-;;
-;;
-;; Interactive hunt
-;; ~~~~~~~~~~~~~~~~
-;;
-;;   If Emacs starts up without errors but something is not working as it
-;;   should, invoke the same command, but choose the interactive option:
-;;   ,----
-;;   | M-x bug-hunter-init-file RET i
-;;   `----
-;;   The Bug Hunter will start a separate Emacs instance several times, and
-;;   then it will ask you each time whether that instance presented the
-;;   problem you have. After doing this about 5--12 times, you’ll be given
-;;   the results.
-;;
-;;
-;; Assertion hunt
-;; ~~~~~~~~~~~~~~
-;;
-;;   The Bug Hunter can also find your issue based on an assertion.
-;;   Essentially, if you can write a code snippet that returns non-nil when
-;;   it detects the issue, just provide this snippet as the assertion and
-;;   the Bug Hunter will do the rest.
-;;
-;;   For example, let’s say there’s something in your init file that’s
-;;   loading the `cl' library, and you don’t want that. You /know/ you’re
-;;   not loading it yourself, but how can you figure out which external
-;;   package is responsible for this outrage?
-;;
-;;   ,----
-;;   | M-x bug-hunter-init-file RET a (featurep 'cl) RET
-;;   `----
-;;
-;;   *That’s it!* You’ll be given a nice buffer reporting the results:
-;;
-;;   - Are you getting obscure errors when trying to open /".tex"/ files?
-;;     - Don’t despair! Just use `(find-file "dummy.tex")' as the
-;;       assertion.
-;;   - Did `ox-html' stop working due to some arcane misconfiguration?
-;;     - Just write an assertion that does an export and checks the result.
-;;   - Does some random command suddenly bind itself to `C-j' and you can’t
-;;     figure out why?
-;;     - `(eq (key-binding "\n") 'unwanted-command)' is the assertion for
-;;       you!
-;;
-;;   Finally, you can also use `bug-hunter-file' to hunt in other files.
-;;
-;;
-;; init.org and other literate-style configs
-;; =========================================
-;;
-;; Please see the full Readme on http://github.com/Malabarba/elisp-bug-hunter
-
-;;; Code:
-(require 'seq)
-(require 'cl-lib)
-
-(defconst bug-hunter--interactive-explanation
-  "You have asked to do an interactive hunt, here's how it goes.
-1) I will start a new Emacs instance, which opens a new frame.
-2) You will try to reproduce your problem on the new frame.
-3) When you’re done, close that frame.
-4) I will ask you if you managed to reproduce the problem.
-5) We will repeat steps up to %s times, so hang tight!")
-
-(defconst bug-hunter--assertion-reminder
-  "Remember, the assertion must be an expression that returns
-non-nil in your current (problematic) Emacs state, AND that
-returns nil on a clean Emacs instance.
-If you're unsure how to write an assertion, you can try the interactive
-hunt instead, or see some examples in the Readme:
-    https://github.com/Malabarba/elisp-bug-hunter";
-  "Printed to the user if they provide a bad assertion.")
-
-(defvar bug-hunter--current-head nil
-  "Current list of expressions under scrutiny.  Used for user feedback.
-Used if the user aborts before bisection ends.")
-
-(defvar bug-hunter--i 0
-  "Current step of the bisection.  Used for user feedback.")
-(defvar bug-hunter--estimate 0
-  "Estimate on how many steps the bisection can take.  Used for user feedback.
-This is the base 2 log of the number of expressions in the
-file.")
-
-(defvar bug-hunter--current-file nil
-  "File currently being debugged.")
-
-(defun bug-hunter--read-buffer ()
-  "Return all sexps after point as a list."
-  (let (out line col)
-    (or (condition-case er
-            ;; Looks hacky, but comes from `byte-compile-from-buffer'.
-            (while (progn (while (progn (skip-chars-forward " \t\n\^l")
-                                        (looking-at ";"))
-                            (forward-line 1))
-                          (not (eobp)))
-              (setq line (line-number-at-pos (point)))
-              (setq col (current-column))
-              (push (list (read (current-buffer)) line col)
-                    out)
-              nil)
-          (end-of-file `(bug-caught (end-of-file) ,line ,col))
-          (invalid-read-syntax `(bug-caught ,er ,line ,col))
-          (error
-           (if (string= (elt er 1) "Invalid modifier in string")
-               `(bug-caught (invalid-modifier) ,line ,col)
-             (error "Ran into an error we don't understand, please file a bug 
report: %S" er))))
-        (nreverse out))))
-
-(defun bug-hunter--read-contents (file)
-  "Return all sexps in FILE as a list."
-  (with-temp-buffer
-    (insert-file-contents file)
-    (goto-char (point-min))
-    (bug-hunter--read-buffer)))
-
-
-;;; Reporting functions
-(defun bug-hunter--report-print (&rest r)
-  "Print information on the \"*Bug-Hunter Report*\" buffer.
-R is passed to `format' and inserted."
-  (with-current-buffer (get-buffer-create "*Bug-Hunter Report*")
-    (goto-char (point-max))
-    (let ((inhibit-read-only t))
-      (insert "\n" (apply #'format r)))))
-
-(defun bug-hunter--report (&rest r)
-  "Report arbitrary information.
-R is passed to `bug-hunter--report-print'."
-  (declare (indent 1))
-  (apply #'bug-hunter--report-print r)
-  (redisplay)
-  (apply #'message r))
-
-(defun bug-hunter--report-user-error (&rest r)
-  "Report the user has done something wrong.
-R is passed to `bug-hunter--report-print'."
-  (declare (indent 1))
-  (apply #'bug-hunter--report-print r)
-  (bug-hunter--report-print "\xc\n")
-  (apply #'user-error r))
-
-(defvar compilation-error-regexp-alist)
-(defun bug-hunter--init-report-buffer (assertion steps)
-  "Create and prepare the \"*Bug-Hunter Report*\" buffer.
-Also add some descriptions depending on ASSERTION."
-  (with-current-buffer (get-buffer-create "*Bug-Hunter Report*")
-    (let ((inhibit-read-only t))
-      (erase-buffer)
-      (compilation-mode "Bug Hunt")
-      (set (make-local-variable 'compilation-error-regexp-alist)
-           '(comma))
-      (pcase assertion
-        (`interactive (insert (format bug-hunter--interactive-explanation (+ 2 
steps))))))
-    (current-buffer)))
-
-(defun bug-hunter--pretty-format (value padding)
-  "Return a VALUE as a string with PADDING spaces on the left."
-  (with-temp-buffer
-    (pp value (current-buffer))
-    (goto-char (point-min))
-    (let ((pad (make-string padding ?\s)))
-      (while (not (eobp))
-        (insert pad)
-        (forward-line 1)))
-    (buffer-string)))
-
-(defun bug-hunter--report-error (error line column &optional expression)
-  "Print on report buffer information about ERROR.
-LINE and COLUMN are the coordinates where EXPRESSION started in
-the file."
-  (when line
-    (bug-hunter--report "%S, line %s pos %s:"
-      bug-hunter--current-file line column))
-  (bug-hunter--report "  %s"
-    (cl-case (car error)
-      (end-of-file
-       "There's a missing closing parenthesis, the expression on this line 
never ends.")
-      (invalid-modifier (concat "There's a string on this line with an invalid 
modifier."
-                                "\n  A \"modifier\" is a \\ followed by a few 
characters."
-                                "\n  For example, \\C-; is an invalid 
modifier."))
-      (invalid-read-syntax
-       (let ((char (cadr error)))
-         (if (member char '("]" ")"))
-             (concat "There's an extra " char
-                     " on this position. There's probably a missing "
-                     (if (string= char ")") "(" "[")
-                     " before that.")
-           (concat "There's a " char
-                   " on this position, and that is not valid elisp syntax."))))
-      (user-aborted
-       (let* ((print-level 2)
-              (print-length 15)
-              (forms (cadr error))
-              (size (length forms)))
-         (concat "User aborted while testing the following expressions:\n"
-                 (mapconcat (lambda (x) (bug-hunter--pretty-format x 4))
-                            (if (< size 16) forms (seq-take forms 7))
-                            "")
-                 (when (> size 16)
-                   (format "\n    ... %s omitted expressions ...\n\n"
-                           (- size 14)))
-                 (when (> size 16)
-                   (mapconcat (lambda (x) (bug-hunter--pretty-format x 4))
-                              (seq-drop forms (- size 7)) "")))))
-      (assertion-triggered
-       (concat "The assertion returned the following value here:\n"
-               (bug-hunter--pretty-format (cadr error) 4)))
-      (t (format "The following error was signaled here:\n    %S"
-                 error))))
-  (when expression
-    (bug-hunter--report "  Caused by the following expression:\n%s"
-      (bug-hunter--pretty-format expression 4)))
-  (bug-hunter--report "\xc\n")
-  `[,error ,line ,column ,expression])
-
-
-;;; Execution functions
-(defun bug-hunter--print-to-temp (sexp)
-  "Print SEXP to a temp file and return the file name."
-  (let ((print-length nil)
-        (print-level nil)
-        (file (make-temp-file "bug-hunter")))
-    (with-temp-file file
-      (print sexp (current-buffer)))
-    file))
-
-(defun bug-hunter--run-emacs (file &rest args)
-  "Start an Emacs process to run FILE and return the output buffer.
-ARGS are passed before \"-l FILE\"."
-  (let ((out-buf (generate-new-buffer "*Bug-Hunter Command*"))
-        (exec (file-truename (expand-file-name invocation-name
-                                               invocation-directory))))
-    (apply #'call-process exec nil out-buf nil
-           (append args (list "-l" file)))
-    out-buf))
-
-(defun bug-hunter--run-form (form)
-  "Run FORM with \"emacs -Q\" and return the result."
-  (let ((file-name (bug-hunter--print-to-temp (list 'prin1 form))))
-    (unwind-protect
-        (with-current-buffer (bug-hunter--run-emacs file-name "-Q" "--batch")
-          (goto-char (point-max))
-          (forward-sexp -1)
-          (prog1 (read (current-buffer))
-            (kill-buffer (current-buffer))))
-      (delete-file file-name))))
-
-(defun bug-hunter--run-form-interactively (form)
-  "Run FORM in a graphical instance and ask user about the outcome."
-  (let ((file-name (bug-hunter--print-to-temp (list 'prin1 form))))
-    (unwind-protect
-        (bug-hunter--run-emacs file-name "-Q")
-      (delete-file file-name))
-    (y-or-n-p "Did you find the problem/bug in this instance (if you encounter 
some other issue, answer `n')? ")))
-
-(defun bug-hunter--wrap-forms-for-eval (forms)
-  "Return FORMS wrapped in initialization code."
-  `(let ((server-name (make-temp-file "bug-hunter-temp-server-file")))
-     (delete-file server-name)
-     (if site-run-file (load site-run-file t t))
-     (run-hooks 'before-init-hook)
-     ,@forms
-     (package-initialize)
-     (run-hooks 'after-init-hook)))
-
-(defun bug-hunter--run-and-test (forms assertion)
-  "Execute FORMS in the background and test ASSERTION.
-See `bug-hunter' for a description on the ASSERTION.
-
-If ASSERTION is `interactive', the form is run through
-`bug-hunter--run-form-interactively'.  Otherwise, a slightly
-modified version of the form combined with ASSERTION is run
-through `bug-hunter--run-form'."
-  (if (eq assertion 'interactive)
-      (bug-hunter--run-form-interactively
-       (bug-hunter--wrap-forms-for-eval forms))
-    (bug-hunter--run-form
-     `(condition-case er
-          ,(append (bug-hunter--wrap-forms-for-eval forms)
-                   (list assertion))
-        (error (cons 'bug-caught er))))))
-
-
-
-;;; The actual bisection
-(defun bug-hunter--split (l)
-  "Split list L in two lists of same size."
-  (seq-partition l (ceiling (/ (length l) 2.0))))
-
-(defun bug-hunter--bisect (assertion safe head &optional tail)
-  "Implementation used by `bug-hunter--bisect-start'.
-ASSERTION is received by `bug-hunter--bisect-start'.
-SAFE is a list of forms confirmed to not match the ASSERTION,
-HEAD is a list of forms to be tested now, and TAIL is a list
-which will be inspected if HEAD doesn't match ASSERTION."
-  (message "Testing: %s/%s" (cl-incf bug-hunter--i) bug-hunter--estimate)
-  ;; Used if the user quits.
-  (setq bug-hunter--current-head head)
-  (let ((ret-val (bug-hunter--run-and-test (append safe head) assertion)))
-    (cond
-     ((not tail)
-      (cl-assert ret-val nil)
-      (vector (length safe) ret-val))
-     ;; Issue in the head.
-     ((and ret-val (< (length head) 2))
-      (vector (length safe) ret-val))
-     (ret-val
-      (apply #'bug-hunter--bisect
-             assertion
-             safe
-             (bug-hunter--split head)))
-     ;; Issue in the tail.
-     (t (apply #'bug-hunter--bisect
-               assertion
-               (append safe head)
-               ;; If tail has length 1, we already know where the issue is,
-               ;; but we still do this to get the return value.
-               (bug-hunter--split tail))))))
-
-(defun bug-hunter--bisect-start (forms assertion)
-  "Run a bisection search on list of FORMS using ASSERTION.
-Returns a vector [n value], where n is the position of the first
-element in FORMS which trigger ASSERTION, and value is the
-ASSERTION's return value.
-
-If ASSERTION is nil, n is the position of the first form to
-signal an error and value is (bug-caught . ERROR-SIGNALED)."
-  (let ((bug-hunter--i 0)
-        (bug-hunter--current-head nil))
-    (condition-case-unless-debug nil
-        (apply #'bug-hunter--bisect assertion nil (bug-hunter--split forms))
-      (quit `[nil (bug-caught user-aborted ,bug-hunter--current-head)]))))
-
-
-;;; Main functions
-(defun bug-hunter-hunt (rich-forms assertion)
-  "Bisect RICH-FORMS using ASSERTION.
-RICH-FORMS is a list with elements of the form: (EXPR LINE COL)
-    EXPR is an elisp expression.  LINE and COL are the coordinates
-    in `bug-hunter--current-file' where the expression starts.
-It is expected that one of EXPR is either throwing an error or
-causing some undesirable effect (which triggers ASSERTION).
-
-ASSERTION is either nil or an expression.
-    If nil, EXPRs are bisected until we find the first one that
-    throws errors.
-    If it is an expression, EXPRs are bisected by testing
-    ASSERTION.  It should return nil if all is fine (e.g. if used
-    with \"emacs -Q\"), and should return non-nil when a problem
-    is detected.
-
-Bug hunter will refuse to hunt if (i) an error is signaled or the
-assertion is triggered while running emacs -Q, or (ii) no errors
-are signaled and the assertion is not triggered after all EXPRs
-are evaluated."
-  (let ((expressions (unless (eq (car-safe rich-forms) 'bug-caught)
-                       (mapcar #'car rich-forms)))
-        (bug-hunter--estimate (ceiling (log (length rich-forms) 2))))
-    ;; Prepare buffer, and make sure they've seen it.
-    (switch-to-buffer (bug-hunter--init-report-buffer assertion 
bug-hunter--estimate))
-    (when (eq assertion 'interactive)
-      (read-char-choice "Please read the instructions above and type 6 when 
ready. " '(?6)))
-
-    (cond
-     ;; Check for errors when reading the init file.
-     ((not expressions)
-      (apply #'bug-hunter--report-error (cdr rich-forms))
-      (apply #'vector (cdr rich-forms)))
-
-     ;; Make sure there's a bug to hunt.
-     ((progn (bug-hunter--report "Doing some initial tests...")
-             (not (bug-hunter--run-and-test expressions assertion)))
-      (bug-hunter--report-user-error "Test failed.\n%s\n%s"
-        (if assertion
-            (concat "The assertion returned nil after loading the entire 
file.\n"
-                    bug-hunter--assertion-reminder)
-          "No errors signaled after loading the entire file.
-If you're looking for something that's not an error, use the
-interactive hunt instead of the error hunt.  If you have some
-elisp proficiency, you can also use the assertion hunt, see this
-link for some examples:
-    https://github.com/Malabarba/elisp-bug-hunter";)
-        (or assertion "")))
-
-     ;; Make sure we're in a forest, not a volcano.
-     ((bug-hunter--run-and-test nil assertion)
-      (bug-hunter--report-user-error "Test failed.\n%s\n%s"
-        (if assertion
-            (concat "Assertion returned non-nil even on emacs -Q:"
-                    bug-hunter--assertion-reminder)
-          "Detected a signaled error even on emacs -Q. This could mean three
-things things:
-1. The problem happens inside `package-initialize'.
-2. You wrote the assertion wrong.
-3. There's something seriously wrong with your Emacs installation.")
-        (or assertion "")))
-
-     (t
-      ;; Perform the actual hunt.
-      (bug-hunter--report "Initial tests done. Hunting for the cause...")
-      (let* ((result (bug-hunter--bisect-start expressions assertion)))
-        (if (not result)
-            (bug-hunter--report-user-error "No problem was found, despite our 
initial tests.\n%s"
-              "I have no idea what's going on.")
-          (let* ((pos (elt result 0))
-                 (ret (elt result 1))
-                 (linecol (when pos (cdr (elt rich-forms pos))))
-                 (expression (when pos (elt expressions pos))))
-            (if (eq (car-safe ret) 'bug-caught)
-                (bug-hunter--report-error
-                 (cdr ret) (car linecol) (cadr linecol) expression)
-              (bug-hunter--report-error
-               (list 'assertion-triggered ret)
-               (car linecol) (cadr linecol) expression)))))))))
-
-(defconst bug-hunter--hunt-type-prompt
-  "To bisect interactively, type i
-To use automatic error detection, type e
-To provide a lisp assertion, type a
-=> ")
-
-(defun bug-hunter--read-from-minibuffer ()
-  "Read a list of expressions from the minibuffer.
-Wraps them in a progn if necessary to always return a single
-form.
-
-The user may decide to not provide input, in which case
-`interactive' is returned.  Note, this is different from the user
-typing RET at an empty prompt, in which case nil is returned."
-  (pcase (read-char-choice (if (display-graphic-p)
-                               bug-hunter--hunt-type-prompt
-                             (replace-regexp-in-string "To bisect 
interactively,.*\n" ""
-                                                       
bug-hunter--hunt-type-prompt))
-                           '(?i ?e ?a))
-    (`?i
-     (unless (display-graphic-p)
-       (user-error "Sorry, but `interactive' bisection needs a graphical 
frame"))
-     'interactive)
-    (`?e nil)
-    (_
-     (require 'simple)
-     (let ((exprs
-            (with-temp-buffer
-              ;; Copied from `read--expression'.
-              (let ((minibuffer-completing-symbol t))
-                (minibuffer-with-setup-hook
-                    (lambda ()
-                      (add-hook 'completion-at-point-functions
-                                (if (fboundp 'elisp-completion-at-point)
-                                    #'elisp-completion-at-point
-                                  (with-no-warnings
-                                    #'lisp-completion-at-point))
-                                nil t)
-                      (run-hooks 'eval-expression-minibuffer-setup-hook))
-                  (insert
-                   (read-from-minibuffer
-                    "Provide an assertion.  This is a lisp expression that 
returns nil if (and only if) everything is fine:\n => "
-                    nil read-expression-map nil 'read-expression-history))))
-              (goto-char (point-min))
-              (mapcar #'car (bug-hunter--read-buffer)))))
-       (if (cdr exprs)
-           (cons #'progn exprs)
-         (car exprs))))))
-
-;;;###autoload
-(defun bug-hunter-file (file &optional assertion)
-  "Bisect FILE while testing ASSERTION.
-All sexps in FILE are read and passed to `bug-hunter-hunt' as a
-list.  See `bug-hunter-hunt' for how to use ASSERTION."
-  (interactive
-   (list
-    (read-file-name "File to bisect: "
-                    (file-name-directory (or (buffer-file-name) "./"))
-                    nil t
-                    (file-name-nondirectory (or (buffer-file-name) "./")))
-    (bug-hunter--read-from-minibuffer)))
-  (let ((bug-hunter--current-file file))
-    (bug-hunter-hunt (bug-hunter--read-contents file) assertion)))
-
-;;;###autoload
-(defun bug-hunter-init-file (&optional assertion)
-  "Test ASSERTION throughout `user-init-file'.
-All sexps inside `user-init-file' are read and passed to
-`bug-hunter-hunt' as a list.  See `bug-hunter-hunt' for how to use
-ASSERTION."
-  (interactive (list (bug-hunter--read-from-minibuffer)))
-  (bug-hunter-file user-init-file assertion))
-
-(provide 'bug-hunter)
-;;; bug-hunter.el ends here
diff --git a/packages/cobol-mode/cobol-mode.el 
b/packages/cobol-mode/cobol-mode.el
deleted file mode 100644
index f7dcab8..0000000
--- a/packages/cobol-mode/cobol-mode.el
+++ /dev/null
@@ -1,3096 +0,0 @@
-;;; cobol-mode.el --- Mode for editing COBOL code -*- lexical-binding: t; -*-
-
-;; Copyright (C) 2013-2019  Free Software Foundation, Inc.
-
-;; Author: Edward Hart <edward.dan.hart@gmail.com>
-;; Maintainer: Edward Hart <edward.dan.hart@gmail.com>
-;; Version: 1.0.0
-;; Created: 9 November 2013
-;; Keywords: languages
-;; Package-Requires: ((cl-lib "0.5"))
-
-;; 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 3 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, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This file should not be confused with Rick Bielawski's cobol-mode.el
-;; (http://www.emacswiki.org/emacs/cobol-mode.el), which this mode attempts to
-;; supersede.
-
-;; This COBOL mode features syntax highlighting for most modern COBOL dialects,
-;; indentation, code skeletons, rulers and basic formatting functions.
-;; Highlighting changes with the code format, which can be specified using the
-;; M-x customize menu.
-
-;;;; Installation:
-
-;; To install cobol-mode.el, save it to your .emacs.d/ directory and add the
-;; following to your .emacs:
-;; (autoload 'cobol-mode "cobol-mode" "Major mode for highlighting COBOL 
files." t nil)
-
-;; To automatically load cobol-mode.el upon opening COBOL files, add this:
-;; (setq auto-mode-alist
-;;       (append
-;;        '(("\\.cob\\'" . cobol-mode)
-;;          ("\\.cbl\\'" . cobol-mode)
-;;          ("\\.cpy\\'" . cobol-mode))
-;;        auto-mode-alist))
-
-;; Finally, I strongly suggest installing auto-complete-mode, which makes 
typing
-;; long keywords and variable names a thing of the past.  See
-;; https://github.com/auto-complete/auto-complete.
-
-;;;; Known bugs:
-
-;; * Switching source formats requires M-x customize settings to be changed,
-;;   saved and cobol-mode to be unloaded then reloaded.
-;; * Copying-and-pasting content in fixed-format sometimes results in content
-;;   being pasted in column 1 and spaces inserted in the middle of it.
-;; * The indentation code leaves a lot of trailing whitespace.
-;; * Periods on their own line are sometimes indented strangely.
-;; * String continuation does not work.
-
-;;;; Missing features:
-
-;; * Switch between dialect's reserved word lists via M-x customize (without
-;;   unloading cobol-mode).
-;; * Allow users to modify easily reserved word lists.
-;; * Expand copybooks within a buffer.
-;; * String continuation (see above).
-;; * Allow users to modify start of program-name area.
-
-;;; Code:
-
-(eval-when-compile (require 'cl-lib))
-
-(defgroup cobol nil
-  "Major mode for editing COBOL code."
-  :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces)
-  :prefix 'cobol-
-  :group 'languages)
-
-(eval-and-compile
-(defun cobol--radio-of-list (list)
-  "Return radio with the elements of LIST as its arguments."
-  (cons 'radio (mapcar #'(lambda (elt) (list 'const elt)) list)))
-
-(defun cobol--val-in-list-p (list)
-  "Return a predicate to check whether a value is in the LIST."
-  #'(lambda (value) (memq value list))))
-
-(defcustom cobol-declaration-clause-indent 40
-  "Column to indent data division declaration clauses to."
-  :type 'integer
-  :safe 'integerp)
-
-(eval-and-compile
-(defconst cobol-formats
-  '(fixed-85 fixed-2002 free)
-  "The accepted values for `cobol-source-format'.")
-
-(defcustom cobol-source-format 'fixed-85
-  "Source format of COBOL source code."
-  :type (cobol--radio-of-list cobol-formats)
-  :safe (cobol--val-in-list-p cobol-formats)))
-
-;; Ruler
-;; Code derived from the Emacs fortran.el, rulers from IBM Rational Developer.
-
-(defcustom cobol-fixed-85-ruler
-  
"----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+----7--|-+----\n"
-  "Ruler for COBOL-85-style fixed format code."
-  :type  'string
-  :safe  'stringp)
-
-(defcustom cobol-fixed-2002-ruler
-  
"----+-*--1----+----2----+----3----+----4----+----5----+----6----+----7----+----\n"
-  "Ruler for COBOL-2002-style fixed format code."
-  :type  'string
-  :safe  'stringp)
-
-(defcustom cobol-free-ruler
-  
"----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----\n"
-  "Ruler for free format code."
-  :type  'string
-  :safe  'stringp)
-
-(defun cobol-column-ruler ()
-  "Insert a column ruler above the current line until the next keystroke.
-The next key typed is executed unless it is SPC."
-  (interactive)
-  (momentary-string-display
-   (cond ((eq cobol-source-format 'fixed-85)
-          cobol-fixed-85-ruler)
-         ((eq cobol-source-format 'fixed-2002)
-          cobol-fixed-2002-ruler)
-         ((eq cobol-source-format 'free)
-          cobol-free-ruler))
-   (save-excursion
-     (beginning-of-line)
-     (if (eq (window-start (selected-window))
-             (window-point (selected-window)))
-         (line-beginning-position 2)
-       (point)))
-   nil "Type SPC or any command to erase the ruler."))
-
-(defcustom cobol-mode-hook nil
-  "Hook run by `cobol-mode'."
-  :type 'hook)
-
-(defun cobol--remove-strings (l1 l2)
-  "Return a list of strings in L1 not in L2."
-  (cl-set-difference l1 l2 :test #'string-equal))
-
-(defconst cobol-directives
-  '("CALL-CONVENTION"
-    "D"
-    "DEFINE"
-    "ELIF"
-    "ELSE"
-    "END-EVALUATE"
-    "END-IF"
-    "EVALUATE"
-    "FLAG-02"
-    "FLAG-85"
-    "FLAG-NATIVE-ARITHMETIC"
-    "IF"
-    "IMP"
-    "LEAP-SECOND"
-    "LISTING"
-    "PAGE"
-    "PROPAGATE"
-    "SOURCE"
-    "TURN"
-    "WHEN")
-  "List of COBOL compiler directives.")
-
-(defconst cobol-verbs-74
-  '("GO TO"
-    "NEXT SENTENCE"
-    "ACCEPT"
-    "ADD"
-    "ALTER"
-    "CALL"
-    "CANCEL"
-    "CLOSE"
-    "COPY"
-    "COMPUTE"
-    "DELETE"
-    "DISABLE"
-    "DISPLAY"
-    "DIVIDE"
-    "ENABLE"
-    "ENTER"
-    "EXIT"
-    "GENERATE"
-    "GO"
-    "IF"
-    "INITIATE"
-    "INSPECT"
-    "MERGE"
-    "MOVE"
-    "MULTIPLY"
-    "OPEN"
-    "PERFORM"
-    "READ"
-    "RECEIVE"
-    "RELEASE"
-    "RESET"
-    "RETURN"
-    "REWRITE"
-    "SEARCH"
-    "SELECT"
-    "SEND"
-    "SET"
-    "SORT"
-    "START"
-    "STOP"
-    "STRING"
-    "SUBTRACT"
-    "SUPPRESS"
-    "TERMINATE"
-    "UNSTRING"
-    "USE"
-    "WRITE"))
-
-(defconst cobol-verbs-85
-  (append cobol-verbs-74
-          '("CONTINUE"
-            "EVALUATE"
-            "INITIALIZE"
-            "REPLACE")))
-
-(defconst cobol-removed-verbs-2002
-  '("ALTER" "ENTER"))
-
-(defconst cobol-verbs-2002
-  (append (cobol--remove-strings cobol-verbs-85 cobol-removed-verbs-2002)
-          '("ALLOCATE"
-            "FREE"
-            "GOBACK"
-            "INVOKE"
-            "RAISE"
-            "RESUME"
-            "UNLOCK"
-            "VALIDATE")))
-
-(defconst cobol-removed-verbs-2014
-  '("DISABLE"
-    "ENABLE"
-    "SEND"
-    "RECEIVE"))
-
-(defconst cobol-verbs-2014
-  (cobol--remove-strings cobol-verbs-2002
-                         cobol-removed-verbs-2014))
-
-(defconst cobol-verbs-extensions
-  '("DELETE FILE"
-    "READY TRACE"
-    "RESET TRACE"
-    "XML GENERATE"
-    "XML PARSE"
-    "ATTACH"
-    "ALLOW" ; Unisys COBOL-74
-    "AWAIT-OPEN" ; Unisys COBOL-74
-    "CAUSE" ; Unisys COBOL-74
-    "CHAIN"
-    "CHANGE" ; Unisys COBOL-74
-    "COLOR"
-    "COMMIT"
-    "CREATE"
-    "DECLARE"
-    "DELEGATE"
-    "DETACH"
-    "DISALLOW" ; Unisys COBOL-74
-    "ENTRY"
-    "EXAMINE"
-    "EXEC"
-    "EXECUTE"
-    "EXHIBIT"
-    ;; "LOCK" ; Unisys COBOL-74 ; Treated as keyword
-    "MODIFY"
-    "NOTE"
-    "ON" ; OS/VS Statement ; Keyword <= COBOL-74
-    "PROCESS" ; Unisys COBOL-74
-    "RESPOND" ; Unisys COBOL-74
-    "ROLLBACK"
-    ;; "RUN" ; Unisys COBOL-74 ; Treated as keyword
-    "SEEK" ; Unisys COBOL-74
-    "SERVICE"
-    "SYNC" ; <= COBOL-74
-    "TRANSFORM"
-    "TRY"
-    "WAIT"))
-
-(defconst cobol-verbs
-  (append cobol-verbs-2014
-          cobol-removed-verbs-2002
-          cobol-removed-verbs-2014
-          cobol-verbs-extensions)
-  "List of COBOL verb keywords.")
-
-(defconst cobol-scope-terminators-85
-  '("END-ADD"
-    "END-CALL"
-    "END-COMPUTE"
-    "END-DELETE"
-    "END-DIVIDE"
-    "END-EVALUATE"
-    "END-IF"
-    "END-MULTIPLY"
-    "END-PERFORM"
-    "END-READ"
-    "END-RECEIVE"
-    "END-RETURN"
-    "END-REWRITE"
-    "END-SEARCH"
-    "END-START"
-    "END-STRING"
-    "END-SUBTRACT"
-    "END-UNSTRING"
-    "END-WRITE"))
-
-(defconst cobol-scope-terminators-2002
-  (append cobol-scope-terminators-85
-          '("END-ACCEPT"
-            "END-DISPLAY")))
-
-(defconst cobol-removed-scope-terminators-2014
-  '("END-RECEIVE"))
-
-(defconst cobol-scope-terminators-2014
-  (cobol--remove-strings cobol-scope-terminators-2002
-                         cobol-removed-scope-terminators-2014))
-
-(defconst cobol-scope-terminators-xml-tr
-  '("END-OPEN"))
-
-(defconst cobol-scope-terminators-extensions
-  '("END-CHAIN"
-    "END-COLOR"
-    "END-DELEGATE"
-    "END-EXEC"
-    "END-INVOKE"
-    "END-MODIFY"
-    "END-MOVE"
-    "END-SYNC"
-    "END-TRY"
-    "END-WAIT"
-    "END-XML"))
-
-(defconst cobol-scope-terminators
-  (append cobol-scope-terminators-2014
-          cobol-scope-terminators-xml-tr
-          cobol-scope-terminators-extensions))
-
-(defconst cobol-keywords-74
-  '("ACCESS"
-    "ADVANCING"
-    "AFTER"
-    "ALL"
-    "ALPHABETIC"
-    "ALSO"
-    "ALTERNATE"
-    "AND"
-    "ARE"
-    "AREA"
-    "AREAS"
-    "ASCENDING"
-    "ASSIGN"
-    "AT"
-    "AUTHOR"
-    "BEFORE"
-    "BLANK"
-    "BLOCK"
-    "BOTTOM"
-    "BY"
-    "CD"
-    "CF"
-    "CH"
-    "CHARACTER"
-    "CHARACTERS"
-    "CLOCK-UNITS"
-    "COBOL"
-    "CODE"
-    "CODE-SET"
-    "COLLATING"
-    "COLUMN"
-    "COMMA"
-    "COMMUNICATION"
-    "COMP"
-    "COMPUTATIONAL"
-    "CONFIGURATION"
-    "CONTAINS"
-    "CONTROL"
-    "CONTROLS"
-    "CORR"
-    "CORRESPONDING"
-    "COUNT"
-    "CURRENCY"
-    "DATA"
-    "DATE"
-    "DATE-COMPILED"
-    "DATE-WRITTEN"
-    "DAY"
-    "DE"
-    "DEBUG-CONTENTS"
-    "DEBUG-ITEM"
-    "DEBUG-LINE"
-    "DEBUG-NAME"
-    "DEBUG-SUB-1"
-    "DEBUG-SUB-2"
-    "DEBUG-SUB-3"
-    "DEBUGGING"
-    "DECIMAL-POINT"
-    "DECLARATIVES"
-    "ENVIRONMENT"
-    "DELIMITED"
-    "DELIMITER"
-    "DEPENDING"
-    "DESCENDING"
-    "DESTINATION"
-    "DETAIL"
-    "DIVISION"
-    "DOWN"
-    "DUPLICATES"
-    "DYNAMIC"
-    "EGI"
-    "ELSE"
-    "EMI"
-    "END"
-    "END-OF-PAGE"
-    "EOP"
-    "EQUAL"
-    "ERROR"
-    "ESI"
-    "EVERY"
-    "EXCEPTION"
-    "EXTEND"
-    "FD"
-    "FILE"
-    "FILE-CONTROL"
-    "FILLER"
-    "FINAL"
-    "FIRST"
-    "FOOTING"
-    "FOR"
-    "FROM"
-    "GIVING"
-    "GREATER"
-    "GROUP"
-    "HEADING"
-    "I-O"
-    "I-O-CONTROL"
-    "IDENTIFICATION"
-    "INDEX"
-    "INDEXED"
-    "IN"
-    "INDICATE"
-    "INITIAL"
-    "INPUT"
-    "INPUT-OUTPUT"
-    "INSTALLATION"
-    "INTO"
-    "INVALID"
-    "IS"
-    "JUST"
-    "JUSTIFIED"
-    "KEY"
-    "LABEL"
-    "LAST"
-    "LEADING"
-    "LEFT"
-    ; LENGTH is treated as an intrinsic function.
-    "LESS"
-    "LIMIT"
-    "LIMITS"
-    "LINAGE"
-    "LINAGE-COUNTER"
-    "LINE"
-    "LINE-COUNTER"
-    "LINES"
-    "LINKAGE"
-    "LOCK"
-    "NEXT"
-    "MEMORY"
-    "MESSAGE"
-    "MODE"
-    "MODULES"
-    "MULTIPLE"
-    "NATIVE"
-    "NEGATIVE"
-    "NO"
-    "NOT"
-    "NUMBER"
-    "NUMERIC"
-    "OBJECT-COMPUTER"
-    "OCCURS"
-    "OF"
-    "OFF"
-    "OMITTED"
-    ;; "ON" ; OS/VS Statement ; Keyword <= COBOL-74
-    "OPTIONAL"
-    "OR"
-    "ORGANIZATION"
-    "OUTPUT"
-    "OVERFLOW"
-    "PAGE"
-    "PAGE-COUNTER"
-    "PF"
-    "PH"
-    "PIC"
-    "PICTURE"
-    "PLUS"
-    "POINTER"
-    "POSITION"
-    "POSITIVE"
-    "PRINTING"
-    "PROCEDURE"
-    "PROCEDURES"
-    "PROCEED"
-    "PROGRAM"
-    "PROGRAM-ID"
-    "QUEUE"
-    "RANDOM"
-    "RD"
-    "RECORD"
-    "RECORDS"
-    "REDEFINES"
-    "REEL"
-    "REFERENCES"
-    "RELATIVE"
-    "REMAINDER"
-    "REMOVAL"
-    "RENAMES"
-    "REPLACING"
-    "REPORT"
-    "REPORTING"
-    "REPORT"
-    "RERUN"
-    "RESERVE"
-    "REVERSED"
-    "REWIND"
-    "RF"
-    "RH"
-    "RIGHT"
-    "ROUNDED"
-    "RUN"
-    "SAME"
-    "SD"
-    "SECTION"
-    "SECURITY"
-    "SEGMENT"
-    "SEGMENT-LIMIT"
-    "SEND"
-    "SENTENCE"
-    "SEPARATE"
-    "SEQUENCE"
-    "SEQUENTIAL"
-    "SIZE"
-    "SORT-MERGE"
-    "SOURCE"
-    "SOURCE-COMPUTER"
-    "SPECIAL-NAMES"
-    "STANDARD"
-    "STANDARD-1"
-    "STATUS"
-    "SUB-QUEUE-1"
-    "SUB-QUEUE-2"
-    "SUB-QUEUE-3"
-    "SYMBOLIC"
-    "SYNCHRONIZED"
-    "TABLE"
-    "TALLYING"
-    "TAPE"
-    "TERMINAL"
-    "TEXT"
-    "THAN"
-    "THROUGH"
-    "THRU"
-    "TIME"
-    "TIMES"
-    "TO"
-    "TOP"
-    "TRAILING"
-    "TYPE"
-    "UNIT"
-    "UNTIL"
-    "UP"
-    "UPON"
-    "USAGE"
-    "USING"
-    "VALUE"
-    "VALUES"
-    "VARYING"
-    "WHEN"
-    "WITH"
-    "WORDS"
-    "WORKING-STORAGE"))
-
-(defconst cobol-keywords-85
-  (append cobol-keywords-74
-          '("ALPHABET"
-            "ALPHABETIC-LOWER"
-            "ALPHABETIC-UPPER"
-            "ALPHANUMERIC"
-            "ALPHANUMERIC-EDITED"
-            "ANY"
-            "BINARY"
-            "CLASS"
-            "COMMON"
-            "CONTENT"
-            "CONVERTING"
-            "DAY-OF-WEEK"
-            "EXTERNAL"
-            "FALSE"
-            "FUNCTION"
-            "GLOBAL"
-            "NUMERIC-EDITED"
-            "ORDER"
-            "OTHER"
-            "PACKED-DECIMAL"
-            "PADDING"
-            "PURGE"
-            "REFERENCE"
-            "STANDARD-2"
-            "TEST"
-            "THEN"
-            "TRUE")))
-
-(defconst cobol-removed-keywords-2002
-  '("AUTHOR"
-    "INSTALLATION"
-    "DATE-WRITTEN"
-    "DATE-COMPILED"
-    "SECURITY"
-    "MEMORY"
-    "RERUN"
-    "MULTIPLE"
-    "TAPE"
-    "LABEL"
-    "REVERSED"
-    "DEBUG-CONTENTS"
-    "DEBUG-ITEM"
-    "DEBUG-LINE"
-    "DEBUG-NAME"
-    "DEBUG-SUB-1"
-    "DEBUG-SUB-2"
-    "DEBUG-SUB-3"))
-
-(defconst cobol-keywords-2002
-  (append (cobol--remove-strings cobol-keywords-85
-                                 cobol-removed-keywords-2002)
-          '("ACTIVE-CLASS"
-            "ADDRESS"
-            "ALIGNED"
-            "ANYCASE"
-            "AS"
-            "B-AND"
-            "B-NOT"
-            "B-OR"
-            "B-XOR"
-            "BASED"
-            "BINARY-CHAR"
-            "BINARY-DOUBLE"
-            "BINARY-LONG"
-            "BINARY-SHORT"
-            "BIT"
-            "BOOLEAN"
-            "CLASS-ID"
-            "COL"
-            "COLS"
-            "COLUMNS"
-            "CONDITION"
-            "CONSTANT"
-            "CRT"
-            "CURSOR"
-            "DATA-POINTER"
-            "DEFAULT"
-            "EC"
-            "EO"
-            "EXCEPTION-OBJECT"
-            "FACTORY"
-            "FLOAT-EXTENDED"
-            "FLOAT-LONG"
-            "FLOAT-SHORT"
-            "FORMAT"
-            "FUNCTION-ID"
-            "GET"
-            "GROUP-USAGE"
-            "INHERITS"
-            "INTERFACE"
-            "INTERFACE-ID"
-            "LAST"
-            "LOCAL-STORAGE"
-            "LOCALE"
-            "METHOD"
-            "METHOD-ID"
-            "MINUS"
-            "NATIONAL"
-            "NATIONAL-EDITED"
-            "NESTED"
-            "OBJECT"
-            "OBJECT-REFERENCE"
-            "OPTIONS"
-            "OVERRIDE"
-            "PRESENT"
-            "PROGRAM-POINTER"
-            "PROPERTY"
-            "PROTOTYPE"
-            "RAISING"
-            "REPOSITORY"
-            "RETRY"
-            "RETURNING"
-            "SCREEN"
-            "SHARING"
-            "SOURCES"
-            "SYSTEM-DEFAULT"
-            "TYPEDEF"
-            "UNIVERSAL"
-            "USER-DEFAULT"
-            "VAL-STATUS"
-            "VALID"
-            "VALIDATE-STATUS")))
-
-(defconst cobol-keywords-finalizer-tr
-  '("AUTO-METHOD"))
-
-(defconst cobol-keywords-xml-tr
-  '("DOCUMENT"
-    "IDENTIFIED"
-    "VERSION-XML"))
-
-(defconst cobol-removed-keywords-2014
-  '("CD"
-    "DEBUGGING"
-    "EGI"
-    "EMI"
-    "ESI"
-    "MESSAGE"
-    "PADDING"
-    "PURGE"
-    "QUEUE"
-    "SEGMENT"
-    "SUB-QUEUE-1"
-    "SUB-QUEUE-2"
-    "SUB-QUEUE-3"
-    "TERMINAL"
-    "TEXT"))
-
-(defconst cobol-keywords-2014
-  (append (cobol--remove-strings cobol-keywords-2002
-                                 cobol-removed-keywords-2014)
-          '("FARTHEST-FROM-ZERO"
-            "FLOAT-BINARY-32"
-            "FLOAT-BINARY-64"
-            "FLOAT-BINARY-128"
-            "FLOAT-DECIMAL-16"
-            "FLOAT-DECIMAL-34"
-            "FLOAT-INFINITY"
-            "FLOAT-NOT-A-NUMBER"
-            "FLOAT-NOT-A-NUMBER-QUIET"
-            "FLOAT-NOT-A-NUMBER-SIGNALING"
-            "FUNCTION-POINTER"
-            "IN-ARITHMETIC-RANGE"
-            "NEAREST-TO-ZERO")))
-
-(defconst cobol-keywords-extensions
-  '("3-D"
-    "ABSENT"
-    "ABSTRACT"
-    "ACQUIRE"
-    "ACTION"
-    "ACTIVE-X"
-    "ACTUAL"
-    "ACCEPT-CLOSE"
-    "ACCEPT-OPEN"
-    "ADDRESS-ARRAY"
-    "ADDRESS-OFFSET"
-    "ADJUSTABLE-COLUMNS"
-    "AFP-5A"
-    "ALIGNMENT"
-    "ALLOWING"
-    "ANY LENGTH"
-    "APPLY"
-    "ARGUMENT-NUMBER"
-    "ARGUMENT-VALUE"
-    "ASSEMBLY-ATTRIBUTES"
-    "ASSOCIATED-DATA" ; Unisys
-    "ASSOCIATED-DATA-LENGTH" ; Unisys
-    "AUTO-DECIMAL"
-    "AUTO-HYPHEN-SKIP"
-    "AUTO-MINIMIZE"
-    "AUTO-RESIZE"
-    "AUTO-SKIP"
-    "AUTO-SPIN"
-    "AUTOTERMINATE"
-    "AX-EVENT-LIST"
-    "B-EXOR"
-    "B-LEFT"
-    "B-RIGHT"
-    "BACKGROUND-COLOUR"
-    "BACKGROUND-HIGH"
-    "BACKGROUND-LOW"
-    "BACKGROUND-STANDARD"
-    "BACKWARD"
-    "BAR"
-    "BASIS"
-    "BEEP"
-    "BEGINNING"
-    "BINARY-INT"
-    "BINARY-LONG-LONG"
-    "BIND"
-    "BITMAP"
-    "BITMAP-END"
-    "BITMAP-HANDLE"
-    "BITMAP-NUMBER"
-    "BITMAP-RAW-HEIGHT"
-    "BITMAP-RAW-WIDTH"
-    "BITMAP-SCALE"
-    "BITMAP-START"
-    "BITMAP-TIMER"
-    "BITMAP-TRAILING"
-    "BITMAP-WIDTH"
-    "BLINKING"
-    "BLOB"
-    "BLOB-FILE"
-    "BLOB-LOCATOR"
-    "BOLD"
-    "BOX"
-    "BOXED"
-    "BROWSING"
-    "BULK-ADDITION"
-    "BUSY"
-    "BUTTONS"
-    "C01"
-    "C02"
-    "C03"
-    "C04"
-    "C05"
-    "C06"
-    "C07"
-    "C08"
-    "C09"
-    "C10"
-    "C11"
-    "C12"
-    "CALENDAR-FONT"
-    "CALLED"
-    "CANCEL-BUTTON"
-    "CATCH"
-    "CBL"
-    "CBL-CTR"
-    "CCOL"
-    "CELL"
-    "CELL-COLOR"
-    "CELL-DATA"
-    "CELL-FONT"
-    "CELL-PROTECTION"
-    "CELLS"
-    "CENTERED"
-    "CENTERED-HEADINGS"
-    "CENTURY-DATE"
-    "CENTURY-DAY"
-    "CHAINING"
-    "CHANGED"
-    "CHAR-VARYING"
-    "CHART"
-    "CHECK-BOX"
-    "CHECKING"
-    "CLASS-ATTRIBUTES"
-    "CLASS-CONTROL"
-    "CLASS-OBJECT"
-    "CLEAR-SELECTION"
-    "CLINE"
-    "CLINES"
-    "CLOB"
-    "CLOB-FILE"
-    "CLOB-LOCATOR"
-    "CLOSE-DISPOSITION" ; Unisys
-    "CMP" ; Unisys
-    "COERCION"
-    "COLORS"
-    "COLOUR"
-    "COLOURS"
-    "COLUMN-COLOR"
-    "COLUMN-DIVIDERS"
-    "COLUMN-FONT"
-    "COLUMN-HEADINGS"
-    "COLUMN-PROTECTION"
-    "COM-REG"
-    "COMBO-BOX"
-    "COMMAND-LINE"
-    "COMMITMENT"
-    "COMP-0"
-    "COMP-1"
-    "COMP-2"
-    "COMP-3"
-    "COMP-4"
-    "COMP-5"
-    "COMP-6"
-    "COMP-N"
-    "COMP-X"
-    "COMPRESSION"
-    "COMPUTATIONAL-0"
-    "COMPUTATIONAL-1"
-    "COMPUTATIONAL-2"
-    "COMPUTATIONAL-3"
-    "COMPUTATIONAL-4"
-    "COMPUTATIONAL-5"
-    "COMPUTATIONAL-6"
-    "COMPUTATIONAL-N"
-    "COMPUTATIONAL-X"
-    "CONDITION-VALUE"
-    "CONNECT-TIME-LIMIT" ; Unisys
-    "CONSOLE"
-    "CONSTRAIN"
-    "CONSTRAINTS"
-    "CONTROL-AREA"
-    "CONTROL-POINT" ; Unisys
-    "CONTROLS-UNCROPPED"
-    "CONVENTION"
-    "CONVERSION"
-    "CONVERT"
-    "COPY-SELECTION"
-    "CORE-INDEX"
-    "CP" ; Unisys
-    "CREATING"
-    "CRT-UNDER"
-    "CRUNCH" ; Unisys
-    "CSIZE"
-    "CSP"
-    "CURSOR-COL"
-    "CURSOR-COLOR"
-    "CURSOR-FRAME-WIDTH"
-    "CURSOR-ROW"
-    "CURSOR-X"
-    "CURSOR-Y"
-    "CUSTOM-ATTRIBUTE"
-    "CUSTOM-PRINT-TEMPLATE"
-    "CYL-INDEX"
-    "CYL-OVERFLOW"
-    "DASHED"
-    "DATA-COLUMNS"
-    "DATA-TYPES"
-    "DATABASE-KEY"
-    "DATABASE-KEY-LONG"
-    "DATE-ENTRY"
-    "DATE-RECORD"
-    "DBCLOB"
-    "DBCLOB-FILE"
-    "DBCLOB-LOCATOR"
-    "DBCS"
-    "DEBUG"
-    "DECIMAL"
-    "DEFAULT-BUTTON"
-    "DEFAULT-FONT"
-    "DEFINITION"
-    "DELEGATE-ID"
-    "DESTROY"
-    "DICTIONARY"
-    "DISC"
-    "DISJOINING"
-    "DISK"
-    "DISP"
-    "DISPLAY-1"
-    "DISPLAY-COLUMNS"
-    "DISPLAY-FORMAT"
-    "DISPLAY-ST"
-    "DIVIDER-COLOR"
-    "DIVIDERS"
-    "DONT-PARTICIPATE" ; Unisys
-    "DOT-DASH"
-    "DOTTED"
-    "DOUBLE"
-    "DRAG-COLOR"
-    "DRAW"
-    "DROP"
-    "DROP-DOWN"
-    "DROP-LIST"
-    "EBCDIC"
-    "ECHO"
-    "EGCS"
-    "EJECT"
-    "ELEMENTARY"
-    "EMPTY-CHECK"
-    "ENABLED"
-    "ENCRYPTION"
-    "ENDING"
-    "ENGRAVED"
-    "ENSURE-VISIBLE"
-    "ENTRY-FIELD"
-    "ENTRY-REASON"
-    "ENUM"
-    "ENUM-ID"
-    "ENVIRONMENT-NAME"
-    "ENVIRONMENT-VALUE"
-    "EQUALS"
-    "ESCAPE"
-    "ESCAPE-BUTTON"
-    "EVENT"
-    "EVENT-LIST"
-    "EVENT-POINTER"
-    "EXCEEDS"
-    "EXCEPTION-VALUE"
-    "EXCESS-3"
-    "EXCLUDE-EVENT-LIST"
-    "EXCLUSIVE"
-    "EXPAND"
-    "EXTENDED"
-    "EXTENDED-SEARCH"
-    "EXTENSION"
-    "EXTERNAL-FORM"
-    "EXTERNALLY-DESCRIBED-KEY"
-    "FH--FCD"
-    "FH--KEYDEF"
-    "FILE-ID"
-    "FILE-LIMIT"
-    "FILE-LIMITS"
-    "FILE-NAME"
-    "FILE-POS"
-    "FILL-COLOR"
-    "FILL-COLOR2"
-    "FILL-PERCENT"
-    "FINALLY"
-    "FINISH-REASON"
-    "FIXED"
-    "FIXED-FONT"
-    "FIXED-WIDTH"
-    "FLAT"
-    "FLAT-BUTTONS"
-    "FLOAT"
-    "FLOATING"
-    "FONT"
-    "FOREGROUND-COLOUR"
-    "FRAME"
-    "FRAMED"
-    "FULL-HEIGHT"
-    "GETTER"
-    "GO-BACK"
-    "GO-FORWARD"
-    "GO-HOME"
-    "GO-SEARCH"
-    "GRAPHICAL"
-    "GRID"
-    "GRIP"
-    "GROUP-VALUE"
-    "HANDLE"
-    "HAS-CHILDREN"
-    "HEADING-COLOR"
-    "HEADING-DIVIDER-COLOR"
-    "HEADING-FONT"
-    "HEAVY"
-    "HEIGHT"
-    "HEIGHT-IN-CELLS"
-    "HELP-ID"
-    "HIDDEN-DATA"
-    "HIGH"
-    "HIGH-COLOR"
-    "HORIZONTAL"
-    "HOT-TRACK"
-    "HSCROLL"
-    "HSCROLL-POS"
-    "ICON"
-    "ID"
-    "IGNORE"
-    "INDEPENDENT"
-    "INDEXED"
-    "INDEXER"
-    "INDEXER-ID"
-    "INDIC"
-    "INDICATOR"
-    "INDICATORS"
-    "INDIRECT"
-    "INHERITING"
-    "INQUIRE"
-    "INTERRUPT"
-    "INSERT"
-    "INSERT-ROWS"
-    "INSERTION-INDEX"
-    "INSTANCE"
-    "INTERNAL"
-    "INVOKED"
-    "ITEM"
-    "ITEM-BOLD"
-    "ITEM-ID"
-    "ITEM-TEXT"
-    "ITEM-TO-ADD"
-    "ITEM-TO-DELETE"
-    "ITEM-TO-EMPTY"
-    "ITEM-VALUE"
-    "ITERATOR"
-    "ITERATOR-ID"
-    "JOINED"
-    "JOINING"
-    "KANJI"
-    "KEPT"
-    "KEY-YY"
-    "KEYBOARD"
-    "LABEL-OFFSET"
-    "LARGE-FONT"
-    "LAST-ROW"
-    "LAYOUT-DATA"
-    "LAYOUT-MANAGER"
-    "LEADING-SHIFT"
-    "LEAVE"
-    "LEFT-JUSTIFY"
-    "LEFT-TEXT"
-    "LEFTLINE"
-    "LENGTH-CHECK"
-    "LENGTH OF"
-    "LIN"
-    "LINES-AT-ROOT"
-    "LINK"
-    "LIST"
-    "LIST-BOX"
-    "LM-RESIZE"
-    "LANGUAGE"
-    "LOCAL" ; Unisys
-    "LOCKING"
-    "LONG-DATE"
-    "LONG-VARBINARY"
-    "LONG-VARCHAR"
-    "LOW"
-    "LOW-COLOR"
-    "LOWER"
-    "LOWER-BOUND" ; Unisys
-    "LOWER-BOUNDS" ; Unisys
-    "LOWERED"
-    "MASS-UPDATE"
-    "MASTER-INDEX"
-    "MAX-HEIGHT"
-    "MAX-LINES"
-    "MAX-PROGRESS"
-    "MAX-SIZE"
-    "MAX-TEXT"
-    "MAX-VAL"
-    "MAX-WIDTH"
-    "MDI-CHILD"
-    "MDI-FRAME"
-    "MEDIUM-FONT"
-    "MENU"
-    "MESSAGES"
-    "METACLASS"
-    "MIN-HEIGHT"
-    "MIN-LINES"
-    "MIN-SIZE"
-    "MIN-VAL"
-    "MIN-WIDTH"
-    "MMDDYYYY" ; Unisys
-    "MODAL"
-    "MODELESS"
-    "MODIFIED"
-    "MONITOR-POINTER"
-    "MORE-DATA" ; Unisys
-    "MORE-LABELS"
-    "MULTILINE"
-    "MUTEX-POINTER"
-    "MYJOB" ; Unisys
-    "MYSELF" ; Unisys
-    "NAME"
-    "NAMED"
-    "NAVIGATE-URL"
-    "NCHAR"
-    "NET-EVENT-LIST"
-    "NEW"
-    "NEWABLE"
-    "NEXT-ITEM"
-    "NO-AUTO-DEFAULT"
-    "NO-AUTOSEL"
-    "NO-BOX"
-    "NO-CELL-DRAG"
-    "NO-CLOSE"
-    "NO-DIVIDERS"
-    "NO-ECHO"
-    "NO-F4"
-    "NO-FOCUS"
-    "NO-GROUP-TAB"
-    "NO-KEY-LETTER"
-    "NO-SEARCH"
-    "NO-TAB"
-    "NO-UPDOWN"
-    "NOMINAL"
-    "NOTIFY"
-    "NOTIFY-CHANGE"
-    "NOTIFY-DBLCLICK"
-    "NOTIFY-SELCHANGE"
-    "NSTD-REELS"
-    "NUM-COL-HEADINGS"
-    "NUM-ROW-HEADINGS"
-    "NUM-ROWS"
-    "NUMERIC-DATE" ; Unisys
-    "NUMERIC-FILL"
-    "NUMERIC-TIME" ; Unisys
-    "O-FILL"
-    "OBJECT-ID"
-    "OBJECT-STORAGE"
-    "OC" ; Unisys
-    "ODT-INPUT-PRESENT" ; Unisys
-    "OK-BUTTON"
-    "OOSTACKPTR"
-    "OPERATOR"
-    "OPERATOR-ID"
-    "OTHERWISE"
-    "OVERLAP-LEFT"
-    "OVERLAP-TOP"
-    "OVERLAPPED"
-    "OVERLINE"
-    "OWN" ; Unisys
-    "PAGE-SETUP"
-    "PAGE-SIZE"
-    "PAGED"
-    "PANEL-INDEX"
-    "PANEL-STYLE"
-    "PANEL-TEXT"
-    "PANEL-WIDTHS"
-    "PARAMS"
-    "PARENT"
-    "PARSE"
-    "PARTIAL"
-    "PARTICIPATE" ; Unisys
-    "PASSWORD"
-    "PC" ; Unisys
-    "PERMANENT"
-    "PIXEL"
-    "PIXELS"
-    "PLACEMENT"
-    "POP-UP"
-    "POSITION-SHIFT"
-    "POSITIONING"
-    "PREFIXING"
-    "PRINT"
-    "PRINT-CONTROL"
-    "PRINT-NO-PROMPT"
-    "PRINT-PREVIEW"
-    "PRINT-SWITCH"
-    "PRINTER"
-    "PRINTER-1"
-    "PRIOR"
-    "PRIORITY"
-    "PRIVATE"
-    "PROCEDURE-POINTER"
-    "PROCESSING"
-    "PROGRESS"
-    "PROMPT"
-    "PROPERTIES"
-    "PROPERTY-ID"
-    "PROPERTY-VALUE"
-    "PROTECTED"
-    "PUBLIC"
-    "PUSH-BUTTON"
-    "QUERY-INDEX"
-    "RADIO-BUTTON"
-    "RAISED"
-    "READ-OK" ; Unisys
-    "READ-ONLY"
-    "READING"
-    "READY"
-    "REAL" ; Unisys
-    "RECORD-DATA"
-    "RECORD-OVERFLOW"
-    "RECORD-TO-ADD"
-    "RECORD-TO-DELETE"
-    "RECORDING"
-    "REDEFINE"
-    "REDEFINITION"
-    "REF" ; Unisys
-    "REFRESH"
-    "REGION-COLOR"
-    "REJECT-OPEN"
-    "RELOAD"
-    "REMARKS"
-    "REORG-CRITERIA"
-    "REPEATED"
-    "REREAD"
-    "RESET"
-    "RESET-GRID"
-    "RESET-LIST"
-    "RESET-TABS"
-    "RESIDENT"
-    "RESIZABLE"
-    "RESTRICTED"
-    "RESULT-SET-LOCATOR"
-    "RETURN-CODE"
-    "RIGHT-ALIGN"
-    "RIGHT-JUSTIFY"
-    "RIMMED"
-    "ROLLING"
-    "ROW-COLOR"
-    "ROW-COLOR-PATTERN"
-    "ROW-DIVIDERS"
-    "ROW-FONT"
-    "ROW-HEADINGS"
-    "ROW-PROTECTION"
-    "ROWID"
-    "S01"
-    "S02"
-    "S03"
-    "S04"
-    "S05"
-    "SAVE-AS"
-    "SAVE-AS-NO-PROMPT"
-    "SCROLL"
-    "SCROLL-BAR"
-    "SEARCH-OPTIONS"
-    "SEARCH-TEXT"
-    "SELECT-ALL"
-    "SELECTION-INDEX"
-    "SELECTION-TEXT"
-    "SELECTIVE"
-    "SELF-ACT"
-    "SELFCLASS"
-    "SEMAPHORE-POINTER"
-    "SEPARATION"
-    "SETTER"
-    "SHADING"
-    "SHADOW"
-    "SHIFT-IN"
-    "SHIFT-OUT"
-    "SHORT-DATE"
-    "SHOW-LINES"
-    "SHOW-NONE"
-    "SHOW-SEL-ALWAYS"
-    ;; SIGN is treated as an intrinsic function.
-    "SIGNED-INT"
-    "SIGNED-LONG"
-    "SIGNED-SHORT"
-    "SKIP1"
-    "SKIP2"
-    "SKIP3"
-    "SMALL-FONT"
-    "SORT-CONTROL"
-    "SORT-CORE-SIZE"
-    "SORT-FILE-SIZE"
-    "SORT-MESSAGE"
-    "SORT-MODE-SIZE"
-    "SORT-OPTION"
-    "SORT-ORDER"
-    "SORT-RETURN"
-    "SORT-TAPE"
-    "SORT-TAPES"
-    "SPACE-FILL"
-    "SPINNER"
-    "SQL"
-    "SQUARE"
-    "STANDARD-3"
-    "START-X"
-    "START-Y"
-    "STARTING"
-    "STATIC"
-    "STATIC-LIST"
-    "STATIONLIST"
-    "STATUS-BAR"
-    "STATUS-TEXT"
-    "STDCALL"
-    "STOP-BROWSER"
-    "STYLE"
-    "SUBFILE"
-    "SUBWINDOW"
-    "SUFFIXING"
-    ;; SUM is an intrinsic function.
-    "SW0"
-    "SW1"
-    "SW2"
-    "SW3"
-    "SW4"
-    "SW5"
-    "SW6"
-    "SW7"
-    "SW8"
-    "SW9"
-    "SW10"
-    "SW11"
-    "SW12"
-    "SW13"
-    "SW14"
-    "SW15"
-    "SWITCH-0"
-    "SWITCH-1"
-    "SWITCH-2"
-    "SWITCH-3"
-    "SWITCH-4"
-    "SWITCH-5"
-    "SWITCH-6"
-    "SWITCH-7"
-    "SWITCH-8"
-    "SWITCH-9"
-    "SWITCH-10"
-    "SWITCH-11"
-    "SWITCH-12"
-    "SWITCH-13"
-    "SWITCH-14"
-    "SWITCH-15"
-    "SYSIN"
-    "SYSIPT"
-    "SYSLST"
-    "SYSOUT"
-    "SYSPCH"
-    "SYSPUNCH"
-    "SYSTEM"
-    "SYSTEM-INFO"
-    "TAB"
-    "TAB-CONTROL"
-    "TAB-TO-ADD"
-    "TAB-TO-DELETE"
-    "TAG-KEY" ; Unisys
-    "TAG-SEARCH" ; Unisys
-    "TALLY"
-    "TAPES"
-    "TASK"
-    "TEMPORARY"
-    "TERMINAL-INFO"
-    "TERMINATION-VALUE"
-    "THREAD"
-    "THREAD-LOCAL"
-    "THREAD-LOCAL-STORAGE"
-    "THREAD-POINTER"
-    "THUMB-POSITION"
-    "TILED-HEADINGS"
-    "TIME-OF-DAY"
-    "TIME-OUT"
-    "TIME-RECORD"
-    "TIMEOUT"
-    "TIMER" ; Unisys
-    "TIMESTAMP"
-    "TIMESTAMP-OFFSET"
-    "TIMESTAMP-OFFSET-RECORD"
-    "TIMESTAMP-RECORD"
-    "TITLE"
-    "TITLE-BAR"
-    "TITLE-POSITION"
-    "TODAYS-DATE"
-    "TODAYS-NAME"
-    "TOOL-BAR"
-    "TOTALED"
-    "TOTALING"
-    "TRACE"
-    "TRACK-AREA"
-    "TRACK-LIMIT"
-    "TRACK-THUMB"
-    "TRACKS"
-    "TRADITIONAL-FONT"
-    "TRAILING-SHIFT"
-    "TRAILING-SIGN"
-    "TRANSACTION"
-    "TRANSPARENT"
-    "TRANSPARENT-COLOR"
-    "TREE-VIEW"
-    "UNDERLINED"
-    "UNEQUAL"
-    "UNFRAMED"
-    "UNITS"
-    "UNSIGNED-INT"
-    "UNSIGNED-LONG"
-    "UNSIGNED-SHORT"
-    "UNSORTED"
-    "UPDATE"
-    "UPPER"
-    "UPSI-0"
-    "UPSI-1"
-    "UPSI-2"
-    "UPSI-3"
-    "UPSI-4"
-    "UPSI-5"
-    "UPSI-6"
-    "UPSI-7"
-    "URGENT"
-    "USE-ALT"
-    "USE-RETURN"
-    "USE-TAB"
-    "USER"
-    "USER-COLORS"
-    "USER-GRAY"
-    "USER-WHITE"
-    "VA" ; Unisys
-    "VALUE-FORMAT"
-    "VALUETYPE"
-    "VALUETYPE-ID"
-    "VARBINARY"
-    "VARIABLE"
-    "VARIANT"
-    "VERTICAL"
-    "VERY-HEAVY"
-    "VIRTUAL-WIDTH"
-    "VISIBLE"
-    "VPADDING"
-    "VSCROLL"
-    "VSCROLL-BAR"
-    "VSCROLL-POS"
-    "VTOP"
-    "WEB-BROWSER"
-    "WHERE"
-    "WIDTH"
-    "WIDTH-IN-CELLS"
-    "WINDOW"
-    "WRAP"
-    "WRITE-ONLY"
-    "WRITE-VERIFY"
-    "WRITING"
-    "XML"
-    "XML-CODE"
-    "XML-EVENT"
-    "XML-NTEXT"
-    "XML-TEXT"
-    "YIELDING"
-    "ZERO-FILL"))
-
-(defvar cobol-keywords
-  (append cobol-keywords-2014
-          cobol-removed-keywords-2002
-          cobol-removed-keywords-2014
-          cobol-keywords-finalizer-tr
-          cobol-keywords-xml-tr
-          cobol-keywords-extensions
-          cobol-scope-terminators
-          cobol-removed-scope-terminators-2014)
-  "List of COBOL keywords.")
-
-(defconst cobol-context-sensitive-keywords-2002
-  '("ARITHMETIC"
-    "ATTRIBUTE"
-    "AUTO"
-    "AUTOMATIC"
-    "BACKGROUND-COLOR"
-    "BELL"
-    "BLINK"
-    "BYTE-LENGTH"
-    "CENTER"
-    "CLASSIFICATION"
-    "CYCLE"
-    "EC-ALL"
-    "EC-ARGUMENT"
-    "EC-ARGUMENT-FUNCTION"
-    "EC-ARGUMENT-IMP"
-    "EC-BOUND"
-    "EC-BOUND-IMP"
-    "EC-BOUND-ODO"
-    "EC-BOUND-OVERFLOW"
-    "EC-BOUND-PTR"
-    "EC-BOUND-REF-MOD"
-    "EC-BOUND-SET"
-    "EC-BOUND-SUBSCRIPT"
-    "EC-BOUND-TABLE-LIMIT"
-    "EC-DATA"
-    "EC-DATA-CONVERSION"
-    "EC-DATA-IMP"
-    "EC-DATA-INCOMPATIBLE"
-    "EC-DATA-INTEGRITY"
-    "EC-DATA-PTR-NULL"
-    "EC-FLOW"
-    "EC-FLOW-GLOBAL-EXIT"
-    "EC-FLOW-GLOBAL-GOBACK"
-    "EC-FLOW-IMP"
-    "EC-FLOW-RELEASE"
-    "EC-FLOW-REPORT"
-    "EC-FLOW-RETURN"
-    "EC-FLOW-SEARCH"
-    "EC-FLOW-USE"
-    "EC-FUNCTION"
-    "EC-FUNCTION-PTR-INVALID"
-    "EC-FUNCTION-PTR-NULL"
-    "EC-I-O"
-    "EC-I-O-AT-END"
-    "EC-I-O-EOP"
-    "EC-I-O-EOP-OVERFLOW"
-    "EC-I-O-FILE-SHARING"
-    "EC-I-O-IMP"
-    "EC-I-O-INVALID-KEY"
-    "EC-I-O-LINAGE"
-    "EC-I-O-LOGIC-ERROR"
-    "EC-I-O-PERMANENT-ERROR"
-    "EC-I-O-RECORD-OPERATION"
-    "EC-IMP"
-    ;; EC-IMP-suffix is matched separately by
-    ;; cobol-implementor-user-exception-re.
-    "EC-LOCALE"
-    "EC-LOCALE-IMP"
-    "EC-LOCALE-INCOMPATIBLE"
-    "EC-LOCALE-INVALID"
-    "EC-LOCALE-INVALID-PTR"
-    "EC-LOCALE-MISSING"
-    "EC-LOCALE-SIZE"
-    "EC-OO"
-    "EC-OO-CONFORMANCE"
-    "EC-OO-EXCEPTION"
-    "EC-OO-IMP"
-    "EC-OO-METHOD"
-    "EC-OO-NULL"
-    "EC-OO-RESOURCE"
-    "EC-OO-UNIVERSAL"
-    "EC-ORDER"
-    "EC-ORDER-IMP"
-    "EC-ORDER-NOT-SUPPORTED"
-    "EC-OVERFLOW"
-    "EC-OVERFLOW-IMP"
-    "EC-OVERFLOW-STRING"
-    "EC-OVERFLOW-UNSTRING"
-    "EC-PROGRAM"
-    "EC-PROGRAM-ARG-MISMATCH"
-    "EC-PROGRAM-ARG-OMITTED"
-    "EC-PROGRAM-CANCEL-ACTIVE"
-    "EC-PROGRAM-IMP"
-    "EC-PROGRAM-NOT-FOUND"
-    "EC-PROGRAM-PTR-NULL"
-    "EC-PROGRAM-RECURSIVE-CALL"
-    "EC-PROGRAM-RESOURCES"
-    "EC-RAISING"
-    "EC-RAISING-IMP"
-    "EC-RAISING-NOT-SPECIFIED"
-    "EC-RANGE"
-    "EC-RANGE-IMP"
-    "EC-RANGE-INDEX"
-    "EC-RANGE-INSPECT-SIZE"
-    "EC-RANGE-INVALID"
-    "EC-RANGE-PERFORM-VARYING"
-    "EC-RANGE-PTR"
-    "EC-RANGE-SEARCH-INDEX"
-    "EC-RANGE-SEARCH-NO-MATCH"
-    "EC-REPORT"
-    "EC-REPORT-ACTIVE"
-    "EC-REPORT-COLUMN-OVERLAP"
-    "EC-REPORT-FILE-MODE"
-    "EC-REPORT-IMP"
-    "EC-REPORT-INACTIVE"
-    "EC-REPORT-LINE-OVERLAP"
-    "EC-REPORT-NOT-TERMINATED"
-    "EC-REPORT-PAGE-LIMIT"
-    "EC-REPORT-PAGE-WIDTH"
-    "EC-REPORT-SUM-SIZE"
-    "EC-REPORT-VARYING"
-    "EC-SCREEN"
-    "EC-SCREEN-FIELD-OVERLAP"
-    "EC-SCREEN-IMP"
-    "EC-SCREEN-ITEM-TRUNCATED"
-    "EC-SCREEN-LINE-NUMBER"
-    "EC-SCREEN-STARTING-COLUMN"
-    "EC-SIZE"
-    "EC-SIZE-ADDRESS"
-    "EC-SIZE-EXPONENTIATION"
-    "EC-SIZE-IMP"
-    "EC-SIZE-OVERFLOW"
-    "EC-SIZE-TRUNCATION"
-    "EC-SIZE-UNDERFLOW"
-    "EC-SIZE-ZERO-DIVIDE"
-    "EC-SORT-MERGE"
-    "EC-SORT-MERGE-ACTIVE"
-    "EC-SORT-MERGE-FILE-OPEN"
-    "EC-SORT-MERGE-IMP"
-    "EC-SORT-MERGE-RELEASE"
-    "EC-SORT-MERGE-RETURN"
-    "EC-SORT-MERGE-SEQUENCE"
-    "EC-STORAGE"
-    "EC-STORAGE-IMP"
-    "EC-STORAGE-NOT-ALLOC"
-    "EC-STORAGE-NOT-AVAIL"
-    "EC-USER"
-    ;; EC-USER-suffix is matched separately by
-    ;; cobol-implementor-user-exception-re.
-    "EC-VALIDATE"
-    "EC-VALIDATE-CONTENT"
-    "EC-VALIDATE-FORMAT"
-    "EC-VALIDATE-IMP"
-    "EC-VALIDATE-RELATION"
-    "EC-VALIDATE-VARYING"
-    "EOL"
-    "EOS"
-    "ENTRY-CONVENTION"
-    "ERASE"
-    "EXPANDS"
-    "FOREGROUND-COLOR"
-    "FOREVER"
-    "FULL"
-    "HIGHLIGHT"
-    "IGNORING"
-    "IMPLEMENTS"
-    "INITIALIZED"
-    "INTRINSIC"
-    "LC_ALL"
-    "LC_COLLATE"
-    "LC_CTYPE"
-    "LC_MESSAGES"
-    "LC_MONETARY"
-    "LC_NUMERIC"
-    "LC_TIME"
-    "LOWLIGHT"
-    "MANUAL"
-    "MULTIPLE" ; <= COBOL-74
-    "NEGATIVE-INFINITY"
-    "NONE"
-    "NORMAL"
-    "NUMBERS"
-    "ONLY"
-    "PARAGRAPH"
-    "POSITIVE-INFINITY"
-    "PREVIOUS"
-    "RECURSIVE"
-    "RELATION"
-    "REQUIRED"
-    "REVERSE-VIDEO"
-    "SECONDS"
-    "SECURE"
-    "STATEMENT"
-    "STEP"
-    "STRONG"
-    "SYMBOL"
-    "UCS-4"
-    "UNDERLINE"
-    "UNSIGNED"
-    "UTF-8"
-    "UTF-16"
-    ;; XML is treated as a reserved word per IBM implementations.
-    "YYYYDDD"
-    "YYYYMMDD"))
-
-(defconst cobol-context-sensitive-keywords-finalizer-tr
-  '("EC-OO-FINALIZABLE"
-    "FINALIZER"))
-
-(defconst cobol-context-sensitive-keywords-xml-tr
-  '("CHECK"
-    "DISCARD"
-    "DOCUMENTATION"
-    "DTD"
-    "EC-DATA-INFINITY"
-    "EC-DATA-NEGATIVE-INFINITY"
-    "EC-DATA-NOT-A-NUMBER"
-    "EC-XML"
-    "EC-XML-CODESET"
-    "EC-XML-CODESET-CONVERSION"
-    "EC-XML-COUNT"
-    "EC-XML-DOCUMENT-TYPE"
-    "EC-XML-IMPLICIT-CLOSE"
-    "EC-XML-INVALID"
-    "EC-XML-NAMESPACE"
-    "EC-XML-STACKED-OPEN"
-    "EC-XML-RANGE"
-    "ELEMENT"
-    "NAMESPACE"
-    "RAW"
-    "SCHEMA"
-    "STACK"
-    "VALIDITY"))
-
-(defconst cobol-context-sensitive-keywords-2014
-  (append cobol-context-sensitive-keywords-2002
-          '("AWAY-FROM-ZERO"
-            "BINARY-ENCODING"
-            "CAPACITY"
-            "DECIMAL-ENCODING"
-            "EC-FUNCTION-ARG-OMITTED"
-            "EC-FUNCTION-NOT-FOUND"
-            "EC-OO-ARG-OMITTED"
-            "FLOAT-BINARY"
-            "FLOAT-DECIMAL"
-            "HIGH-ORDER-LEFT"
-            "HIGH-ORDER-RIGHT"
-            "INTERMEDIATE"
-            "NEAREST-AWAY-FROM-ZERO"
-            "NEAREST-EVEN-INTERMEDIATE"
-            "NEAREST-TOWARD-ZERO"
-            "PREFIXED"
-            "PROHIBITED"
-            "ROUNDING"
-            "SHORT"
-            "SIGNED"
-            "STANDARD-BINARY"
-            "STANDARD-DECIMAL"
-            "TOWARD-GREATER"
-            "TOWARD-LESSER"
-            "TRUNCATION")))
-
-(defconst cobol-context-sensitive-extensions
-  '("TRUNCATED" ; Unisys
-    ))
-
-(defvar cobol-context-sensitive-keywords
-  (append cobol-context-sensitive-keywords-2014
-          cobol-context-sensitive-keywords-finalizer-tr
-          cobol-context-sensitive-keywords-xml-tr
-          cobol-context-sensitive-extensions)
-  "List of context-sensitive COBOL keywords.")
-
-(defconst cobol-intrinsics-85
-  '("ACOS"
-    "ANNUITY"
-    "ASIN"
-    "ATAN"
-    ;; BYTE-LENGTH is treated as a context-sensitive word.
-    "CHAR"
-    "COS"
-    "CONCATENATE"
-    "CURRENT-DATE"
-    "DATE-OF-INTEGER"
-    "DAY-OF-INTEGER"
-    "FACTORIAL"
-    "INTEGER"
-    "INTEGER-OF-DATE"
-    "INTEGER-OF-DAY"
-    "INTEGER-PART"
-    "LENGTH"
-    "LOG"
-    "LOG10"
-    "LOWER-CASE"
-    "MAX"
-    "MEAN"
-    "MEDIAN"
-    "MIDRANGE"
-    "MIN"
-    "MOD"
-    "NUMVAL"
-    "NUMVAL-C"
-    "ORD"
-    "ORD-MAX"
-    "ORD-MIN"
-    "PRESENT-VALUE"
-    ;; RANDOM is treated as a keyword
-    "RANGE"
-    "REM"
-    "REVERSE"
-    "SIGN" ; Keyword <= COBOL-74
-    "SIN"
-    "SQRT"
-    "STANDARD-DEVIATION"
-    "SUM" ; Keyword <= COBOL-74
-    "TAN"
-    "UPPER-CASE"
-    "VARIANCE"
-    "WHEN-COMPILED"))
-
-(defconst cobol-intrinsics-2002
-  (append cobol-intrinsics-85
-          '("ABS"
-            "BOOLEAN-OF-INTEGER"
-            "CHAR-NATIONAL"
-            "DATE-TO-YYYYMMDD"
-            "DAY-TO-YYYYDDD"
-            "DISPLAY-OF"
-            "E"
-            "EXCEPTION-FILE"
-            "EXCEPTION-FILE-N"
-            "EXCEPTION-LOCATION"
-            "EXCEPTION-LOCATION-N"
-            "EXCEPTION-STATEMENT"
-            "EXCEPTION-STATUS"
-            "EXP"
-            "EXP10"
-            "FRACTION-PART"
-            "HIGHEST-ALGEBRAIC"
-            "INTEGER-OF-BOOLEAN"
-            "LOCALE-COMPARE"
-            "LOCALE-DATE"
-            "LOCALE-TIME"
-            "LOWEST-ALGEBRAIC"
-            "NATIONAL-OF"
-            "NUMVAL-F"
-            "PI"
-            "STANDARD-COMPARE"
-            "TEST-DATE-YYYYMMDD"
-            "TEST-DAY-YYYYDDD"
-            "TEST-NUMVAL"
-            "TEST-NUMVAL-C"
-            "TEST-NUMVAL-F"
-            "YEAR-TO-YYYY")))
-
-(defconst cobol-intrinsics-2014
-  (append cobol-intrinsics-2002
-          '("COMBINED-DATETIME"
-            "FORMATTED-CURRENT-DATE"
-            "FORMATTED-DATE"
-            "FORMATTED-DATETIME"
-            "FORMATTED-TIME"
-            "INTEGER-OF-FORMATTED-DATE"
-            "LOCALE-TIME-FROM-SECONDS"
-            "SECONDS-FROM-FORMATTED-TIME"
-            "SECONDS-PAST-MIDNIGHT"
-            "TEST-FORMATTED-DATETIME"
-            "TRIM")))
-
-(defconst cobol-intrinsics-extensions
-  '("ADDR"
-    "CURRENCY-SYMBOL"
-    "LENGTH-AN"
-    "MODULE-CALLER-ID"
-    "MODULE-DATE"
-    "MODULE-FORMATTED-DATE"
-    "MODULE-ID"
-    "MODULE-PATH"
-    "MODULE-SOURCE"
-    "MONETARY-DECIMAL-POINT"
-    "MONETARY-THOUSANDS-SEPARATOR"
-    "NUMERIC-DECIMAL-POINT"
-    "NUMERIC-THOUSANDS-SEPARATOR"
-    "STORED-CHAR-LENGTH"
-    "SUBSTITUTE"
-    "SUBSTITUTE-CASE"
-    "ULENGTH"
-    "UPOS"
-    "USUBSTR"
-    "USUPPLEMENTARY"
-    "UVALID"
-    "UWIDTH"))
-
-(defvar cobol-intrinsics
-  (append cobol-intrinsics-2014
-          cobol-intrinsics-extensions)
-  "List of COBOL standard functions.")
-
-(defconst cobol-symbolic-literals-74
-  '("HIGH-VALUE"
-    "HIGH-VALUES"
-    "LOW-VALUE"
-    "LOW-VALUES"
-    "QUOTE"
-    "QUOTES"
-    "SPACE"
-    "SPACES"
-    "ZERO"
-    "ZEROES"
-    "ZEROS"))
-
-(defconst cobol-symbolic-literals-85
-  cobol-symbolic-literals-74)
-
-(defconst cobol-symbolic-literals-2002
-  (append cobol-symbolic-literals-85
-          '("NULL"
-            "SELF"
-            "SUPER")))
-
-(defconst cobol-symbolic-literals-2014
-  cobol-symbolic-literals-2002)
-
-(defconst cobol-symbolic-literals-extensions
-  '("NULLS"))
-
-(defvar cobol-symbolic-literals
-  (append cobol-symbolic-literals-2014
-          cobol-symbolic-literals-extensions)
-  "List of COBOL symbolic literals.")
-
-(defface cobol-verb
-  '((t (:inherit font-lock-keyword-face :weight bold)))
-  "Face for COBOL verbs.")
-
-(defface cobol-context-sensitive
-  '((t (:inherit font-lock-keyword-face)))
-  "Face for context-sensitive COBOL words.")
-
-;;; Highlighting regexps
-
-(defconst cobol--fixed-form-sequence-area-re
-  "^.\\{1,6\\}"
-  "Regexp matching the fixed-form sequence area.")
-
-(eval-and-compile
-(defconst cobol--complete-sequence-area-re
-  "^.\\{6\\}"
-  "Regexp matching a complete sequence area.")
-
-(defconst cobol--fixed-comment-indicators
-  "*/"
-  "String containing COBOL fixed-form comment indicator characters.")
-
-(defconst cobol--fixed-form-comment-re
-  (concat cobol--complete-sequence-area-re
-          "\\(["
-          cobol--fixed-comment-indicators
-          "]\\)")
-  "Regexp matching a fixed-form source comment.")
-
-(defconst cobol--continuation-or-debugging-indicator-re
-  (concat cobol--complete-sequence-area-re
-          "\\([d-]\\)")
-  "Regexp matching a continuation or debugging line indicator.")
-
-(defconst cobol--non-fixed-comment-indicators-re
-  (concat "[^" cobol--fixed-comment-indicators "]")
-  "Regexp matching non-fixed-form-comment-indicator characters.")
-
-(defconst cobol--fixed-non-comment-sequence-area-re
-  (concat cobol--complete-sequence-area-re
-          cobol--non-fixed-comment-indicators-re)
-  "Regexp matching the sequence area of a non-comment fixed-form line."))
-
-(defconst cobol--fixed-non-comment-grouped-sequence-area-re
-  (concat "\\(" cobol--fixed-form-sequence-area-re "\\)")
-  "Regexp matching the sequence area of a non-comment fixed-form line in a
-group.")
-
-(defconst cobol--fixed-form-areas-02-re
-  cobol--fixed-non-comment-grouped-sequence-area-re
-  "Regexp matching the ignored fixed-forms area in COBOL 2002 for non-comment
-lines.")
-
-(defconst cobol--fixed-form-areas-85-re
-  (concat cobol--fixed-non-comment-grouped-sequence-area-re
-          ".\\{0,66\\}\\(.*\\)")
-  "Regexp matching the ignored fixed-form areas up to COBOL-85 for non-comment
-lines.")
-
-(defconst cobol--fixed-form-wrong-indicator-re
-  (concat cobol--fixed-form-sequence-area-re "\\([^-\\*/d$]\\)")
-  "Regexp matching incorrect indicators in fixed-form code.")
-
-(defconst cobol--free-form-comment-re
-  "\\*>.*"
-  "Regexp matching a free-form source comment.")
-
-(eval-and-compile
-(defconst cobol--optional-whitespace-re
-  "[   ]*" ; Space and tab
-  "Regexp matching optional whitespace.
-\\w isn't used to avoid matching newlines.")
-
-(defconst cobol--optional-leading-whitespace-line-re
-  (if (not (eq cobol-source-format 'free))
-      (concat cobol--fixed-non-comment-sequence-area-re
-              cobol--optional-whitespace-re)
-    (concat "^" cobol--optional-whitespace-re))
-  "Regexp matching a line perhaps starting with whitespace.")
-
-(defun cobol--with-opt-whitespace-line (&rest strs)
-  "Return STRS concatenated after 
`cobol--optional-leading-whitespace-line-re'."
-  (apply #'concat cobol--optional-leading-whitespace-line-re strs)))
-
-(defconst cobol--free-form-comment-line-re
-  (cobol--with-opt-whitespace-line cobol--free-form-comment-re)
-  "Regexp matching a free form comment line.")
-
-(defconst cobol--identifier-re
-  "\\s-+\\(\\w+\\)"
-  "Regexp matching an identifier in a separate group preceded by whitespace.")
-
-(defconst cobol--mf-set-directive
-  (cobol--with-opt-whitespace-line "\\$SET\\s-+\\w+")
-  "Regexp matching MF compiler directive with optional whitespace.")
-
-(defconst cobol--mf-compiler-directive-re
-  (if (not (eq cobol-source-format 'free))
-      (concat cobol--fixed-form-sequence-area-re
-              ;; FIXME: cobol--mf-set-directive starts with "^" so it can't
-              ;; match after cobol--fixed-form-sequence-area-re!
-              cobol--mf-set-directive)
-    (concat "^" cobol--mf-set-directive))
-  "Regexp matching Micro Focus compiler directives.")
-
-(defconst cobol--standard-constant-re
-  (cobol--with-opt-whitespace-line "0?1" cobol--identifier-re  "\\s-+CONSTANT")
-  "Regexp matching constants declared as specified by the 2002 standard.")
-
-(defconst cobol--mf-constant-re
-  (cobol--with-opt-whitespace-line "78" cobol--identifier-re)
-  "Regexp matching constants declared as specified by Micro Focus.")
-
-(eval-and-compile
-(defconst cobol--directive-indicator-re
-  ">> ?"
-  "Regexp matching a valid directive indicator."))
-
-(defconst cobol--define-directive-re
-  (cobol--with-opt-whitespace-line cobol--directive-indicator-re
-                                  "DEFINE"
-                                  cobol--identifier-re)
-  "Regexp matching values defined by the pre-processor.")
-
-(defconst cobol--descriptor-level-re
-  "[FRS]D"
-  "Regexp matching file/report/sort descriptor 'level numbers'.")
-
-(defconst cobol--record-descriptor-re
-  (cobol--with-opt-whitespace-line cobol--descriptor-level-re 
cobol--identifier-re)
-  "Regexp matching file/report/sort record associations.")
-
-(defconst cobol--typedef-definition-re
-  (cobol--with-opt-whitespace-line "0?1" cobol--identifier-re ".+TYPEDEF")
-  "Regexp matching typedefs.")
-
-(defconst cobol--level-number-re
-  "[[:digit:]]\\{1,2\\}"
-  "Regexp matching level numbers.")
-
-(defconst cobol--variable-declaration-re
-  (cobol--with-opt-whitespace-line cobol--level-number-re cobol--identifier-re)
-  "Regexp matching standard variable declarations.")
-
-(defconst cobol--mf-declare-variable-re
-  (cobol--with-opt-whitespace-line "DECLARE" cobol--identifier-re)
-  "Regexp matching variable declarations using DECLARE verb used in Managed
-COBOL.")
-
-(defconst cobol--id-and-name-re
-  "-ID\\.?\\s-*\\(\\w+\\)"
-  "Regexp matching a construct ID and the name of the declared construct.")
-
-(defun cobol--create-id-re (re)
-  "Create an id regexp using RE."
-  (cobol--with-opt-whitespace-line re cobol--id-and-name-re))
-
-(defun cobol--create-end-marker-re (re)
-  "Create an end marker regexp using RE."
-  (cobol--with-opt-whitespace-line "END\\s-+" re cobol--identifier-re))
-
-(defconst cobol--standard-function-types
-  '("FUNCTION" "METHOD" "PROGRAM")
-  "List containing the names of standard constructs similar to functions.")
-
-(defconst cobol--mf-function-types
-  '("ITERATOR" "OPERATOR" "PROPERTY")
-  "List containing the names of constructs similar to functions created by 
Micro
-Focus.")
-
-(defconst cobol--function-types-re
-  (regexp-opt (append cobol--standard-function-types cobol--mf-function-types))
-  "Regexp matching the names of constructs similar to functions.")
-
-(defconst cobol--function-id-name-re
-  (cobol--create-id-re (remove "PROPERTY" cobol--function-types-re))
-  "Regexp matching the id and name of a function or similar.")
-
-(defconst cobol--function-end-marker-re
-  (cobol--create-end-marker-re cobol--function-types-re)
-  "Regexp matching the end marker of a function or similar.")
-
-(defconst cobol--standard-type-types
-  '("CLASS" "INTERFACE")
-  "List containing the standard type construct names.")
-
-(defconst cobol--mf-type-types
-  '("DELEGATE" "ENUM" "INDEXER" "VALUETYPE")
-  "List containing the names of type constructs added by Micro Focus.")
-
-(defconst cobol--type-types-re
-  (regexp-opt (append cobol--standard-type-types cobol--mf-type-types))
-  "Regexp matching type construct names.")
-
-(defconst cobol--type-id-name-re
-  (cobol--create-id-re cobol--type-types-re)
-  "Regexp matching the id and name of a type.")
-
-(defconst cobol--type-end-marker-re
-  (cobol--create-end-marker-re cobol--type-types-re)
-  "Regexp matching the end marker of a type.")
-
-(defconst cobol--mf-property-id-name-re
-  (concat "PROPERTY" cobol--id-and-name-re cobol--identifier-re)
-  "Regexp matching the id, name and type of a property using MF's PROPERTY-ID
-syntax.")
-
-(defconst cobol--procedure-re
-  (cobol--with-opt-whitespace-line "\\(\\w+\\)\\(\\s-+SECTION\\)?\\.")
-  "Regexp matching the declaration of a procedure.
-Note that this matches DECLARATIVES.")
-
-(defconst cobol--select-file-re
-  (cobol--with-opt-whitespace-line
-   "SELECT\\(\\s-+OPTIONAL\\)?"
-   cobol--identifier-re)
-  "Regexp matching the declaration of a file.")
-
-(defconst cobol--pic-type-re
-  
"PIC\\(TURE\\)?\\(\\s-+IS\\)?\\s-+\\(\\([-$*+,./[:digit:]()ABENPSVXZ]\\|CR\\|DB\\)+?\\)\\(\\s-\\|\\.?
-\\)"
-  "Regexp matching the PICTURE clause of a variable.")
-
-(defconst cobol--string-literal-type-re
-  "\\([ZBN]X?\\|[GHLX]\\)\\(\"\\|\'\\)"
-  "Regexp matching the type of a string-style literal.")
-
-(defconst cobol--function-call-re
-  "\\(\\w+\\)("
-  "Regexp matching a function call.")
-
-(defun cobol--create-specifier-type-re (types)
-  "Create a specifier id regexp for the list of type names TYPES."
-  (cobol--with-opt-whitespace-line
-   "\\("
-   (mapconcat #'identity types "\\|")
-   "\\)"
-   cobol--identifier-re))
-
-(defconst cobol--repository-function-type-clause-re
-  (cobol--create-specifier-type-re cobol--standard-function-types)
-  "Regexp matching a REPOSITORY specifier clause for function types.")
-
-(defconst cobol--repository-type-type-clause-re
-  (cobol--create-specifier-type-re cobol--standard-type-types)
-  "Regexp matching a REPOSITORY specifier clause for type types.")
-
-(defconst cobol--mf-invoked-class-re
-  (concat "TYPE" cobol--identifier-re)
-  "Regexp matching a class being INVOKED.")
-
-(defconst cobol--implementer-user-exception-re
-  "EC-\\(IMP\\|USER\\)-\\w+"
-  "Regexp matching an implementor- or user-defined exception condition.")
-
-(defconst cobol--scope-terminator-re
-  (cobol--with-opt-whitespace-line (regexp-opt cobol-scope-terminators 'words))
-  "Regexp matching a scope terminator.")
-
-(defconst cobol--phrases-with-double-indent-after
-  
"\\(IF\\|EVALUATE\\|WHEN\\|ELSE\\|PERFORM\\s-+\\(VARYING\\|UNTIL\\|\\(WITH\\s-+\\)?TEST\\|.+?\\s-+TIMES\\)\\)"
-  "Regexp matching phrases whose conditions/clauses are indented twice.")
-
-(defconst cobol--containing-statement-or-phrase-re
-  (cobol--with-opt-whitespace-line
-   "\\("
-   cobol--phrases-with-double-indent-after
-   
"\\|\\(NOT\\s-+\\)?\\(\\(AT\\s-+\\)?END\\(-OF-PAGE\\)?\\>\\|\\(ON\\s-+\\)?\\(OVERFLOW\\|EXCEPTION\\|ESCAPE\\|SIZE\\s-+ERROR\\)\\|INVALID\\s-+KEY\\)\\)")
-  "Regexp matching statements/phrases that contain nested statements.")
-
-(defconst cobol--verb-re
-  (cobol--with-opt-whitespace-line (regexp-opt cobol-verbs 'words))
-  "Regexp matching a verb.")
-
-(defconst cobol--non-id-groups
-  ;; AUTO-METHOD is part of the Finalizer TR.
-  '("AUTO-METHOD" "DECLARATIVES" "FACTORY" "OBJECT" "METHOD")
-  "Groups which do not take a (specifiable) ID.")
-
-(defconst cobol--non-id-group-end-marker-re
-  (cobol--with-opt-whitespace-line
-   "END\\s-+" (regexp-opt cobol--non-id-groups 'words))
-  "Regexp matching the end marker of the groups not taking IDs.")
-
-(defconst cobol--end-marker-re
-  (concat "\\(" cobol--function-end-marker-re
-          "\\|" cobol--type-end-marker-re
-          "\\|" cobol--non-id-group-end-marker-re
-          "\\)")
-  "Regexp matching an end marker.")
-
-(defconst cobol--division-re
-  (cobol--with-opt-whitespace-line 
"\\(IDENTIFICATION\\|ENVIRONMENT\\|DATA\\|PROCEDURE\\)\\s-+DIVISION")
-  "Regexp matching division header.")
-
-(defconst cobol--procedure-division-re
-  (cobol--with-opt-whitespace-line "PROCEDURE\\s-+DIVISION")
-  "Regexp matching the procedure division header.")
-
-(defconst cobol--env-or-data-div-sections-re
-  (cobol--with-opt-whitespace-line
-   (regexp-opt '("CONFIGURATION" "INPUT-OUTPUT" "FILE" "WORKING-STORAGE" 
"LOCAL-STORAGE" "LINKAGE" "REPORT" "SCREEN"))
-   "\\s-+SECTION.")
-  "Regexp matching the sections of the environment and data divisions.")
-
-(defconst cobol--generic-declaration-re
-  (cobol--with-opt-whitespace-line
-   "\\("
-   cobol--descriptor-level-re
-   "\\|"
-   cobol--level-number-re
-   "\\)"
-   cobol--identifier-re)
-  "Regexp matching any declaration.")
-
-(defconst cobol--blank-line-re
-  (cobol--with-opt-whitespace-line "\\.?$")
-  "Regexp matching a blank line with optional period.")
-
-;;; Font lock
-
-(defun cobol--fixed-format-p ()
-  "Return whether the current source format is fixed."
-  (memq cobol-source-format '(fixed-85 'fixed-2002)))
-
-;; This is required for indentation to function, because the initial sequence
-;; area is marked as a comment, not whitespace.
-(defun cobol-back-to-indentation ()
-  "Move point to the first non-whitespace character on this line.
-If in fixed-form code, the sequence area and indicators are skipped.
-Code copied from the Emacs source."
-  (interactive "^")
-  (beginning-of-line 1)
-  (when (cobol--fixed-format-p)
-    (forward-char 7))
-  (skip-syntax-forward " " (line-end-position))
-  ;; Move back over chars that have whitespace syntax but have the p flag.
-  (backward-prefix-chars))
-
-(defun cobol--font-lock-sequence-area (end)
-  "Mark text in the sequence area as comments from point up to END."
-  (when (cobol--fixed-format-p)
-    (while (and (< (point) end)
-                (re-search-forward "^.\\{1,6\\}" end t))
-      (put-text-property (match-beginning 0) (point)
-                         'face font-lock-comment-face)))
-  nil)
-
-(eval-when-compile
-  (defconst cobol--syntax-propertize-indicator-area
-    (syntax-propertize-precompile-rules
-     (cobol--fixed-form-comment-re (1 "<"))
-     (cobol--continuation-or-debugging-indicator-re (1 ".")))
-    "Syntax rules to mark fixed-form comments as comments.")
-
-  (defconst cobol--syntax-propertize-program-name-area
-    (syntax-propertize-precompile-rules
-     ;; TODO: Override open strings
-     ("^.\\{72\\}\\(.\\)" (1 "<")))
-    "Syntax rule to mark text in the program name area as comments.")
-
-  (defconst cobol--syntax-propertize-page-directive
-    (syntax-propertize-precompile-rules
-     ((cobol--with-opt-whitespace-line cobol--directive-indicator-re
-                                       "PAGE\\([       ]\\)")
-      (1 "<")))
-    "Syntax rule to mark text after >>PAGE as a comment.")
-
-  (defconst cobol--syntax-propertize-adjacent-quotes
-    (syntax-propertize-precompile-rules
-     ("\"\"\\|''"
-      (0 (ignore
-          ;; Move to first quote.
-          (backward-char 2)
-          (if (nth 3 (syntax-ppss))
-              (progn
-                (put-text-property (point) (1+ (point))
-                                   'syntax-table (string-to-syntax "\\"))
-                ;; Move back to past the escaped quotes.
-                (forward-char 2))
-            ;; If the first quote began a string, then the next quote may be 
the
-            ;; first character in another escaped quote sequence.
-            (forward-char 1))))))
-    "Syntax rule to mark the first of adjacent quotes, e.g. \"\" or '', as an 
escape character."))
-
-(defun cobol--syntax-propertize-function (beg end)
-  "Syntax propertize awkward COBOL features (fixed-form comments, indicators
-and ignored areas) between points BEG and END."
-  ;; TO-DO: Propertize continuation lines.
-  (funcall
-   (pcase cobol-source-format
-     (`fixed-85 (syntax-propertize-rules
-                 cobol--syntax-propertize-indicator-area
-                 cobol--syntax-propertize-program-name-area
-                 cobol--syntax-propertize-page-directive
-                 cobol--syntax-propertize-adjacent-quotes))
-     (`fixed-2002 (syntax-propertize-rules
-                   cobol--syntax-propertize-indicator-area
-                   cobol--syntax-propertize-page-directive
-                   cobol--syntax-propertize-adjacent-quotes))
-     (_ (syntax-propertize-rules
-         cobol--syntax-propertize-page-directive
-         cobol--syntax-propertize-adjacent-quotes)))
-   beg end))
-
-;; Change to defconst so it reloads on something?
-(defvar cobol-font-lock-defaults
-  `((;; Sequence area
-     (cobol--font-lock-sequence-area)
-
-     ;; Directives
-     ( ,(concat cobol--directive-indicator-re
-                "\\(" (regexp-opt cobol-directives) "\\>\\)")
-       . font-lock-preprocessor-face)
-     ( ,cobol--mf-compiler-directive-re . font-lock-preprocessor-face)
-
-     ;; TO-DO: Highlight reserved words in directives as reserved words
-
-     ;; Standard language features.
-     ( ,(regexp-opt cobol-verbs 'words) . 'cobol-verb)
-     ( ,(regexp-opt cobol-keywords 'words) . font-lock-keyword-face)
-     ( ,(regexp-opt cobol-context-sensitive-keywords 'words)
-       . 'cobol-context-sensitive)
-     ( ,cobol--implementer-user-exception-re . 'cobol-context-sensitive)
-     ( ,(regexp-opt cobol-intrinsics 'words) . font-lock-builtin-face)
-
-     ;; Constants
-     ( ,(regexp-opt cobol-symbolic-literals 'words) . font-lock-constant-face)
-     ( ,cobol--standard-constant-re
-       (1 'font-lock-constant-face))
-     ( ,cobol--mf-constant-re
-       (1 'font-lock-constant-face))
-     ( ,cobol--define-directive-re
-       (1 'font-lock-constant-face))
-
-     ;; PIC Type
-     ( ,cobol--pic-type-re
-       (3 'font-lock-type-face))
-
-     ;; Functions
-     ( ,cobol--function-call-re
-       (1 'font-lock-function-name-face))
-
-     ;; REPOSITORY clauses
-     ( ,cobol--repository-function-type-clause-re
-       (2 'font-lock-function-name-face))
-     ( ,cobol--repository-type-type-clause-re
-       (2 'font-lock-type-face))
-
-     ;; File declarations
-     ( ,cobol--select-file-re
-       (2 'font-lock-type-face))
-
-     ;; File/Report/Sort record associations
-     ( ,cobol--record-descriptor-re
-       (1 'font-lock-type-face))
-
-     ;; Typedef
-     ( ,cobol--typedef-definition-re
-       (1 'font-lock-type-face))
-
-     ;; Variables
-     ( ,cobol--variable-declaration-re
-       (1 'font-lock-variable-name-face))
-     ( ,cobol--mf-declare-variable-re
-       (1 'font-lock-variable-name-face))
-
-     ;; Construct IDs
-     ( ,cobol--function-id-name-re
-       (1 'font-lock-function-name-face))
-     ( ,cobol--type-id-name-re
-       (1 'font-lock-type-face))
-     ( ,cobol--mf-property-id-name-re
-       (1 'font-lock-variable-name-face)
-       (2 'font-lock-type-face))
-
-     ;; Construct end markers
-     ( ,cobol--function-end-marker-re
-       (1 'font-lock-function-name-face))
-     ( ,cobol--type-end-marker-re
-       (1 'font-lock-type-face))
-
-     ;; Invoked classes
-     ( ,cobol--mf-invoked-class-re
-       (1 'font-lock-type-face))
-
-     ;; Procedures
-     ( ,cobol--procedure-re
-       (1 'font-lock-function-name-face))
-
-     ( ,cobol--string-literal-type-re
-       (1 'font-lock-string-face)))
-    nil
-    t
-    nil
-    nil))
-
-;;; Skeletons
-
-(define-skeleton cobol-skeleton-if-else
-  "Insert an IF - ELSE - END-IF block." nil
-  > "IF " (skeleton-read "Condition: ") > \n
-  > _ \n
-  "ELSE" > \n
-  > \n
-  "END-IF" > \n)
-
-(define-skeleton cobol-skeleton-if
-  "Insert an IF - END-IF block." nil
-  > "IF " (skeleton-read "Condition: ") > \n
-  > _ \n
-  "END-IF" > \n)
-
-(define-skeleton cobol-skeleton-perform-times
-  "Insert a PERFORM - TIMES - END-PERFORM block." nil
-  > "PERFORM " (skeleton-read "Number: ") " TIMES" > \n
-  > _ \n
-  "END-PERFORM" > \n)
-
-(define-skeleton cobol-skeleton-perform-varying
-  "Insert a PERFORM VARYING - FROM - BY - UNTIL - END-PERFORM block."
-  nil
-  > "PERFORM VARYING "
-  (skeleton-read "Variable: ")
-  " FROM "
-  (skeleton-read "Start: ")
-  " BY "
-  (skeleton-read "Step: ")
-  " UNTIL "
-  (skeleton-read "Condition: ") > \n
-  > _ \n
-  "END-PERFORM" > \n)
-
-(defun cobol-when-with-also (prompt num-also)
-  "Create a WHEN clause skeleton with provided PROMPT and NUM-ALSO ALSOs."
-  `(,prompt "WHEN " str
-    ,@(let ((clauses nil))
-        (dotimes (_ num-also)
-          (push `(" ALSO " (skeleton-read ,prompt)) clauses))
-        clauses)
-    > \n > _ \n))
-
-(defvar cobol--num-conds)
-
-(define-skeleton cobol-skeleton-evaluate
-  "Insert an EVALUATE - END-EVALUATE block."
-  "Variable/TRUE: "
-  ;; This is set like so because cobol--num-conds is incremented even when no 
str is supplied.
-  '(setf cobol--num-conds -1)
-  > "EVALUATE " str ("Variable/TRUE: "
-                     '(setf cobol--num-conds (1+ cobol--num-conds))
-                     " ALSO " str)
-  > \n
-  (cobol-when-with-also "Value/Condition: " cobol--num-conds)
-  "END-EVALUATE")
-
-(define-skeleton cobol-skeleton-program
-  "Insert an empty PROGRAM."
-  "Program name: "
-  > "IDENTIFICATION DIVISION." > \n
-  "PROGRAM-ID. " str "." > \n
-  > \n
-  "DATA DIVISION." > \n
-  "WORKING-STORAGE SECTION." > \n
-  > _ \n
-  "PROCEDURE DIVISION." > \n
-  > \n
-  "END PROGRAM " str "." > \n)
-
-(define-skeleton cobol-skeleton-function
-  "Insert an empty FUNCTION."
-  "Function name: "
-  > "IDENTIFICATION DIVISION." > \n
-  "FUNCTION-ID. " str "." > \n
-  > \n
-  "DATA DIVISION." > \n
-  "LOCAL-STORAGE SECTION." > \n
-  > \n
-  "LINKAGE SECTION." > \n
-  > _ \n
-  "PROCEDURE DIVISION RETURNING ." > \n
-  > \n
-  "END FUNCTION " str "." > \n)
-
-(define-skeleton cobol-skeleton-method
-  "Insert an empty METHOD."
-  "Method name: "
-  > "IDENTIFICATION DIVISION." > \n
-  "METHOD-ID. " str "." > \n
-  > \n
-  "DATA DIVISION." > \n
-  "LOCAL-STORAGE SECTION." > \n
-  > _ \n
-  "PROCEDURE DIVISION." > \n
-  > \n
-  "END METHOD " str "." > \n)
-
-(define-skeleton cobol-skeleton-class
-  "Insert an empty CLASS."
-  "Class name: "
-  > "IDENTIFICATION DIVISION." > \n
-  "CLASS-ID. " str "." > \n
-  > _ \n
-  "FACTORY." > \n
-  "END FACTORY." > \n
-  > \n
-  "OBJECT." > \n
-  "END OBJECT." > \n
-  "END CLASS " str "." > \n)
-
-(define-skeleton cobol-skeleton-interface
-  "Insert an empty INTERFACE."
-  "Interface name: "
-  > "IDENTIFICATION DIVISION." > \n
-  "INTERFACE-ID. " str "." > \n
-  > _ \n
-  "FACTORY." > \n
-  "END FACTORY." > \n
-  > \n
-  "OBJECT." > \n
-  "END OBJECT." > \n
-  "END INTERFACE " str "." > \n)
-
-;;; Code formatting
-
-(defconst cobol-formats
-  '(upper-case lower-case capitalised-all capitalised-verbs)
-  "The different formats supported when formatting COBOL code.")
-
-(defcustom cobol-format-style 'upper-case
-  "The type of formatting used when formatting COBOL code."
-  :type (cobol--radio-of-list cobol-formats)
-  :safe (cobol--val-in-list-p cobol-formats))
-
-(defun cobol-format-word (word)
-  "Return WORD formatted according to `cobol-format-style'."
-  (cond
-   ((eql cobol-format-style 'upper-case)
-    (upcase word))
-   ((eql cobol-format-style 'lower-case)
-    (downcase word))
-   ((eql cobol-format-style 'capitalised-all)
-    (capitalize word))
-   ((eql cobol-format-style 'capitalised-verbs)
-    (if (memq word cobol-verbs)
-        (capitalize word)
-      (downcase word)))))
-
-(defun cobol-format-region (beg end)
-  "Format all COBOL words between BEG and END according to
-`cobol-format-style'."
-  (interactive "*r")
-  (cobol-format beg end))
-
-(defun cobol-format-buffer ()
-  "Format all COBOL words in the current buffer according to
-`cobol-format-style'."
-  (interactive "*")
-  (cobol-format (point-min) (point-max)))
-
-(defun cobol-format (beg end)
-  "Format COBOL code between BEG and END according to `cobol-format-style'."
-  (defconst words-to-format
-    (append cobol-directives cobol-verbs cobol-keywords cobol-intrinsics
-            cobol-symbolic-literals))
-
-  (save-excursion
-    (dolist (word words-to-format)
-      (let ((ref-point (point-min)))
-        (goto-char beg)
-        (while (search-forward-regexp (concat "\\<" word "\\>") end t)
-          (when (not (let ((state (parse-partial-sexp ref-point (point))))
-                       (or (nth 3 state) (nth 4 state))))
-            (replace-match (cobol-format-word word) t)))))))
-
-;;; Fixed-form formatting
-
-(defun cobol-insert-in-sequence-area (beg end text)
-  "Insert, in the lines between BEG and END, TEXT in the sequence area."
-  (interactive "*r\nsText: ")
-  (when (> (length text) 6)
-    (error "%s is longer than six characters" text))
-  (save-excursion
-    ;; Find rectangle to insert text in.
-    (let (top-left bottom-right)
-      ;; Get top left corner of rectangle.
-      (goto-char beg)
-      (beginning-of-line)
-      (when (< (point) beg)
-        (forward-line 1))
-      (setf top-left (point))
-      ;; Get bottom right corner of rectangle.
-      (while (and (<= (+ (point) 6) end) (not (eobp)))
-        (forward-line 1))
-      (forward-line -1)
-      (setf bottom-right (+ (point) 6))
-      (string-rectangle top-left bottom-right (format "%-6s" text)))))
-
-;;; Indentation
-;;; Derived (a long time ago) from the wonderful Emacs Mode Tutorial at
-;;; <http://www.emacswiki.org/emacs/ModeTutorial>.
-
-(defun cobol--code-start ()
-  "Return the first column code can go in."
-  (if (eq cobol-source-format 'free)
-      0
-    7))
-
-;;; Misc
-(defvar cobol-tab-width 4 "Width of a tab for `cobol-mode'.")
-
-(cl-defun cobol--indent (indent &optional (times 1))
-  "Increment INDENT."
-  (+ indent (* times cobol-tab-width)))
-
-(defun cobol--current-indentation ()
-  "Return the indentation of the current line or -1 if the line is within the
-sequence area."
-  (if (< (- (line-end-position) (line-beginning-position)) (cobol--code-start))
-     -1
-    (save-excursion
-      (goto-char (+ (line-beginning-position) (cobol--code-start)))
-      (let ((code-start-position (point)))
-        (skip-syntax-forward " " (line-end-position))
-        (backward-prefix-chars)
-        (- (point) code-start-position)))))
-
-(defun cobol--indent-current ()
-  "Return the current indent level indented once."
-  (cobol--indent (cobol--current-indentation)))
-
-(defun cobol--search-back (fn)
-  "Go back a line at a time, calling FN each time.
-If the car of the return value is non-nil, return the cdr."
-  (save-excursion
-    (cl-do ((ret nil (funcall fn)))
-        ((car ret) (cdr ret))
-      (forward-line -1))))
-
-(cl-defun cobol--search-back-for-indent (str &key with-whitespace)
-  "Return the indent of the previous line starting with the regexp STR 
(optionally
-after whitespace if WITH-WHITESPACE). If that cannot be found, return 0."
-  (let ((line-re (concat (when with-whitespace cobol--optional-whitespace-re)
-                         str)))
-    (cobol--search-back
-     #'(lambda () (cond ((bobp)
-                         (cons t 0))
-                        ((looking-at line-re)
-                         (cons t (cobol--current-indentation))))))))
-
-(defun cobol--indent-of-last-div ()
-  "Return the indent of the last division."
-  (cobol--search-back-for-indent cobol--division-re))
-
-(defun cobol--indent-of-last-div-or-section ()
-  "Return the indent of the preceding division or section."
-  (cobol--search-back-for-indent "\\w+\\s-+\\(DIVISION\\|SECTION\\)\\." 
:with-whitespace t))
-
-(defun cobol--indent-of-end-marker-match (group)
-  "Return the indent of the start of GROUP."
-  (if (memq (upcase group) cobol--non-id-groups)
-      (cobol--search-back-for-indent
-       (concat group ".") :with-whitespace t)
-    (cobol--search-back-for-indent
-     (cobol--create-id-re group))))
-
-(defun cobol--match-with-leading-whitespace (re str)
-  "Match regexp RE (with optional leading whitespace) against STR."
-  (string-match (concat cobol--optional-leading-whitespace-line-re re)
-                str))
-
-(defun cobol--match-line-with-leading-whitespace (re)
-  "Match regexp RE (with optional leading whitespace) against the current 
line."
-  (cobol--match-with-leading-whitespace re (thing-at-point 'line)))
-
-(defun cobol--get-level-number (declaration)
-  "Return the level-number of DECLARATION.
-If the declaration does not have a level number, return zero."
-  (string-match cobol--generic-declaration-re declaration)
-  (string-to-number (match-string 1 declaration)))
-
-(defun cobol--indent-of-group-item (wanted-level-num)
-  "Return the indentation of the last item with WANTED-LEVEL-NUM or indented
-from the last item of lower level."
-  (cobol--search-back
-   #'(lambda ()
-       (cond ((looking-at cobol--generic-declaration-re)
-              (let ((level-num (cobol--get-level-number (thing-at-point 
'line))))
-                (cond ((eq level-num wanted-level-num)
-                       (cons t (cobol--current-indentation)))
-                      ((< level-num wanted-level-num)
-                       (cons t (cobol--indent-current))))))
-             ((bobp)
-              (cons t 0))))))
-
-(defun cobol--indent-of-declaration (decl)
-  "Return the indentation of the declaration DECL."
-  (let ((level-num (cobol--get-level-number decl)))
-    (if (or (>= 1 level-num) (eq 77 level-num) (eq 66 level-num))
-        ;; If elementary item or FD/SD/RD.
-        (cobol--search-back-for-indent cobol--division-re)
-      ;; Find indent of item with same level or add-indent to previous item of
-      ;; lower level. (This means 88 levels will always be indented to the
-      ;; previous item.)
-      (cobol--indent-of-group-item level-num))))
-
-(defun cobol--indent-from-previous ()
-  "Return what the indent of the current line should be based on previous
-lines."
-  (cobol--search-back
-   #'(lambda ()
-       (cond ((looking-at cobol--env-or-data-div-sections-re)
-              (cons t (cobol--current-indentation)))
-             ((or (looking-at cobol--containing-statement-or-phrase-re)
-                  (looking-at cobol--procedure-re)
-                  (looking-at cobol--procedure-division-re))
-              (cons t (cobol--indent-current)))
-             ((or (looking-at cobol--verb-re)
-                  (looking-at cobol--scope-terminator-re)
-                  (looking-at cobol--type-end-marker-re)
-                  (looking-at cobol--function-end-marker-re)
-                  (looking-at cobol--division-re)
-                  (looking-at cobol--generic-declaration-re))
-              (cons t (cobol--current-indentation)))
-             ((bobp)
-              (cons t 0))))))
-
-(defun cobol--phrase-with-not (phrase)
-  "Return regexp matching line with optional NOT and PHRASE."
-  (cobol--with-opt-whitespace-line "\\(NOT\\s-+\\)?" phrase))
-
-(defun cobol--at-phrase (phrase)
-  "Return regexp matching PHRASE with optional AT and NOT."
-  (cobol--phrase-with-not (concat "\\(AT\\s-+\\)?" phrase)))
-
-(defun cobol--on-phrase (phrase)
-  "Return regexp matching PHRASE with optional ON and NOT."
-  (cobol--phrase-with-not (concat "\\(ON\\s-+\\)?" phrase)))
-
-(defun cobol--statements-with-phrase (str)
-  "Return a list of statements taking the phrase STR."
-  (cond ((string-match (cobol--with-opt-whitespace-line "WHEN")
-                       str)
-         '("EVALUATE" "SEARCH"))
-        ((string-match (cobol--at-phrase "END-OF-PAGE") str)
-         '("WRITE"))
-        ((string-match (cobol--at-phrase "END") str)
-         ;; An AT END clause is added to OPEN in the XML TR.
-         '("OPEN" "READ" "RETURN" "SEARCH"))
-         ((string-match (cobol--on-phrase "OVERFLOW") str)
-          '("CALL" "STRING" "UNSTRING"))
-         ((string-match (cobol--on-phrase "EXCEPTION") str)
-          '("ACCEPT" "CALL" "DISPLAY"))
-         ((string-match (cobol--on-phrase "ESCAPE") str)
-          '("ACCEPT")) ; MF/ACUCOBOL extension
-         ((string-match (cobol--on-phrase "SIZE\\s-+ERROR") str)
-          '("ADD" "COMPUTE" "DIVIDE" "MULTIPLY" "SUBTRACT"))
-         ((string-match (cobol--phrase-with-not "INVALID\\s-+KEY") str)
-          '("DELETE" "READ" "REWRITE" "START"))
-         (t
-          (error "Invalid phrase"))))
-
-(defun cobol--scope-terminator-statement (scope-terminator)
-  "Return the statement contained in SCOPE-TERMINATOR."
-  (cobol--match-with-leading-whitespace "END-\\(\\w+\\)" scope-terminator)
-  (match-string 1 scope-terminator))
-
-(defun cobol--first-word (str)
-  "Return the first word in STR."
-  (cobol--match-with-leading-whitespace "\\(\\w+\\)" str)
-  (match-string 1 str))
-
-(defun cobol--go-to-open-statement (statements)
-  "Go to the last open (unterminated) statement in STATEMENTS."
-  (let* ((statements-re (regexp-opt statements t))
-         (valid-statement-re (cobol--with-opt-whitespace-line statements-re))
-         (valid-scope-terminator-re cobol--scope-terminator-re)
-         found)
-    (while (not found)
-      (forward-line -1)
-      (cond ((looking-at valid-statement-re)
-             ;; Check the scope-terminator is not on the same line.
-             (let ((scope-terminator
-                    (concat "END-" (cobol--first-word (thing-at-point 
'line)))))
-               (unless (string-match scope-terminator (thing-at-point 'line))
-                 (setf found t))))
-
-            ;; Skip past terminated statements
-            ((looking-at valid-scope-terminator-re)
-             (let ((terminated-statement
-                    (cobol--scope-terminator-statement (thing-at-point 
'line))))
-               (cobol--go-to-open-statement (list terminated-statement))))
-
-            ;; If no statement is found, stop at beginning of buffer.
-            ((bobp)
-             (setf found t))))))
-
-(defun cobol--indent-of-open-statement (statements)
-  "Return the indent of the last open statement in STATEMENTS."
-  (save-excursion
-    (cobol--go-to-open-statement statements)
-    (cobol--current-indentation)))
-
-(defun cobol--indent-of-containing-statement-or-phrase (str)
-  "Return the indentation of containing statement/phrase in STR."
-  (let ((phrase (upcase (cobol--first-word str))))
-    (cond ((or (string-equal phrase "IF")
-               (string-equal phrase "EVALUATE")
-               (string-equal phrase "PERFORM"))
-           (cobol--indent-from-previous))
-
-          ((string-equal phrase "ELSE")
-           (cobol--indent-of-open-statement '("IF")))
-
-          (t
-           (cobol--indent (cobol--indent-of-open-statement
-                           (cobol--statements-with-phrase str)))))))
-
-(defun cobol--get-current-division ()
-  "Return the division containing point as a symbol."
-  (cobol--search-back
-   #'(lambda ()
-       (cond ((looking-at cobol--division-re)
-              (string-match cobol--division-re (thing-at-point 'line))
-              (let ((division (downcase (match-string 1 (thing-at-point 
'line)))))
-                (cons t (intern division))))
-
-             ((or (looking-at cobol--end-marker-re)
-                  (bobp))
-              (cons t 'identification))))))
-
-(defun cobol--no-instances-of-after-in-division (instance-re after-re division)
-  "Actual implementation of `cobol--no-instances-of'."
-  (and (eq division (cobol--get-current-division))
-       (cobol--search-back
-        #'(lambda ()
-            (cond ((looking-at after-re)
-                   (cons t t))
-                  ((or (looking-at instance-re)
-                       (bobp))
-                   (cons t nil)))))))
-
-(defmacro cobol--no-instances-of (re after re2 in division)
-  "Return non-nil if there are no instances of things matched by RE
-between point and the previous instance of RE2.
-Return nil if point is not in DIVISION or if nothing is found.
-Arguments must be in the form 'RE after RE2 in DIVISION' where
-`after' and `in' stand for themselves."
-  (cl-assert (and (eq after 'after)
-                  (eq in 'in))
-             nil
-             "Clauses should be in the form 're AFTER re-2 IN division'.")
-  `(cobol--no-instances-of-after-in-division ,re ,re2 ,division))
-
-(defun cobol--in-file-control-p ()
-  "Return whether point is in the FILE-CONTROL paragraph."
-  (cobol--no-instances-of cobol--procedure-re
-                         after (cobol--with-opt-whitespace-line 
"FILE-CONTROL.")
-                         in 'environment))
-
-(defun cobol--no-statements-after (re)
-  "Return whether there are any statements between point and the previous
-instance of RE."
-  (cobol--no-instances-of cobol--verb-re
-                         after re
-                         in 'procedure))
-
-(defun cobol--in-proc-div-param-list-p ()
-  "Return whether point is in the procedure division header parameter list."
-  (cobol--no-statements-after cobol--procedure-division-re))
-
-(defun cobol--in-if-eval-when-or-perform-cond-p ()
-  "Return whether point is in the condition of an IF, EVALUATE or WHEN or in
-the clauses of a non-procedural PERFORM."
-  (cobol--no-statements-after (cobol--with-opt-whitespace-line
-                              cobol--phrases-with-double-indent-after)))
-
-(defun cobol--indent-of-last-statement ()
-  "Return the indent of the last statement."
-  (cobol--search-back-for-indent cobol--verb-re))
-
-(defun cobol--indent-of-clauses ()
-  "Return the indentation for a clause at point."
-  (let ((current-division (cobol--get-current-division)))
-    (cond ((eq current-division 'identification)
-           (cobol--indent-from-previous))
-
-          ((eq current-division 'environment)
-           (if (cobol--in-file-control-p)
-               ;; Indent clauses of SELECT.
-               (cobol--indent (cobol--indent-of-last-statement))
-             (cobol--indent-from-previous)))
-
-          ((eq current-division 'data)
-           (- cobol-declaration-clause-indent (cobol--code-start)))
-
-          ((eq current-division 'procedure)
-           (cond ((cobol--in-proc-div-param-list-p)
-                  ;; Indent procedure division parameter list twice.
-                  (cobol--indent (cobol--search-back-for-indent 
cobol--procedure-division-re)
-                                2))
-                ((cobol--in-if-eval-when-or-perform-cond-p)
-                 ;; Indent after IF/EVALUATE/WHEN/non-procedural PEROFRM twice.
-                 (cobol--indent (cobol--search-back-for-indent
-                                cobol--phrases-with-double-indent-after
-                                :with-whitespace t)
-                               2))
-                ;; Indent once after any other statement.
-                (t
-                 (cobol--indent (cobol--indent-of-last-statement))))))))
-
-(defun cobol--looking-at-comment-line ()
-  "Return whether we are looking at a comment line (using `looking-at')."
-  (or (looking-at cobol--free-form-comment-line-re)
-      (when (cobol--fixed-format-p)
-        (looking-at cobol--fixed-form-comment-re))))
-
-(defun cobol--find-indent-of-line ()
-  "Return what the indent of the current line should be."
-  (save-excursion
-    (beginning-of-line)
-    (cond ((looking-at cobol--scope-terminator-re)
-           (let ((matching-statement
-                  (cobol--scope-terminator-statement (thing-at-point 'line))))
-             (cobol--indent-of-open-statement (list matching-statement))))
-
-          ((looking-at cobol--procedure-re)
-           (cobol--indent-of-last-div-or-section))
-
-          ((looking-at cobol--end-marker-re)
-           (cobol--match-line-with-leading-whitespace
-            (concat "END" cobol--identifier-re))
-           (let ((group (match-string 1 (thing-at-point 'line))))
-             (cobol--indent-of-end-marker-match group)))
-
-          ((looking-at cobol--division-re)
-           (cobol--indent-of-last-div))
-
-          ((looking-at cobol--generic-declaration-re)
-           (cobol--indent-of-declaration (thing-at-point 'line)))
-
-          ((looking-at cobol--containing-statement-or-phrase-re)
-           (cobol--indent-of-containing-statement-or-phrase
-            (thing-at-point 'line)))
-
-          ((or (cobol--looking-at-comment-line)
-               (looking-at cobol--verb-re)
-               (looking-at cobol--blank-line-re))
-           (cobol--indent-from-previous))
-
-          (t
-           (cobol--indent-of-clauses)))))
-
-(defun cobol--indent-point-to-col (col)
-  "Indent point to COL."
-  ;; FIXME: Use indent-line-to?
-  (cond ((< (current-column) col)
-         (indent-to col))
-        ((> (current-column) col)
-         (delete-char (- col (current-column))))))
-
-(defun cobol--set-line-indent (indent)
-  "Set the indent of the current line to INDENT."
-  (save-excursion
-    (let ((line-length (- (line-end-position) (line-beginning-position)))
-          (end-of-indent (+ (cobol--code-start) indent)))
-      ;; Following lines derived from source of `back-to-indentation'.
-      (move-to-column (cobol--code-start))
-      (if (>= line-length (cobol--code-start) (current-column))
-          (progn
-            (skip-syntax-forward " " (line-end-position))
-            (backward-prefix-chars))
-        (indent-to (cobol--code-start)))
-
-      (cobol--indent-point-to-col end-of-indent))))
-
-(defun cobol--indent-point ()
-  "Indent point to the next multiple of `cobol-tab-width' (relative to the
-start of area A, if fixed-format)."
-  (cobol--indent-point-to-col
-   (+ (current-column) (- cobol-tab-width
-                          (% (if (cobol--fixed-format-p)
-                                 (1+ (current-column))
-                               (current-column))
-                             cobol-tab-width)))))
-
-(defun cobol-indent-line ()
-  "Indent current line as COBOL code."
-  (interactive "*")
-  (let ((indent (cobol--find-indent-of-line)))
-    (if (not (eq indent (cobol--current-indentation)))
-        (progn
-          (cobol--set-line-indent indent)
-          ;; If in leading whitespace/sequence area, move to first char of 
code.
-          (when (< (point) (+ (line-beginning-position) (cobol--code-start) 
indent))
-            (skip-syntax-forward " " (line-end-position))
-            (backward-prefix-chars)))
-      ;; Move to first non-whitespace char
-      (skip-syntax-forward " " (line-end-position))
-      (backward-prefix-chars)
-      ;; Indent stuff at point if not the first word.
-      (when (< (cobol--current-indentation) (- (current-column) 
(cobol--code-start)))
-        (cobol--indent-point)))))
-
-(defvar cobol-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [remap back-to-indentation] 'cobol-back-to-indentation)
-    ;;(define-key map (kbd "RET") #'newline-and-indent)
-    map))
-
-(defvar cobol-mode-syntax-table
-  (let ((st (make-syntax-table)))
-    (modify-syntax-entry ?-  "w"   st)
-    (modify-syntax-entry ?_  "w"   st)
-    (modify-syntax-entry ?*  ". 1" st)
-    (modify-syntax-entry ?>  "w 2" st)
-    (modify-syntax-entry ?\\ "."   st)
-    (modify-syntax-entry ?'  "\""  st)
-    (modify-syntax-entry ?\" "\""  st)
-    (modify-syntax-entry ?\n ">"   st)
-    st))
-
-(defvar ac-ignore-case)
-
-;;;###autoload
-(define-derived-mode cobol-mode prog-mode "COBOL"
-  "COBOL mode is a major mode for handling COBOL files."
-
-  (set (make-local-variable 'font-lock-defaults) cobol-font-lock-defaults)
-
-  (when cobol-tab-width
-    (set (make-local-variable 'tab-width) cobol-tab-width))
-
-  (set (make-local-variable 'indent-tabs-mode) nil)
-
-  (set (make-local-variable 'comment-start-skip)
-       "\\(^.\\{6\\}\\*\\|\\*>\\)\\s-* *")
-  (set (make-local-variable 'comment-start) "*>")
-  (set (make-local-variable 'comment-end) "")
-
-  (set (make-local-variable 'syntax-propertize-function)
-       #'cobol--syntax-propertize-function)
-
-  (set (make-local-variable 'column-number-mode) t)
-
-  (set (make-local-variable 'indent-line-function) #'cobol-indent-line)
-
-  ;; Auto complete mode
-  (set (make-local-variable 'ac-ignore-case) t)
-  )
-
-(provide 'cobol-mode)
-
-;;; cobol-mode.el ends here
diff --git a/packages/dbus-codegen/dbus-codegen.el 
b/packages/dbus-codegen/dbus-codegen.el
deleted file mode 100644
index 334e20b..0000000
--- a/packages/dbus-codegen/dbus-codegen.el
+++ /dev/null
@@ -1,942 +0,0 @@
-;;; dbus-codegen.el --- Lisp code generation for D-Bus. -*- lexical-binding: 
t; -*-
-
-;; Copyright (C) 2015-2019 Free Software Foundation, Inc.
-
-;; Author: Daiki Ueno <ueno@gnu.org>
-;; Keywords: comm, dbus, convenience
-;; Package-Requires: ((cl-lib "0.5"))
-;; Version: 0.1
-;; Maintainer: emacs-devel@gnu.org
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package provides macros and functions to make D-Bus
-;; client/server implementation easy, inspired by the `gdbus-codegen'
-;; utility in GLib.  To get it work, `lexical-binding' must be
-;; enabled.
-;;
-;; * Client support
-;;
-;; A proxy object representing a D-Bus client can be defined with
-;; either `dbus-codegen-define-proxy' or `dbus-codegen-make-proxy'.
-;;
-;; `dbus-codegen-define-proxy' takes a static XML definition of a
-;; D-Bus service and generates code at compile time.  This is good for
-;; stable D-Bus services.  On the other hand,
-;; `dbus-codegen-make-proxy' uses D-Bus introspection and retrieves a
-;; D-Bus service definition from a running service itself.  This is
-;; good for debugging or for unstable D-Bus services.
-;;
-;; ** Example
-;;
-;; Suppose the following code:
-;;
-;; (dbus-codegen-define-proxy test-proxy
-;;                            "\
-;; <node>
-;;   <interface name='org.example.Test'>
-;;     <method name='OpenFile'>
-;;       <arg type='s' name='path' direction='in'/>
-;;     </method>
-;;     <signal name='Changed'>
-;;       <arg type='s' name='a_string'/>
-;;     </signal>
-;;     <property type='s' name='Content' access='read'/>
-;;   </interface>
-;; </node>"
-;;                            "org.example.Test")
-;;
-;; The `dbus-codegen-define-proxy' macro expands to a definition a
-;; struct `test-proxy' with a slot `content', which corresponds to the
-;; "Content" property.  The slot value will be initialized when the
-;; proxy is created and updated when the server sends a notification.
-;; The proxy can always retrieve the value with the function
-;; `PROXY-retrieve-PROPERTY-property'.
-;;
-;; The macro also defines the following wrapper functions:
-;;
-;; - `test-proxy-create'
-;;   constructor of the proxy
-;; - `test-proxy-destroy'
-;;   destructor of the proxy
-;; - `test-proxy-open-file'
-;;   wrapper around calling the "OpenFile" method
-;; - `test-proxy-open-file-asynchronously'
-;;   asynchronous wrapper around calling the "OpenFile" method
-;; - `test-proxy-send-changed-signal'
-;;   wrapper around sending the "Changed" signal
-;; - `test-proxy-register-changed-signal'
-;;   wrapper around registering a handler for the "Changed" signal
-;; - `test-proxy-retrieve-content-property'
-;;   retrieve the value of the "Content" property
-;;
-;; In addition to those, the macro also defines a generic function
-;; `test-proxy-handle-changed-signal' to allow a class-wide signal
-;; handler definition.
-;;
-;; To register a class-wide signal handler, define a method
-;; `test-proxy-handle-changed-signal' with `cl-defmethod', like this:
-;;
-;; (cl-defmethod test-proxy-handle-changed-signal ((proxy test-proxy) string)
-;;   ... do something with PROXY and STRING ...)
-;;
-;; * Server support
-;;
-;; A skeleton object representing a D-Bus server can be defined with
-;; `dbus-codegen-define-skeleton'.
-;;
-;; `dbus-codegen-define-skeleton' takes a static XML definition of a
-;; D-Bus service and generates code at compile time.
-;;
-;; ** Example
-;;
-;; Suppose the following code:
-;;
-;; (dbus-codegen-define-skeleton test-skeleton
-;;                            "\
-;; <node>
-;;   <interface name='org.example.Test'>
-;;     <method name='OpenFile'>
-;;       <arg type='s' name='path' direction='in'/>
-;;     </method>
-;;     <signal name='Changed'>
-;;       <arg type='s' name='a_string'/>
-;;     </signal>
-;;     <property type='s' name='Content' access='read'/>
-;;   </interface>
-;; </node>"
-;;                            "org.example.Test")
-;;
-;; The `dbus-codegen-define-skeleton' macro expands to a definition a
-;; struct `test-skeleton' with a slot `content', which corresponds to the
-;; "Content" property.
-;;
-;; The macro also defines the following wrapper functions:
-;;
-;; - `test-skeleton-create'
-;;   constructor of the skeleton
-;; - `test-skeleton-destroy'
-;;   destructor of the skeleton
-;; - `test-skeleton-register-open-file-method'
-;;   wrapper around registering a handler for the "OpenFile" method
-;; - `test-skeleton-send-changed-signal'
-;;   wrapper around sending the "Changed" signal
-;; - `test-skeleton-register-changed-signal'
-;;   wrapper around registering a handler for the "Changed" signal
-;; - `test-skeleton-register-content-property'
-;;   wrapper around registering a value of the "Content" property
-;;
-;; In addition to those, the macro also defines a generic function
-;; `test-skeleton-handle-open-file-method' to allow a class-wide method
-;; handler definition.
-;;
-;; To register a class-wide method handler, define a method
-;; `test-skeleton-handle-open-file-method' with `cl-defmethod', like this:
-;;
-;; (cl-defmethod test-skeleton-handle-open-file-method ((skeleton 
test-skeleton)
-;;                                                      string)
-;;   ... do something with SKELETON and STRING ...)
-;;
-;; * TODO
-;;
-;; - function documentation generation from annotations
-
-;;; Code:
-
-(require 'dbus)
-(require 'cl-lib)
-
-(eval-when-compile
-  (require 'xml)
-  (require 'subword))
-
-;; Base type of a D-Bus proxy and a skeleton.
-(cl-defstruct (dbus-codegen-object
-              (:constructor nil))
-  (bus nil :read-only t)
-  (service nil :read-only t)
-  (path nil :read-only t)
-  (interface nil :read-only t)
-  registration-list)
-
-;; Base type of a D-Bus proxy.
-(cl-defstruct (dbus-codegen-proxy
-              (:include dbus-codegen-object)
-              (:constructor nil)))
-
-;; Base type of a D-Bus skeleton
-(cl-defstruct (dbus-codegen-skeleton
-              (:include dbus-codegen-object)
-              (:constructor nil)))
-
-;; Return a list of elements in the form: (LISP-NAME ORIG-NAME MEMBER).
-(defun dbus-codegen--apply-transform-name (elements transform-name)
-  (mapcar (lambda (elements)
-           (let ((name (xml-get-attribute-or-nil elements 'name)))
-               (unless name
-                 (error "missing \"name\" attribute of %s"
-                        (xml-node-name elements)))
-               (list (funcall transform-name name)
-                     name
-                     elements)))
-         elements))
-
-;; Return a list of symbols.
-(defun dbus-codegen--collect-arglist (args transform-name)
-  (delq nil
-       (mapcar
-        (lambda (arg)
-          (let ((direction
-                 (xml-get-attribute-or-nil (nth 2 arg) 'direction)))
-            (if (or (null direction)
-                    (equal direction "in"))
-                (intern (car arg)))))
-        (dbus-codegen--apply-transform-name args transform-name))))
-
-(defconst dbus-codegen--basic-type-to-symbol-alist
-  '((?y . :byte)
-    (?b . :boolean)
-    (?n . :int16)
-    (?q . :uint16)
-    (?i . :int32)
-    (?u . :uint32)
-    (?x . :int64)
-    (?t . :uint64)
-    (?d . :double)
-    (?s . :string)
-    (?o . :object-path)
-    (?g . :signature))
-  "Mapping from D-Bus type-codes to Lisp symbols.")
-
-;; Read a single type from SIGNATURE.  Returns a cons cell of
-;; (NEXT-OFFSET . TYPE).
-(defun dbus-codegen--read-signature (signature offset)
-  (let* ((c (aref signature offset))
-        (entry (assq c dbus-codegen--basic-type-to-symbol-alist)))
-    (if entry
-       (cons (1+ offset) (cdr entry))
-      (pcase c
-       (?{
-        (let* ((type1 (dbus-codegen--read-signature signature (1+ offset)))
-               (type2 (dbus-codegen--read-signature signature (car type1))))
-          (unless (eq (aref signature (car type2)) ?})
-            (error "Unterminated dict-entry"))
-          (cons (car type2) (list :dict-entry (cdr type1) (cdr type2)))))
-       (?\(
-        (let ((next-offset (1+ offset))
-              types
-              type)
-          (while (and (< next-offset (length signature))
-                      (not (eq (setq c (aref signature next-offset)) ?\))))
-            (setq type (dbus-codegen--read-signature signature next-offset)
-                  next-offset (car type))
-            (push (cdr type) types))
-          (unless (eq (aref signature (car type)) ?\))
-            (error "Unterminated struct"))
-          (cons next-offset (list :struct (nreverse types)))))
-       (?a
-        (unless (< (1+ offset) (length signature))
-          (error "Unterminated array"))
-        (let ((type (dbus-codegen--read-signature signature (1+ offset))))
-          (cons (car type) (list :array (cdr type)))))
-       (?v
-        (cons (1+ offset) (list :variant)))))))
-
-(defun dbus-codegen--byte-p (value)
-  (and (integerp value)
-       (<= 0 value #xFF)))
-
-(defun dbus-codegen--int16-p (value)
-  (and (integerp value)
-       (<= (- (- #x7FFF) 1) value #x7FFF)))
-
-(defun dbus-codegen--uint16-p (value)
-  (and (integerp value)
-       (<= 0 value #xFFFF)))
-
-(defun dbus-codegen--object-path-p (value)
-  (and (stringp value)
-       (string-match "\\`/\\'\\|\\`\\(?:/\\(?:[A-Za-z0-9_]+\\)\\)+\\'" value)))
-
-(defconst dbus-codegen--basic-type-check-alist
-  '((:byte . dbus-codegen--byte-p)
-    (:boolean . booleanp)
-    (:int16 . dbus-codegen--int16-p)
-    (:uint16 . dbus-codegen--uint16-p)
-    (:int32 . integerp)
-    (:uint32 . natnump)
-    (:int64 . integerp)
-    (:uint64 . natnump)
-    (:double . floatp)
-    (:string . stringp)
-    (:object-path . dbus-codegen--object-path-p)
-    (:signature . stringp)
-    (:unix-fd . natnump))
-  "An alist mapping from Lisp symbols to predicates that check value types.")
-
-(defun dbus-codegen--annotate-arg (type arg)
-  (pcase type
-    ((and basic (or :byte :boolean :int16 :uint16 :int32 :uint32 :int64 :uint64
-                   :double :string :object-path :signature :unix-fd))
-     (let ((entry (assq basic dbus-codegen--basic-type-check-alist)))
-       (when (and entry
-                 (not (funcall (cdr entry) arg)))
-        (signal 'wrong-type-argument (list (cdr entry) arg))))
-     (list basic arg))
-    (`(:array ,elttype)
-     ;; FIXME: an empty array must have a `:signature' element to
-     ;; denote the element type.
-     (list (cons :array
-                (apply #'nconc
-                       (mapcar (lambda (subarg)
-                                 (dbus-codegen--annotate-arg elttype subarg))
-                               arg)))))
-    (`(:struct . ,memtypes)
-     (list (cons :struct (apply #'nconc
-                               (cl-mapcar
-                                (lambda (memtype subarg)
-                                  (dbus-codegen--annotate-arg memtype subarg))
-                                memtypes arg)))))
-    (`(:variant)
-     (list (cons :variant (apply #'nconc
-                                (mapcar (lambda (subarg) (list subarg))
-                                        arg)))))
-    (`(:dict-entry ,keytype ,valtype)
-     (list (cons :dict-entry
-                (nconc (dbus-codegen--annotate-arg keytype (car arg))
-                       (dbus-codegen--annotate-arg valtype (cdr arg))))))
-    (_ (error "Unknown type specification: %S" type))))
-
-(defun dbus-codegen--collect-arglist-with-type-annotation (args transform-name)
-  (delq nil (mapcar
-            (lambda (arg)
-              (let ((direction
-                     (xml-get-attribute-or-nil (nth 2 arg) 'direction))
-                    (type
-                     (xml-get-attribute-or-nil (nth 2 arg) 'type)))
-                (if (or (null direction)
-                        (equal direction "in"))
-                    (let ((signature (dbus-codegen--read-signature type 0)))
-                      `(dbus-codegen--annotate-arg ,(cdr signature)
-                                                   ,(intern (car arg)))))))
-            (dbus-codegen--apply-transform-name args transform-name))))
-
-(declare-function subword-forward "subword.el" (&optional arg))
-(defun dbus-codegen-transform-name (name)
-  "Transform NAME into suitable Lisp function name."
-  (require 'subword)
-  (with-temp-buffer
-    (let (words)
-      (insert name)
-      (goto-char (point-min))
-      (while (not (eobp))
-       ;; Skip characters not recognized by subword-mode.
-       (if (looking-at "[^[:lower:][:upper:][:digit:]]+")
-           (goto-char (match-end 0)))
-       (push (downcase (buffer-substring (point) (progn (subword-forward 1)
-                                                        (point))))
-             words))
-      (mapconcat #'identity (nreverse words) "-"))))
-
-;; Emit wrappers around `dbus-call-method'.
-(defun dbus-codegen--emit-call-method (name methods transform-name)
-  (apply
-   #'nconc
-   (mapcar
-    (lambda (method)
-      (let ((arglist (dbus-codegen--collect-arglist
-                     (xml-get-children
-                      (car (xml-get-children method 'method))
-                      'arg)
-                     transform-name))
-           (annotated-arglist
-            (dbus-codegen--collect-arglist-with-type-annotation
-             (xml-get-children
-              (car (xml-get-children method 'method)) 'arg)
-             transform-name)))
-       `((cl-defgeneric
-             ,(intern (format "%s-%s" name (car method)))
-             (object ,@arglist &rest args)
-           ,(format "Call the \"%s\" method of OBJECT."
-                    (nth 1 method)))
-         (cl-defmethod
-             ,(intern (format "%s-%s" name (car method)))
-             ((object ,name) ,@arglist &rest args)
-           (apply #'dbus-call-method
-                  (,(intern (format "%s-bus" name )) object)
-                  (,(intern (format "%s-service" name)) object)
-                  (,(intern (format "%s-path" name)) object)
-                  (,(intern (format "%s-interface" name)) object)
-                  ,(nth 1 method)
-                  (append ,@annotated-arglist args))))))
-    methods)))
-
-;; Emit wrappers around `dbus-call-method-asynchronously'.
-(defun dbus-codegen--emit-call-method-asynchronously (name methods
-                                                          transform-name)
-  (apply
-   #'nconc
-   (mapcar
-    (lambda (method)
-      (let ((arglist (dbus-codegen--collect-arglist
-                     (xml-get-children
-                      (car (xml-get-children method 'method))
-                      'arg)
-                     transform-name))
-           (annotated-arglist
-            (dbus-codegen--collect-arglist-with-type-annotation
-             (xml-get-children
-              (car (xml-get-children method 'method))
-              'arg)
-             transform-name)))
-       `((cl-defgeneric
-             ,(intern (format "%s-%s-asynchronously"
-                              name (car method)))
-             ((object ,name) ,@arglist handler &rest args)
-           ,(format "Asynchronously call the \"%s\" method of OBJECT."
-                    (nth 1 method)))
-         (cl-defmethod
-             ,(intern (format "%s-%s-asynchronously"
-                              name (car method)))
-             ((object ,name) ,@arglist handler &rest args)
-         (apply #'dbus-call-method-asynchronously
-                (,(intern (format "%s-bus" name )) object)
-                (,(intern (format "%s-service" name)) object)
-                (,(intern (format "%s-path" name)) object)
-                (,(intern (format "%s-interface" name)) object)
-                ,(nth 1 method)
-                handler
-                (append ,@annotated-arglist args))))))
-   methods)))
-
-;; Emit wrappers around `dbus-register-signal'.
-(defun dbus-codegen--emit-register-signal (name signals)
-  (apply
-   #'nconc
-   (mapcar
-    (lambda (signal)
-      `((cl-defgeneric
-           ,(intern (format "%s-register-%s-signal" name (car signal)))
-           (object handler &rest args)
-         ,(format "Register HANDLER to the \"%s\" signal of OBJECT."
-                  (nth 1 signal)))
-       (cl-defmethod
-           ,(intern (format "%s-register-%s-signal" name (car signal)))
-           ((object ,name) handler &rest args)
-         (push (apply #'dbus-register-signal
-                    (,(intern (format "%s-bus" name )) object)
-                    (,(intern (format "%s-service" name)) object)
-                    (,(intern (format "%s-path" name)) object)
-                    (,(intern (format "%s-interface" name)) object)
-                    ,(nth 1 signal)
-                    (lambda (&rest args)
-                      (apply handler object args))
-                    args)
-             (,(intern (format "%s-registration-list" name)) object)))))
-    signals)))
-
-;; Emit wrappers around `dbus-send-signal'.
-(defun dbus-codegen--emit-send-signal (name signals transform-name)
-  (apply
-   #'nconc
-   (mapcar
-    (lambda (signal)
-      (let ((arglist (dbus-codegen--collect-arglist
-                     (xml-get-children
-                      (car (xml-get-children signal 'signal))
-                      'arg)
-                     transform-name))
-           (annotated-arglist
-            (dbus-codegen--collect-arglist-with-type-annotation
-             (xml-get-children
-              (car (xml-get-children signal 'signal))
-              'arg)
-             transform-name)))
-       `((cl-defgeneric
-             ,(intern (format "%s-send-%s-signal"
-                              name (car signal)))
-             (object ,@arglist &rest args)
-           ,(format "Send the \"%s\" signal of OBJECT."
-                    (nth 1 signal)))
-         (cl-defmethod
-             ,(intern (format "%s-send-%s-signal"
-                              name (car signal)))
-             ((object ,name) ,@arglist &rest args)
-           (apply #'dbus-send-signal
-                  (,(intern (format "%s-bus" name )) object)
-                  (,(intern (format "%s-service" name)) object)
-                  (,(intern (format "%s-path" name)) object)
-                  (,(intern (format "%s-interface" name)) object)
-                  ,(nth 1 signal)
-                  (append ,@annotated-arglist args))))))
-    signals)))
-
-;; Emit generic functions for signal handlers.
-(defun dbus-codegen--emit-signal-defgeneric (name signals transform-name)
-  (mapcar
-   (lambda (signal)
-     (let ((arglist (dbus-codegen--collect-arglist
-                    (xml-get-children
-                     (car (xml-get-children signal 'signal))
-                     'arg)
-                    transform-name)))
-       `(cl-defgeneric
-           ,(intern (format "%s-handle-%s-signal" name (car signal)))
-           (object ,@arglist)
-         ,(format "Generic function called upon receiving the \"%s\" signal."
-                  (nth 1 signal))
-         (list object ,@arglist)
-         nil)))
-   signals))
-
-;; Emit wrappers around `dbus-get-property'.
-(defun dbus-codegen--emit-retrieve-property (name properties)
-  (apply
-   #'nconc
-   (mapcar
-    (lambda (property)
-      `((cl-defgeneric
-           ,(intern (format "%s-retrieve-%s-property"
-                            name (car property)))
-           (object)
-         ,(format "Retrieve the value of the \"%s\" property of OBJECT."
-                  (nth 1 property)))
-       (cl-defmethod
-           ,(intern (format "%s-retrieve-%s-property"
-                            name (car property)))
-           ((object ,name))
-         (setf (,(intern (format "%s-%s" name (car property)))
-                object)
-               (dbus-get-property
-                (,(intern (format "%s-bus" name )) object)
-                (,(intern (format "%s-service" name)) object)
-                (,(intern (format "%s-path" name)) object)
-                (,(intern (format "%s-interface" name)) object)
-                ,(nth 1 property))))))
-    properties)))
-
-;; Emit generic functions for method handlers.
-(defun dbus-codegen--emit-method-defgeneric (name methods transform-name)
-  (mapcar
-   (lambda (method)
-     (let ((arglist (dbus-codegen--collect-arglist
-                    (xml-get-children
-                     (car (xml-get-children method 'method))
-                     'arg)
-                    transform-name)))
-     `(cl-defgeneric
-         ,(intern (format "%s-handle-%s-method" name (car method)))
-         (object ,@arglist)
-       ,(format "Generic function called when the \"%s\" method is called."
-                (nth 1 method))
-       (list object ,@arglist)
-       nil)))
-   methods))
-
-;; Emit wrappers around `dbus-register-method'.
-(defun dbus-codegen--emit-register-method (name methods)
-  (apply
-   #'nconc
-   (mapcar
-    (lambda (method)
-      `((cl-defgeneric
-           ,(intern (format "%s-register-%s-method" name (car method)))
-           (object handler &rest args)
-         ,(format "Register HANDLER to the \"%s\" method of OBJECT."
-                  (nth 1 method)))
-       (cl-defmethod
-           ,(intern (format "%s-register-%s-method" name (car method)))
-           ((object ,name) handler &rest args)
-         (push (apply #'dbus-register-method
-                      (,(intern (format "%s-bus" name )) object)
-                      (,(intern (format "%s-service" name)) object)
-                      (,(intern (format "%s-path" name)) object)
-                      (,(intern (format "%s-interface" name)) object)
-                      ,(nth 1 method)
-                      (lambda (&rest args)
-                        (apply handler object args))
-                      args)
-               (,(intern (format "%s-registration-list" name)) object)))))
-    methods)))
-
-;; Emit wrappers around `dbus-register-property'.
-(defun dbus-codegen--emit-register-property (name properties)
-  (apply
-   #'nconc
-   (mapcar
-    (lambda (property)
-      (let* ((annotations
-             (delq nil
-                  (mapcar
-                   (lambda (annotation)
-                     (if (equal
-                          (xml-get-attribute-or-nil annotation 'name)
-                          "org.freedesktop.DBus.Property.EmitsChangedSignal")
-                         annotation))
-                   (xml-get-children (nth 2 property) 'annotation))))
-           (emits-signal
-            (or (null annotations)
-                (not (equal (xml-get-attribute-or-nil (car annotations)
-                                                      'value)
-                            "false")))))
-       `((cl-defgeneric
-             ,(intern (format "%s-register-%s-property" name (car property)))
-             (object value &rest args)
-           ,(format "Register VALUE of the \"%s\" property of OBJECT."
-                    (nth 1 property)))
-         (cl-defmethod
-             ,(intern (format "%s-register-%s-property" name (car property)))
-             ((object ,name) value &rest args)
-           (setf (,(intern (format "%s-%s" name (car property))) object) value)
-           (push (apply #'dbus-register-property
-                        (,(intern (format "%s-bus" name )) object)
-                        (,(intern (format "%s-service" name)) object)
-                        (,(intern (format "%s-path" name)) object)
-                        (,(intern (format "%s-interface" name)) object)
-                        ,(nth 1 property)
-                        value
-                        ,@(if emits-signal
-                              (list :emits-signal t))
-                        args)
-                 (,(intern (format "%s-registration-list" name)) object))))))
-    properties)))
-
-;;;###autoload
-(defmacro dbus-codegen-define-proxy (name xml interface &rest args)
-  "Define a new D-Bus proxy NAME.
-This defines a new struct type for the proxy and convenient
-functions for D-Bus method calls and signal registration.
-
-XML is either a string which defines the interface of the D-Bus
-proxy, or a Lisp form which returns a string.  The format of the
-string must comply with the standard D-Bus introspection data
-format as described in:
-`http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format'.
-
-INTERFACE is a name of interface which is represented by this
-proxy.
-
-ARGS are keyword-value pair.  Currently only one keyword is
-supported:
-
-:transform-name FUNCTION -- FUNCTION is a function which converts
-D-Bus method/signal/property names, into another representation.
-By default `dbus-codegen-transform-name' is used."
-  ;; FIXME: A lot of redundancy with dbus-codegen-define-skeleton.
-  (unless (symbolp name)
-    (signal 'wrong-type-argument (list 'symbolp name)))
-  ;; Accept a Lisp form as well as a string.
-  (unless (stringp xml)
-    (setq xml (eval xml)))
-  (unless (stringp xml)
-    (signal 'wrong-type-argument (list 'stringp xml)))
-  (let ((node (car (with-temp-buffer
-                    (insert xml)
-                    (xml-parse-region (point-min) (point-max)))))
-       (transform-name (or (plist-get args :transform-name)
-                           #'dbus-codegen-transform-name)))
-    (unless (eq (xml-node-name node) 'node)
-      (error "Root is not \"node\""))
-    ;; Accept a quoted form of a function, such as #'func.
-    (unless (functionp transform-name)
-      (setq transform-name (eval transform-name)))
-    (let ((interface-node
-          (cl-find-if (lambda (element)
-                        (equal (xml-get-attribute-or-nil element 'name)
-                               interface))
-                      (xml-get-children node 'interface))))
-      (unless interface-node
-       (error "Interface %s is missing" interface))
-      (let ((methods (dbus-codegen--apply-transform-name
-                     (xml-get-children interface-node 'method)
-                     transform-name))
-           (properties (dbus-codegen--apply-transform-name
-                        (xml-get-children interface-node 'property)
-                        transform-name))
-           (signals (dbus-codegen--apply-transform-name
-                     (xml-get-children interface-node 'signal)
-                     transform-name)))
-       `(progn
-          ;; Define a new struct.
-          (cl-defstruct (,name (:include dbus-codegen-proxy)
-                               (:constructor nil)
-                               (:constructor ,(intern (format "%s--make" name))
-                                             (bus service path interface)))
-            ;; Slots for cached property values.
-            ,@(mapcar
-               (lambda (property)
-                 (intern (car property)))
-               properties))
-
-          ;; Define a constructor.
-          (defun ,(intern (format "%s-create" name)) (bus service path)
-            ,(format "Create a new D-Bus proxy for %s.
-
-BUS is either a Lisp symbol, `:system' or `:session', or a string
-denoting the bus address.
-
-SERVICE is the D-Bus service name to be used.  PATH is the D-Bus
-object path SERVICE is registered at.  INTERFACE is an interface
-offered by SERVICE."
-                 interface)
-            (let ((proxy (,(intern (format "%s--make" name))
-                          bus service path ,interface)))
-              ,(when properties
-                 ;; Initialize slots.
-                 `(let ((properties (dbus-get-all-properties bus service path
-                                                             ,interface)))
-                    ,@(mapcar
-                       (lambda (property)
-                         `(setf (,(intern (format "%s-%s" name (car property)))
-                                 proxy)
-                                (cdr (assoc ,(nth 1 property) properties))))
-                       properties)
-                    (push (dbus-register-signal
-                           bus service path dbus-interface-properties
-                           "PropertiesChanged"
-                           (lambda (interface changed invalidated)
-                             (,(intern (format "%s--handle-properties-changed"
-                                               name))
-                              proxy
-                              interface changed invalidated))
-                           :arg0 ,interface)
-                          (,(intern (format "%s-registration-list" name))
-                           proxy))))
-              ;; Register signal handlers.
-              ,@(mapcar
-                 (lambda (signal)
-                   `(push (dbus-register-signal
-                           bus service path ,interface
-                           ,(nth 1 signal)
-                           (lambda (&rest args)
-                             (apply #',(intern (format "%s-handle-%s-signal"
-                                                       name (car signal)))
-                                    proxy args)))
-                          (,(intern (format "%s-registration-list" name))
-                           proxy)))
-                 signals)
-              proxy))
-
-          ,(when properties
-             ;; Define a handler of PropertiesChanged signal.
-             `(defun ,(intern (format "%s--handle-properties-changed" name))
-                  (proxy interface changed invalidated)
-                (when (equal interface ,interface)
-                  ,@(mapcar
-                     (lambda (property)
-                       `(let ((changed-value
-                               (cdr (assoc ,(nth 1 property) changed)))
-                              (invalidated-property
-                               (car (member ,(nth 1 property) invalidated)))
-                              invalidated-value)
-                          (when changed-value
-                            (setf (,(intern (format "%s-%s"
-                                                    name (car property)))
-                                   proxy)
-                                  (car (car changed-value))))
-                          (when invalidated-property
-                            (setq invalidated-value
-                                  (dbus-get-property
-                                   (,(intern (format "%s-bus" name)) proxy)
-                                   (,(intern (format "%s-service" name)) proxy)
-                                   (,(intern (format "%s-path" name)) proxy)
-                                   ,interface
-                                   ,(car property)))
-                            (when invalidated-value
-                              (setf (,(intern (format "%s-%s"
-                                                      name (car property)))
-                                     proxy)
-                                    invalidated-value)))))
-                     properties))))
-
-          ;; Define a destructor.
-          (cl-defgeneric ,(intern (format "%s-destroy" name)) (proxy)
-            "Destroy a D-Bus proxy PROXY.")
-
-          (cl-defmethod ,(intern (format "%s-destroy" name)) ((proxy ,name))
-            (dolist (registration (,(intern (format "%s-registration-list"
-                                                    name))
-                                   proxy))
-              (dbus-unregister-object registration))
-            (setf (,(intern (format "%s-registration-list" name)) proxy) nil))
-
-          ;; Emit common helper functions.
-          ,@(dbus-codegen--emit-signal-defgeneric name signals transform-name)
-          ,@(dbus-codegen--emit-send-signal name signals transform-name)
-          ,@(dbus-codegen--emit-register-signal name signals)
-          ;; Emit helper functions for proxy.
-          ,@(dbus-codegen--emit-call-method name methods transform-name)
-          ,@(dbus-codegen--emit-call-method-asynchronously name methods
-                                                           transform-name)
-          ,@(dbus-codegen--emit-retrieve-property name properties))))))
-
-;;;###autoload
-(defun dbus-codegen-make-proxy (name bus service path interface &rest args)
-  "Create a new D-Bus proxy based on the introspection data.
-
-If the data type of the D-Bus proxy is not yet defined, this will
-define it with `dbus-codegen-define-proxy', under a type name NAME.
-
-BUS is either a Lisp symbol, `:system' or `:session', or a string
-denoting the bus address.
-
-SERVICE is the D-Bus service name to be used.  PATH is the D-Bus
-object path SERVICE is registered at.  INTERFACE is an interface
-offered by SERVICE.
-
-INTERFACE is an interface which is represented by this proxy.
-
-ARGS are keyword-value pair.  Currently only one keyword is
-supported:
-
-:redefine FLAG -- if FLAG is non-nil, redefine the data type and
-associated functions.
-
-Other keywords are same as `dbus-codegen-define-proxy'."
-  (require 'xml)
-  (require 'subword)
-  (let ((constructor (intern (format "%s--make" name))))
-    (if (or (plist-get args :redefine)
-           (not (fboundp constructor)))
-       (eval `(dbus-codegen-define-proxy ,name
-                ,(dbus-introspect bus service path)
-                ,interface
-                ,@args)))
-    (funcall constructor bus service path)))
-
-(defmacro dbus-codegen-define-skeleton (name xml interface &rest args)
-  "Define a new D-Bus skeleton NAME.
-This defines a new struct type for the skeleton and convenient
-functions for D-Bus method calls and signal registration.
-
-XML is either a string which defines the interface of the D-Bus
-skeleton, or a Lisp form which returns a string.  The format of the
-string must comply with the standard D-Bus introspection data
-format as described in:
-`http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format'.
-
-INTERFACE is a name of interface which is represented by this
-skeleton.
-
-ARGS are keyword-value pair.  Currently only one keyword is
-supported:
-
-:transform-name FUNCTION -- FUNCTION is a function which converts
-D-Bus method/signal/property names, into another representation.
-By default `dbus-codegen-transform-name' is used."
-  ;; FIXME: A lot of redundancy with dbus-codegen-define-proxy.
-  (unless (symbolp name)
-    (signal 'wrong-type-argument (list 'symbolp name)))
-  ;; Accept a Lisp form as well as a string.
-  (unless (stringp xml)
-    (setq xml (eval xml)))
-  (unless (stringp xml)
-    (signal 'wrong-type-argument (list 'stringp xml)))
-  (let ((node (car (with-temp-buffer
-                    (insert xml)
-                    (xml-parse-region (point-min) (point-max)))))
-       (transform-name (or (plist-get args :transform-name)
-                           #'dbus-codegen-transform-name)))
-    (unless (eq (xml-node-name node) 'node)
-      (error "Root is not \"node\""))
-    ;; Accept a quoted form of a function, such as #'func.
-    (unless (functionp transform-name)
-      (setq transform-name (eval transform-name)))
-    (let ((interface-node
-          (cl-find-if (lambda (element)
-                        (equal (xml-get-attribute-or-nil element 'name)
-                               interface))
-                      (xml-get-children node 'interface))))
-      (unless interface-node
-       (error "Interface %s is missing" interface))
-      (let ((methods (dbus-codegen--apply-transform-name
-                     (xml-get-children interface-node 'method)
-                     transform-name))
-           (properties (dbus-codegen--apply-transform-name
-                        (xml-get-children interface-node 'property)
-                        transform-name))
-           (signals (dbus-codegen--apply-transform-name
-                     (xml-get-children interface-node 'signal)
-                     transform-name)))
-       `(progn
-          ;; Define a new struct.
-          (cl-defstruct (,name (:include dbus-codegen-skeleton)
-                               (:constructor nil)
-                               (:constructor ,(intern (format "%s--make" name))
-                                             (bus service path interface)))
-            ;; Slots for cached property values.
-            ,@(mapcar
-               (lambda (property)
-                 (intern (car property)))
-               properties))
-
-          ;; Define a constructor.
-          (defun ,(intern (format "%s-create" name))
-              (bus service path &rest args)
-            ,(format "Create a new D-Bus skeleton for %s.
-
-BUS is either a Lisp symbol, `:system' or `:session', or a string
-denoting the bus address.
-
-SERVICE is the D-Bus service name to be used.  PATH is the D-Bus
-object path SERVICE is registered at.  INTERFACE is an interface
-offered by SERVICE."
-                 interface)
-            (let ((skeleton (,(intern (format "%s--make" name))
-                             bus service path ,interface)))
-              (apply #'dbus-register-service bus service args)
-              ;; Register method handlers.
-              ,@(mapcar
-                 (lambda (method)
-                   `(push (dbus-register-method
-                           bus service path ,interface
-                           ,(nth 1 method)
-                           (lambda (&rest args)
-                             (apply #',(intern (format "%s-handle-%s-method"
-                                                       name (car method)))
-                                    skeleton args)))
-                          (,(intern (format "%s-registration-list" name))
-                           skeleton)))
-                 methods)
-              skeleton))
-
-          ;; Define a destructor.
-          (cl-defgeneric ,(intern (format "%s-destroy" name)) (skeleton)
-            "Destroy a D-Bus skeleton SKELETON.")
-
-          (cl-defmethod ,(intern (format "%s-destroy" name)) ((skeleton ,name))
-            (dolist (registration (,(intern (format "%s-registration-list"
-                                                    name))
-                                   skeleton))
-              (dbus-unregister-object registration))
-            (setf (,(intern (format "%s-registration-list" name)) skeleton)
-                  nil)
-            (dbus-unregister-service bus service))
-
-          ;; Emit common helper functions.
-          ,@(dbus-codegen--emit-signal-defgeneric name signals transform-name)
-          ,@(dbus-codegen--emit-send-signal name signals transform-name)
-          ,@(dbus-codegen--emit-register-signal name signals)
-          ;; Emit helper functions for skeleton.
-          ,@(dbus-codegen--emit-method-defgeneric name methods transform-name)
-          ,@(dbus-codegen--emit-register-method name methods)
-          ,@(dbus-codegen--emit-register-property name properties))))))
-
-(provide 'dbus-codegen)
-
-;;; dbus-codegen.el ends here
diff --git a/packages/dbus-codegen/tests/dbus-codegen-tests.el 
b/packages/dbus-codegen/tests/dbus-codegen-tests.el
deleted file mode 100644
index 6184c46..0000000
--- a/packages/dbus-codegen/tests/dbus-codegen-tests.el
+++ /dev/null
@@ -1,130 +0,0 @@
-;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;; Code:
-
-(require 'ert)
-(require 'dbus-codegen)
-
-(ert-deftest dbus-codegen--read-signature ()
-  (should (equal '(1 . :int32) (dbus-codegen--read-signature "i" 0)))
-  (should-error (dbus-codegen--read-signature "a" 0))
-  (should (equal '(2 :array :int32) (dbus-codegen--read-signature "ai" 0)))
-  (should (equal '(4 :array (:dict-entry :string :int32))
-                (dbus-codegen--read-signature "a{si}" 0)))
-  (should (equal '(4 :array (:dict-entry :string (:variant)))
-                (dbus-codegen--read-signature "a{sv}" 0)))
-  (should-error (dbus-codegen--read-signature "a{sii}" 0))
-  (should (equal '(5 :array (:struct (:string :int32 :int32)))
-                (dbus-codegen--read-signature "a(sii)" 0))))
-
-(ert-deftest dbus-codegen--object-path-p ()
-  (should (dbus-codegen--object-path-p "/"))
-  (should (not (dbus-codegen--object-path-p "//")))
-  (should (not (dbus-codegen--object-path-p "/a/")))
-  (should (dbus-codegen--object-path-p "/a/b"))
-  (should (not (dbus-codegen--object-path-p "/a!")))
-  (should (dbus-codegen--object-path-p "/a")))
-
-(ert-deftest dbus-codegen--annotate-arg ()
-  (should (equal '(:int32 1)
-                (dbus-codegen--annotate-arg ':int32 1)))
-  (should-error (dbus-codegen--annotate-arg '(:array :int32) 1))
-  (should (equal '((:array :int32 1 :int32 2 :int32 3))
-                (dbus-codegen--annotate-arg '(:array :int32) '(1 2 3))))
-  ;; Type mismatch of the first element of a struct.
-  (should-error (dbus-codegen--annotate-arg '(:struct :string :int32 :int32)
-                                           '(1 2 3)))
-  (should (equal '((:array (:dict-entry :string "a" :int32 1)
-                          (:dict-entry :string "b" :int32 2)
-                          (:dict-entry :string "c" :int32 3)))
-                (dbus-codegen--annotate-arg
-                 '(:array (:dict-entry :string :int32))
-                 '(("a" . 1) ("b" . 2) ("c" . 3))))))
-
-(eval-when-compile
-  (defconst dbus-codegen-tests-introspection-data "\
-<node>
-  <interface name='org.gtk.GDBus.PeerTestInterface'>
-    <method name='HelloPeer'>
-      <arg type='s' name='greeting' direction='in'/>
-      <arg type='s' name='response' direction='out'/>
-    </method>
-    <method name='EmitSignal'/>
-    <method name='EmitSignalWithNameSet'/>
-    <method name='OpenFile'>
-      <arg type='s' name='path' direction='in'/>
-    </method>
-    <signal name='PeerSignal'>
-      <arg type='s' name='a_string'/>
-    </signal>
-    <property type='s' name='PeerProperty' access='read'/>
-    <property type='s' name='PeerPropertyAnnotated' access='read'>
-      <annotation name='org.freedesktop.DBus.Property.EmitsChangedSignal'
-                  value='false'/>
-    </property>
-  </interface>
-</node>"))
-
-(ert-deftest dbus-codegen-define-proxy ()
-  (dbus-codegen-define-proxy test-proxy
-                            dbus-codegen-tests-introspection-data
-                            "org.gtk.GDBus.PeerTestInterface")
-  (should (fboundp 'test-proxy-create))
-  (should (fboundp 'test-proxy-destroy))
-  (should (fboundp 'test-proxy-hello-peer))
-  (should (fboundp 'test-proxy-hello-peer-asynchronously))
-  (should (fboundp 'test-proxy-emit-signal))
-  (should (fboundp 'test-proxy-emit-signal-asynchronously))
-  (should (fboundp 'test-proxy-emit-signal-with-name-set))
-  (should (fboundp 'test-proxy-emit-signal-with-name-set-asynchronously))
-  (should (fboundp 'test-proxy-open-file))
-  (should (fboundp 'test-proxy-open-file-asynchronously))
-  (should (fboundp 'test-proxy-register-peer-signal-signal))
-  (should (fboundp 'test-proxy-send-peer-signal-signal))
-  (should (fboundp 'test-proxy-handle-peer-signal-signal))
-  (should (fboundp 'test-proxy-peer-property))
-  (should (fboundp 'test-proxy-retrieve-peer-property-property))
-  (should (fboundp 'test-proxy-peer-property-annotated))
-  (should (fboundp 'test-proxy-retrieve-peer-property-annotated-property)))
-
-(ert-deftest dbus-codegen-define-skeleton ()
-  (dbus-codegen-define-skeleton test-skeleton
-                               dbus-codegen-tests-introspection-data
-                               "org.gtk.GDBus.PeerTestInterface")
-  (should (fboundp 'test-skeleton-create))
-  (should (fboundp 'test-skeleton-destroy))
-  (should (fboundp 'test-skeleton-register-hello-peer-method))
-  (should (fboundp 'test-skeleton-handle-hello-peer-method))
-  (should (fboundp 'test-skeleton-register-emit-signal-method))
-  (should (fboundp 'test-skeleton-handle-emit-signal-method))
-  (should (fboundp 'test-skeleton-register-emit-signal-with-name-set-method))
-  (should (fboundp 'test-skeleton-handle-emit-signal-with-name-set-method))
-  (should (fboundp 'test-skeleton-register-open-file-method))
-  (should (fboundp 'test-skeleton-handle-open-file-method))
-  (should (fboundp 'test-skeleton-register-peer-signal-signal))
-  (should (fboundp 'test-skeleton-send-peer-signal-signal))
-  (should (fboundp 'test-skeleton-handle-peer-signal-signal))
-  (should (fboundp 'test-skeleton-register-peer-property-property))
-  (should (fboundp 'test-proxy-peer-property-annotated))
-  (should (fboundp 'test-proxy-retrieve-peer-property-annotated-property)))
-
-(provide 'dbus-codegen-tests)
-
-;;; dbus-codegen-tests.el ends here
diff --git a/packages/enwc/.bzrignore b/packages/enwc/.bzrignore
deleted file mode 100644
index c531d98..0000000
--- a/packages/enwc/.bzrignore
+++ /dev/null
@@ -1 +0,0 @@
-*.elc
diff --git a/packages/enwc/.hgignore b/packages/enwc/.hgignore
deleted file mode 100644
index e1b6cde..0000000
--- a/packages/enwc/.hgignore
+++ /dev/null
@@ -1,4 +0,0 @@
-syntax: glob
-
-*.elc
-enwc-autoloads.el
\ No newline at end of file
diff --git a/packages/enwc/.hgtags b/packages/enwc/.hgtags
deleted file mode 100644
index 39afd88..0000000
--- a/packages/enwc/.hgtags
+++ /dev/null
@@ -1,7 +0,0 @@
-3e2cab525cbc1c8664207fe9c01978335911b0a3 2.0
-3e2cab525cbc1c8664207fe9c01978335911b0a3 2.0
-0000000000000000000000000000000000000000 2.0
-0000000000000000000000000000000000000000 2.0
-cc2f7aa4ed369769e4aec5cdc4a6b1a2d28375b3 2.0
-cc2f7aa4ed369769e4aec5cdc4a6b1a2d28375b3 2.0
-0000000000000000000000000000000000000000 2.0
diff --git a/packages/enwc/COPYING b/packages/enwc/COPYING
deleted file mode 100644
index 94a9ed0..0000000
--- a/packages/enwc/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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 3 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, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/packages/enwc/Makefile b/packages/enwc/Makefile
deleted file mode 100644
index 69deb30..0000000
--- a/packages/enwc/Makefile
+++ /dev/null
@@ -1,59 +0,0 @@
-# This is part of ENWC
-#
-#  Copyright (C) 2012-2017 Ian Dunn.
-#
-#  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 3 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, see <http://www.gnu.org/licenses/>.
-
-DOCDIR=doc/
-
-PREFIX=/usr/local
-INFODIR=$(PREFIX)/info
-SITELISP=$(PREFIX)/share/emacs/site-lisp/enwc
-
-EMACS=emacs --batch
-ALLSRC= enwc-backend.el enwc.el enwc-wicd.el enwc-nm.el
-ALLELC=$(patsubst %.el,%.elc,$(SOURCE))
-
-SOURCE=$(ALLSRC)
-TARGET=$(ALLELC)
-
-.PHONY: all install lisp clean
-.PRECIOUS: %.elc
-all: lisp
-
-lisp: $(TARGET)
-
-%.elc: %.el
-       @$(EMACS) \
-       -L "." \
-       -f batch-byte-compile $<
-
-autoloads: enwc-autoloads.el
-
-enwc-autoloads.el: $(SOURCE)
-       @$(EMACS) \
-       --eval "(require 'package)" \
-       --eval "(setq inhibit-message t)" \
-       --eval "(package-generate-autoloads \"enwc\" \"$$(pwd)\")"
-
-clean:
-       -rm -f *.elc
-
-install:
-       install -m 644 $(ALLELC) $(SITELISP)
-       install -m 644 $(ALLSRC) $(SITELISP)
-
-uninstall:
-       -rm -f $(SITELISP)/*.elc
-       -rm -f $(SITELISP)/*.el
diff --git a/packages/enwc/doc/enwc.texi b/packages/enwc/doc/enwc.texi
deleted file mode 100644
index dddb66d..0000000
--- a/packages/enwc/doc/enwc.texi
+++ /dev/null
@@ -1,78 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename enwc.info
-@settitle ENWC Manual
-@c %**end of header
-
-@include version.texi
-@include fdl.texi
-
-@dircategory Emacs
-@direntry
-* ENWC: (enwc).         The Emacs Network Client.
-@end direntry
-
-@copying
-This manual is for ENWC, the Emacs Network Client.
-
-Copyright (C) 2012,2013,2014 Ian Dunn
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with no
-Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
-Texts.  A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
-@end quotation
-@end copying
-
-@titlepage
-@title  ENWC
-@subtitle Edition @value{EDITION}, for @code{enwc} version @value{VERSION}
-@subtitle @value{UPDATED}
-@author by Ian Dunn
-
-@page
-@vskip 0pt plus 1filll
-@insertcopying{}
-@end titlepage
-
-@contents
-
-@ifnottex
-@node Top
-@top ENWC
-
-@insertcopying
-
-This manual is for ENWC, the Emacs Network Client.
-
-This is edition @value{EDITION}, for @code{enwc} version @value{VERSION}
-@end ifnottex
-
-@menu
-* Introduction::        Overview of ENWC.
-* Setup::               Getting ready to use ENWC.
-* Configuration::       All of the configuration options.
-* Commands::            The commands that ENWC uses.
-@end menu
-
-@node Introduction
-@chapter Introduction
-
-ENWC is the Emacs Network Client.  It uses several backends to allow the user 
to control network connections through GNU Emacs, while still allowing control 
to remain with the actual network manager.  ENWC makes uses of the D-Bus 
interfaces provided by these network managers.
-
-@node Setup
-@chapter Setup
-
-First, the path to ENWC must be added to the @var{load-path} variable.  Then, 
in the @file{.emacs} file, the following must be added:
-
-@lisp
-(require 'enwc-setup)
-(enwc-setup)
-@end lisp
-
-Now, simply press @kbd{M+x}, and type @kbd{ENWC}, and press @kbd{RET}.  ENWC 
will begin scanning for networks on the wireless interface, and display them in 
its buffer.
-
-@bye
diff --git a/packages/enwc/doc/fdl.texi b/packages/enwc/doc/fdl.texi
deleted file mode 100644
index cb71f05..0000000
--- a/packages/enwc/doc/fdl.texi
+++ /dev/null
@@ -1,505 +0,0 @@
-@c The GNU Free Documentation License.
-@center Version 1.3, 3 November 2008
-
-@c This file is intended to be included within another document,
-@c hence no sectioning command or @node.
-
-@display
-Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, 
Inc.
-@uref{http://fsf.org/}
-
-Everyone is permitted to copy and distribute verbatim copies
-of this license document, but changing it is not allowed.
-@end display
-
-@enumerate 0
-@item
-PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document @dfn{free} in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of ``copyleft'', which means that derivative
-works of the document must themselves be free in the same sense.  It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does.  But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book.  We recommend this License
-principally for works whose purpose is instruction or reference.
-
-@item
-APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License.  Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein.  The ``Document'', below,
-refers to any such manual or work.  Any member of the public is a
-licensee, and is addressed as ``you''.  You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A ``Modified Version'' of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A ``Secondary Section'' is a named appendix or a front-matter section
-of the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall
-subject (or to related matters) and contains nothing that could fall
-directly within that overall subject.  (Thus, if the Document is in
-part a textbook of mathematics, a Secondary Section may not explain
-any mathematics.)  The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The ``Invariant Sections'' are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.  If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant.  The Document may contain zero
-Invariant Sections.  If the Document does not identify any Invariant
-Sections then there are none.
-
-The ``Cover Texts'' are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.  A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A ``Transparent'' copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters.  A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text.  A copy that is not ``Transparent'' is called ``Opaque''.
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, La@TeX{} input
-format, SGML or XML using a publicly available
-DTD, and standard-conforming simple HTML,
-PostScript or PDF designed for human modification.  Examples
-of transparent image formats include PNG, XCF and
-JPG.  Opaque formats include proprietary formats that can be
-read and edited only by proprietary word processors, SGML or
-XML for which the DTD and/or processing tools are
-not generally available, and the machine-generated HTML,
-PostScript or PDF produced by some word processors for
-output purposes only.
-
-The ``Title Page'' means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page.  For works in
-formats which do not have any title page as such, ``Title Page'' means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-The ``publisher'' means any person or entity that distributes copies
-of the Document to the public.
-
-A section ``Entitled XYZ'' means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language.  (Here XYZ stands for a
-specific section name mentioned below, such as ``Acknowledgements'',
-``Dedications'', ``Endorsements'', or ``History''.)  To ``Preserve the Title''
-of such a section when you modify the Document means that it remains a
-section ``Entitled XYZ'' according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document.  These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-@item
-VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no other
-conditions whatsoever to those of this License.  You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute.  However, you may accept
-compensation in exchange for copies.  If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-@item
-COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover.  Both covers must also clearly and legibly identify
-you as the publisher of these copies.  The front cover must present
-the full title with all words of the title equally prominent and
-visible.  You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to give
-them a chance to provide you with an updated version of the Document.
-
-@item
-MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it.  In addition, you must do these things in the Modified Version:
-
-@enumerate A
-@item
-Use in the Title Page (and on the covers, if any) a title distinct
-from that of the Document, and from those of previous versions
-(which should, if there were any, be listed in the History section
-of the Document).  You may use the same title as a previous version
-if the original publisher of that version gives permission.
-
-@item
-List on the Title Page, as authors, one or more persons or entities
-responsible for authorship of the modifications in the Modified
-Version, together with at least five of the principal authors of the
-Document (all of its principal authors, if it has fewer than five),
-unless they release you from this requirement.
-
-@item
-State on the Title page the name of the publisher of the
-Modified Version, as the publisher.
-
-@item
-Preserve all the copyright notices of the Document.
-
-@item
-Add an appropriate copyright notice for your modifications
-adjacent to the other copyright notices.
-
-@item
-Include, immediately after the copyright notices, a license notice
-giving the public permission to use the Modified Version under the
-terms of this License, in the form shown in the Addendum below.
-
-@item
-Preserve in that license notice the full lists of Invariant Sections
-and required Cover Texts given in the Document's license notice.
-
-@item
-Include an unaltered copy of this License.
-
-@item
-Preserve the section Entitled ``History'', Preserve its Title, and add
-to it an item stating at least the title, year, new authors, and
-publisher of the Modified Version as given on the Title Page.  If
-there is no section Entitled ``History'' in the Document, create one
-stating the title, year, authors, and publisher of the Document as
-given on its Title Page, then add an item describing the Modified
-Version as stated in the previous sentence.
-
-@item
-Preserve the network location, if any, given in the Document for
-public access to a Transparent copy of the Document, and likewise
-the network locations given in the Document for previous versions
-it was based on.  These may be placed in the ``History'' section.
-You may omit a network location for a work that was published at
-least four years before the Document itself, or if the original
-publisher of the version it refers to gives permission.
-
-@item
-For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
-the Title of the section, and preserve in the section all the
-substance and tone of each of the contributor acknowledgements and/or
-dedications given therein.
-
-@item
-Preserve all the Invariant Sections of the Document,
-unaltered in their text and in their titles.  Section numbers
-or the equivalent are not considered part of the section titles.
-
-@item
-Delete any section Entitled ``Endorsements''.  Such a section
-may not be included in the Modified Version.
-
-@item
-Do not retitle any existing section to be Entitled ``Endorsements'' or
-to conflict in title with any Invariant Section.
-
-@item
-Preserve any Warranty Disclaimers.
-@end enumerate
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant.  To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled ``Endorsements'', provided it contains
-nothing but endorsements of your Modified Version by various
-parties---for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version.  Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity.  If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-@item
-COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy.  If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled ``History''
-in the various original documents, forming one section Entitled
-``History''; likewise combine any sections Entitled ``Acknowledgements'',
-and any sections Entitled ``Dedications''.  You must delete all
-sections Entitled ``Endorsements.''
-
-@item
-COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other documents
-released under this License, and replace the individual copies of this
-License in the various documents with a single copy that is included in
-the collection, provided that you follow the rules of this License for
-verbatim copying of each of the documents in all other respects.
-
-You may extract a single document from such a collection, and distribute
-it individually under this License, provided you insert a copy of this
-License into the extracted document, and follow this License in all
-other respects regarding verbatim copying of that document.
-
-@item
-AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an ``aggregate'' if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-@item
-TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections.  You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers.  In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled ``Acknowledgements'',
-``Dedications'', or ``History'', the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-@item
-TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense, or distribute it is void, and
-will automatically terminate your rights under this License.
-
-However, if you cease all violation of this License, then your license
-from a particular copyright holder is reinstated (a) provisionally,
-unless and until the copyright holder explicitly and finally
-terminates your license, and (b) permanently, if the copyright holder
-fails to notify you of the violation by some reasonable means prior to
-60 days after the cessation.
-
-Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, receipt of a copy of some or all of the same material does
-not give you any rights to use it.
-
-@item
-FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions
-of the GNU Free Documentation License from time to time.  Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.  See
-@uref{http://www.gnu.org/copyleft/}.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License ``or any later version'' applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation.  If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.  If the Document
-specifies that a proxy can decide which future versions of this
-License can be used, that proxy's public statement of acceptance of a
-version permanently authorizes you to choose that version for the
-Document.
-
-@item
-RELICENSING
-
-``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
-World Wide Web server that publishes copyrightable works and also
-provides prominent facilities for anybody to edit those works.  A
-public wiki that anybody can edit is an example of such a server.  A
-``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
-site means any set of copyrightable works thus published on the MMC
-site.
-
-``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
-license published by Creative Commons Corporation, a not-for-profit
-corporation with a principal place of business in San Francisco,
-California, as well as future copyleft versions of that license
-published by that same organization.
-
-``Incorporate'' means to publish or republish a Document, in whole or
-in part, as part of another Document.
-
-An MMC is ``eligible for relicensing'' if it is licensed under this
-License, and if all works that were first published under this License
-somewhere other than this MMC, and subsequently incorporated in whole
-or in part into the MMC, (1) had no cover texts or invariant sections,
-and (2) were thus incorporated prior to November 1, 2008.
-
-The operator of an MMC Site may republish an MMC contained in the site
-under CC-BY-SA on the same site at any time before August 1, 2009,
-provided the MMC is eligible for relicensing.
-
-@end enumerate
-
-@page
-@heading ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
-@smallexample
-@group
-  Copyright (C)  @var{year}  @var{your name}.
-  Permission is granted to copy, distribute and/or modify this document
-  under the terms of the GNU Free Documentation License, Version 1.3
-  or any later version published by the Free Software Foundation;
-  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
-  Texts.  A copy of the license is included in the section entitled ``GNU
-  Free Documentation License''.
-@end group
-@end smallexample
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the ``with@dots{}Texts.''@: line with this:
-
-@smallexample
-@group
-    with the Invariant Sections being @var{list their titles}, with
-    the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
-    being @var{list}.
-@end group
-@end smallexample
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
-
-@c Local Variables:
-@c ispell-local-pdict: "ispell-dict"
-@c End:
diff --git a/packages/enwc/doc/version.texi b/packages/enwc/doc/version.texi
deleted file mode 100644
index f910a9b..0000000
--- a/packages/enwc/doc/version.texi
+++ /dev/null
@@ -1,4 +0,0 @@
-@set UPDATED 15 December 2012
-@set UPDATED-MONTH December 2012
-@set EDITION 1.0
-@set VERSION 1.0
diff --git a/packages/enwc/enwc-backend.el b/packages/enwc/enwc-backend.el
deleted file mode 100644
index a8b8f92..0000000
--- a/packages/enwc/enwc-backend.el
+++ /dev/null
@@ -1,157 +0,0 @@
-;;; enwc-backend.el --- Back-end functions for ENWC.
-
-;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
-
-;; Author: Ian Dunn <dunni@gnu.org>
-;; Keywords: external, network, wicd, manager, nm
-;; Version: 2.0
-;; Homepage: https://savannah.nongnu.org/p/enwc
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-;; 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Code:
-
-(require 'map)
-
-(cl-defstruct enwc-backend
-  key  ;; The symbol that identifies this backend.
-  ;; Loading/unloading functions
-  can-load-p
-  load
-  unload
-  ;; Scan interface
-  network-ids
-  scan
-  nw-props
-  ;; Connect/disconnect
-  connect
-  disconnect
-  ;; Maintenance
-  current-nw-id
-  is-connecting-p
-  is-wired-p
-  ;; get-profile-info
-  ;; save-nw-settings
-  )
-
-(defvar enwc-registered-backend-alist nil
-  "Alist of registered ENWC backends.
-
-Each entry in this list is of the form
-
-    (KEY . DEFINITION)
-
-Where KEY is a symbol identifying the backend, and DEFINITION is
-an enwc-backend struct.")
-
-(defcustom enwc-default-backend nil
-  "Key of the default backend to use."
-  :type 'symbol
-  :group 'enwc)
-
-(defcustom enwc-force-backend-loading nil
-  "Non-nil if backends should be loaded during `enwc-setup' even if they claim 
they cannot."
-  :type 'boolean
-  :group 'enwc)
-
-(defvar enwc--current-backend nil)
-
-;;;###autoload
-(defun enwc-register-backend (definition &optional forcep)
-  "Register the backend KEY with DEFINITION.
-
-Signals an error if a backend with KEY already exists and FORCEP is nil."
-  (cl-check-type definition enwc-backend)
-  (let ((key (enwc-backend-key definition)))
-    (when (and (map-contains-key enwc-registered-backend-alist key) (not 
forcep))
-      (error "An ENWC backend with key '%s' has already been registered." key))
-    (map-put enwc-registered-backend-alist key definition)))
-
-;; Convenience functions to work with backends
-
-(defun enwc--can-load-p (backend)
-  (funcall (enwc-backend-can-load-p backend)))
-
-(defun enwc--load (backend)
-  (funcall (enwc-backend-load backend)))
-
-(defun enwc--unload (backend)
-  (funcall (enwc-backend-unload backend)))
-
-(defun enwc--scan (backend)
-  (funcall (enwc-backend-scan backend)))
-
-(defun enwc--network-ids (backend &optional wired-p)
-  (funcall (enwc-backend-network-ids backend) wired-p))
-
-(defun enwc--nw-props (backend id &optional wired-p)
-  (funcall (enwc-backend-nw-props backend) id wired-p))
-
-(defun enwc--connect (backend id &optional wired-p)
-  (funcall (enwc-backend-connect backend) id wired-p))
-
-(defun enwc--disconnect (backend &optional wired-p)
-  (funcall (enwc-backend-disconnect backend) wired-p))
-
-(defun enwc--current-nw-id (backend &optional wired-p)
-  (funcall (enwc-backend-current-nw-id backend) wired-p))
-
-(defun enwc--is-connecting-p (backend)
-  (funcall (enwc-backend-is-connecting-p backend)))
-
-(defun enwc--is-wired-p (backend)
-  (funcall (enwc-backend-is-wired-p backend)))
-
-;; Handle loading/unloading
-
-(defun enwc-load-backend (backend &optional force)
-  "Load BACKEND, which is a symbol denoting the backend to use."
-  (interactive
-   (list
-    (intern (completing-read "Backend: " enwc-registered-backend-alist nil t))
-    current-prefix-arg))
-  (when (and enwc--current-backend
-             (not (eq (enwc-backend-key enwc--current-backend) backend)))
-    (enwc-unload-current-backend))
-
-  (unless (require (intern (format "enwc-%s" backend)) nil t)
-    (error "Cannot find enwc feature for backend %s" backend))
-
-  (let ((new-backend (map-elt enwc-registered-backend-alist backend)))
-    (unless new-backend
-      (error "No registered backend %s" backend))
-
-    (if (not (or force (enwc--can-load-p new-backend)))
-      (warn "Backend %s is not usable." backend)
-    (enwc--load new-backend)
-    (setq enwc--current-backend new-backend))))
-
-(defun enwc-load-default-backend (&optional force)
-  (enwc-load-backend enwc-default-backend force))
-
-(defun enwc-unload-current-backend ()
-  "Unload the current backend."
-  (when enwc--current-backend
-    (enwc--unload enwc--current-backend)
-    (setq enwc--current-backend nil)))
-
-(provide 'enwc-backend)
-
-;;; enwc-backend.el ends here
diff --git a/packages/enwc/enwc-cm.el b/packages/enwc/enwc-cm.el
deleted file mode 100644
index 0dc64a7..0000000
--- a/packages/enwc/enwc-cm.el
+++ /dev/null
@@ -1,372 +0,0 @@
-;; enwc-cm.el --- The ConnMan back-end to ENWC.
-
-;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
-
-;; Author: Ian Dunn <dunni@gnu.org>
-;; Keywords: external, network, wicd, manager, nm
-;; Version: 2.0
-;; Homepage: https://savannah.nongnu.org/p/enwc
-
-;; This file is part of GNU Emacs
-
-;; GNU Emacs 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 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-;; 02110-1301, USA.
-
-;;; Commentary:
-
-;; ConnMan support is still experimental.
-
-;;; Code:
-
-(require 'enwc)
-
-(defgroup enwc-cm nil
-  "*ConnMan variables for ENWC"
-  :prefix "enwc-cm-"
-  :group 'enwc)
-
-(defcustom enwc-cm-dbus-service "net.connman"
-  "ConnMan D-Bus service."
-  :group 'enwc-cm
-  :type 'string)
-
-(defcustom enwc-cm-dbus-manager-interface "net.connman.Manager"
-  "ConnMan D-Bus Manager interface."
-  :group 'enwc-cm
-  :type 'string)
-
-(defcustom enwc-cm-dbus-service-interface "net.connman.Service"
-  "ConnMan D-Bus Service interface."
-  :group 'enwc-cm
-  :type 'string)
-
-(defcustom enwc-cm-dbus-technology-interface "net.connman.Technology"
-  "ConnMan D-Bus Technology Interface"
-  :group 'enwc-cm
-  :type 'string)
-
-(defcustom enwc-cm-dbus-technology-path "/net/connman/technology/"
-  "ConnMan D-Bus Technology Path"
-  :group 'enwc-cm
-  :type 'string)
-
-(defcustom enwc-cm-dbus-service-path "/net/connman/service"
-  "ConnMan D-Bus Service Path"
-  :group 'enwc-cm
-  :type 'string)
-
-(defcustom enwc-cm-dbus-agent-service "org.gnu.enwc.agent"
-  "The service for the ConnMan Agent for ENWC to use."
-  :group 'enwc-cm
-  :type 'string)
-
-(defcustom enwc-cm-dbus-agent-path "/org/gnu/enwc/agent"
-  "The path to the Agent for ENWC to use for ConnMan security."
-  :group 'enwc-cm
-  :type 'string)
-
-(defcustom enwc-cm-dbus-agent-interface "org.gnu.enwc.agent"
-  "The interface for the ConnMan Agent for ENWC to use."
-  :group 'enwc-cm
-  :type 'string)
-
-(defvar enwc-cm-details-list
-  '("Name" "Ethernet/Address" "Strength" "Security" "mode" "channel"))
-
-(defun enwc-cm-get-wifi-tech-path ()
-  "Return the ConnMan Wifi Technology path."
-  (concat enwc-cm-dbus-technology-path "wifi"))
-
-(defun enwc-cm-get-wired-tech-path ()
-  "Return the ConnMan Ethernet Technology path."
-  (concat enwc-cm-dbus-technology-path "ethernet"))
-
-(defun enwc-cm-get-network (id)
-  (nth id (enwc-cm-get-services)))
-
-;; connect
-(defun enwc-cm-connect (wired id)
-  (let ((path (concat enwc-cm-dbus-service-path (number-to-string id))))
-    (dbus-call-method :system
-                      enwc-cm-dbus-service
-                      path
-                      enwc-cm-dbus-service-interface
-                      "Connect")))
-
-;; disconnect
-(defun enwc-cm-disconnect (wired)
-  (dbus-call-method :system
-                    enwc-cm-dbus-service
-                    "/net/connman/service/CONNECTED-SERVICE"
-                    enwc-cm-dbus-service-interface
-                    "Disconnect"))
-
-;; scan
-(defun enwc-cm-scan (wired)
-  (let ((path (if wired
-                  (enwc-cm-get-wired-tech-path)
-                (enwc-cm-get-wifi-tech-path))))
-    (dbus-call-method-asynchronously :system
-                                     path
-                                     enwc-cm-dbus-technology-interface
-                                     "Scan"
-                                     'enwc-process-scan
-                                     :timeout 6000)))
-
-;; (defun enwc-cm-scan (wired)
-;;   (dbus-call-method :system
-;;                  enwc-cm-dbus-service
-;;                  "/net/connman/technology/(ethernet|wifi)"
-;;                  "net.connman.Technology"
-;;                  "Scan"))
-
-;; get-network-props
-;; Might combine this with enwc-nm-get-dbus-dict-entry
-(defun enwc-cm-dict-assoc (dict prop)
-  (let ((path-list (split-string prop "/"))
-        (cur-list dict))
-    (while (and path-list cur-list)
-      (let ((cur-path (pop path-list)))
-        (setq cur-list
-              (when (assoc cur-path cur-list)
-                (caadr (assoc cur-path cur-list))))))
-    (if (and cur-list (consp cur-list)) (car cur-list) cur-list)))
-
-(defun enwc-cm-get-nw-prop (id prop)
-  (let ((network (enwc-cm-get-network id)))
-    (car (cadr (assoc prop (cadr network))))))
-
-(defun enwc-cm-get-network-props (id wired)
-  (let ((network (enwc-cm-get-network id))
-        props)
-    ;; network should be a pair, (path . props)
-    (unless network
-      (error "Invalid Network Id %d" id))
-    (setq props (cadr network))
-    (mapcar
-     (lambda (det)
-       (enwc-cm-dict-assoc props det))
-     enwc-cm-details-list)))
-
-(defun enwc-cm-get-wireless-network-property (id prop)
-  (enwc-cm-get-nw-prop id prop))
-
-;; get-profile-props
-(defun enwc-cm-get-profile-props (prof wired)
-  (let ((network (enwc-cm-get-network prof))
-        props
-        ipv4-settings
-        dns-settings)
-    (unless network
-      (error "Invalid Network Id %d" id))
-    (setq props (cadr network))
-    (setq ipv4-settings (enwc-cm-dict-assoc "IPv4/Configuration" props)
-          dns-settings  (enwc-cm-dict-assoc "Domains/Configuration" props))
-    `((addr    . ,(cadr (assoc "Address" ipv4-settings)))
-      (netmask . ,(cadr (assoc "Netmask" ipv4-settings)))
-      (gateway . ,(cadr (assoc "Gateway" ipv4-settings)))
-      (dns1    . ,(nth 0 dns-settings))
-      (dns2    . ,(nth 1 dns-settings)))))
-
-;; get-current-nw-id
-(defun enwc-cm-is-disconnected-p (service)
-  (member (enwc-cm-dict-assoc (cadr service) "State")
-          '("idle" "disconnect")))
-
-(defun enwc-cm-is-connecting-p (service)
-  (member (enwc-cm-dict-assoc (cadr service) "State")
-          '("association" "configuration")))
-
-(defun enwc-cm-is-connected-p (service)
-  (member (enwc-cm-dict-assoc (cadr service) "State")
-          '("ready" "online")))
-
-(defun enwc-cm--find-connected-service (services num)
-  (if services
-      (if (enwc-cm-is-connected-p (car services))
-          num
-        (enwc-cm--find-connected-service (cdr services) (1+ num)))
-    -1))
-
-(defun enwc-cm-get-current-nw-id ()
-  "Get the current network id."
-  (let* ((services (enwc-cm-get-services)))
-    (enwc-cm--find-connected-service services 0)))
-
-;; save-profile
-(defun enwc-cm-set-nw-prop (nw prop val &optional wired)
-  (dbus-call-method :system
-                    enwc-cm-dbus-service
-                    (car nw)
-                    enwc-cm-dbus-service-interface
-                    "SetProperty"
-                    :string prop
-                    val))
-
-(defun enwc-cm-save-profile (prof settings wired)
-  (let ((network (enwc-cm-get-network prof))
-        props
-        ipv4-settings
-        dns-settings)
-    (unless network
-      (error "Invalid Network Id %d" id))
-    (setq props (cadr network))
-    (setq ipv4-settings
-          `((("Method" ("manual"))
-             ("Address" (,(alist-get 'addr settings "")))
-             ("Netmask" (,(alist-get 'netmask settings "")))
-             ("Gateway" (,(alist-get 'gateway settings ""))))))
-    (setq dns-settings
-          `((,(alist-get 'dns1 settings ""))
-            (,(alist-get 'dns2 settings ""))))
-    (enwc-cm-set-nw-prop prof "IPv4.Configuration" ipv4-settings wired)
-    (enwc-cm-set-nw-prop prof "Domains.Configuration" dns-settings wired)))
-
-;; check-connecting-p
-(defun enwc-cm--find-connecting-service (services)
-  (when services
-    (or (enwc-cm-is-connecting-p (car services))
-        (enwc-cm--find-connecting-service (cdr services)))))
-
-(defun enwc-cm-check-connecting-p ()
-  (let ((services (enwc-cm-get-services)))
-    (enwc-cm--find-connecting-service services)))
-
-;; get-networks
-(defun enwc-cm-get-services ()
-  (dbus-call-method :system
-                    enwc-cm-dbus-service
-                    "/"
-                    enwc-cm-dbus-manager-interface
-                    "GetServices"))
-
-(defun enwc-cm-get-networks ()
-  (let ((services (enwc-cm-get-services)))
-    (mapcar 'car services)))
-
-;; Agent
-;; ConnMan requires that an agent is registered, so we create one here.
-
-(defun enwc-cm-agent-release (&rest args)
-  )
-
-(defun enwc-cm-agent-report-error (service err)
-  )
-
-(defun enwc-cm-agent-report-peer-error (peer err))
-
-(defun enwc-cm-agent-request-browser (service url)
-  (browse-url url))
-
-(defun enwc-cm-agent-request-input (service fields)
-  "Called when a user requests input.
-SERVICE is the current service.
-FIELDS is an associative list of requested fields."
-  ;; Obtain the information from somewhere.
-  )
-
-(defun enwc-cm-agent-request-peer-authorization (peer fields))
-
-(defun enwc-cm-agent-cancel ())
-
-(defun enwc-cm-method-to-defun (method)
-  (let ((case-fold-search nil))
-    (combine-and-quote-strings
-     (mapcar 'downcase
-             (cdr (split-string
-                   (replace-regexp-in-string "\\([[:upper:]]\\)" " \\1" method)
-                   " ")))
-     "-")))
-
-(defmacro enwc-cm-agent-register-method (method)
-  "Register a method METHOD with D-Bus.
-METHOD is assumed to be the camel-case D-Bus method."
-  `((dbus-register-method :session
-                          enwc-cm-dbus-agent-service
-                          enwc-cm-dbus-agent-path
-                          enwc-cm-dbus-agent-interface
-                          ,method
-                          (quote ,(car (read-from-string
-                                        (concat
-                                         "enwc-cm-agent-"
-                                         (enwc-cm-method-to-defun 
method))))))))
-
-;; Run during setup.
-(defun enwc-cm-setup ()
-
-  ;; Setup the agent.
-  (dbus-register-service :session enwc-cm-dbus-agent-service)
-
-  (enwc-cm-agent-register-method "Release")
-  (enwc-cm-agent-register-method "ReportError")
-  (enwc-cm-agent-register-method "ReportPeerError")
-  (enwc-cm-agent-register-method "RequestBrowser")
-  (enwc-cm-agent-register-method "RequestInput")
-  (enwc-cm-agent-register-method "RequestPeerAuthorization")
-  (enwc-cm-agent-register-method "Cancel")
-
-  (dbus-call-method :system
-                    enwc-cm-dbus-manager-service
-                    enwc-cm-dbus-manager-path
-                    enwc-cm-dbus-manager-interface
-                    "RegisterAgent"
-                    :string enwc-cm-dbus-agent-path))
-
-
-;; (defun enwc-cm-get-encryption-type (id)
-;;   (enwc-cm-get-nw-prop id "Security"))
-
-;; (defun enwc-cm-get-ip-addr (wired id)
-;;   (let ((ipv4-config (enwc-cm-get-nw-prop id "IPv4.Configuration")))
-;;     (car (cadr (assoc "Address" ipv4-config)))))
-
-;; (defun enwc-cm-get-netmask (wired id)
-;;   (let ((ipv4-config (enwc-cm-get-nw-prop id "IPv4.Configuration")))
-;;     (car (cadr (assoc "Netmask" ipv4-config)))))
-
-;; (defun enwc-cm-get-gateway (wired id)
-;;   (let ((ipv4-config (enwc-cm-get-nw-prop id "IPv4.Configuration")))
-;;     (car (cadr (assoc "Gateway" ipv4-config)))))
-
-;; (defun enwc-cm-get-dns (wired id)
-;;   (enwc-cm-get-nw-prop id "Nameservers.Configuration"))
-
-;; (defun enwc-cm-save-nw-settings (wired id settings)
-;;   (let* ((ipv4 (enwc-cm-get-nw-prop id "IPv4.Configuration"))
-;;          (method (car (cadr (assoc "Method" ipv4))))
-;;          (ip-addr (cdr (assoc "addr" settings)))
-;;          (netmask (cdr (assoc "netmask" settings)))
-;;          (gateway (cdr (assoc "gateway" settings)))
-;;          new-ipv4-config new-dns-config)
-;;     (setq new-ipv4-config
-;;           (list (list (cons "Method" (cons (cons method nil) nil))
-;;                       (cons "Address" (cons (cons ip-addr nil) nil))
-;;                       (cons "Netmask" (cons (cons netmask nil) nil))
-;;                       (cons "Gateway" (cons (cons gateway nil) nil)))))
-;;     (setq new-dns-config
-;;           (list (list (cdr (assoc "dns1" settings))
-;;                       (cdr (assoc "dns2" settings)))))
-;;     (enwc-cm-set-nw-prop wired id "IPv4.Configuration"
-;;                          new-ipv4-config)
-;;     (enwc-cm-set-nw-prop wired id "Nameservers.Configuration"
-;;                          new-dns-config)))
-
-(provide 'enwc-cm)
-
-;; Local Variables:
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; enwc-cm.el ends here
diff --git a/packages/enwc/enwc-edit.el b/packages/enwc/enwc-edit.el
deleted file mode 100644
index 7aee28b..0000000
--- a/packages/enwc/enwc-edit.el
+++ /dev/null
@@ -1,434 +0,0 @@
-;;; enwc-edit.el --- Support for editing wireless network profiles
-
-;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
-
-;; Author: Ian Dunn <dunni@gnu.org>
-;; Keywords: external, network, wicd, manager, nm
-;; Version: 2.0
-;; Homepage: https://savannah.nongnu.org/p/enwc
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-;; 02110-1301, USA.
-
-;;; Commentary:
-
-;; THIS IS EXPERIMENTAL
-
-;;; Code:
-
-(require 'wid-edit)
-
-(eval-when-compile
-  (defun enwc--break-by-words (str)
-    "Break up string STR into a list of words."
-    (cl-check-type str string)
-    (split-string str "-\\|_\\| "))
-
-  (defun enwc--sym-to-str (sym &optional seps)
-    "Create a string from symbol SYM.
-SEPS is a string specifying the separator to use to combine the words,
-or \" \" if not specified."
-    (cl-check-type sym symbol)
-    (unless seps
-      (setq seps " "))
-    (cl-check-type seps string)
-    (combine-and-quote-strings (enwc--break-by-words (symbol-name sym)) seps))
-
-  (defun enwc--str-to-sym (str &optional seps)
-    "Create a symbol from the string STR.
-This will break STR into words, and then put it back together separating
-each word by SEPS, which defaults to \"-\"."
-    (cl-check-type str string)
-    (unless seps
-      (setq seps "-"))
-    (cl-check-type seps string)
-    (intern (combine-and-quote-strings (enwc--break-by-words str) seps))))
-
-(defun enwc--int-to-byte-list (n)
-  "Convert 32-bit integer N into a byte list."
-  (cl-check-type n integer)
-  (let (ret)
-    (dotimes (x 4 ret)
-      (push (logand n 255) ret)
-      (setq n (lsh n -8)))))
-
-(defun enwc--byte-list-to-int (bl)
-  "Convert byte list BL into a 32-bit integer."
-  (cl-check-type bl list)
-  (let ((ret 0))
-    (dolist (x bl ret)
-      (setq ret (logior (lsh ret 8) x)))))
-
-(defun enwc--htonl (n)
-  "Convert 32-bit integer N from hardware to network byte order."
-  (cl-check-type n integer)
-  (enwc--byte-list-to-int (nreverse (enwc--int-to-byte-list n))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;
-;; Profile Properties ;;
-;;;;;;;;;;;;;;;;;;;;;;;;
-
-;; Settings for access point AP
-;;
-;; IPv4 Settings:
-;;   Address =
-;;   Netmask =
-;;   Gateway =
-;;
-;;   DNS 1   =
-;;   DNS 2   =
-;;
-;; Security:
-;;   Type    =
-;;
-
-(defun enwc-edit-view-entry ()
-  "View the text of the entry at point.
-This is mostly useful to view the text of the hidden entries."
-  (interactive)
-  (unless (get-buffer "*ENWC Edit*")
-    (error "Not editing a network entry."))
-  (unless (eq (current-buffer) (get-buffer "*ENWC Edit*"))
-    (switch-to-buffer "*ENWC Edit*"))
-  (unless (widget-at)
-    (error "No widget at point"))
-  (message (widget-field-value-get (widget-at))))
-
-(define-widget 'enwc-profile-props-widget 'group
-  "ENWC edit widget."
-  :convert-widget 'identity
-  :format "IPv4 Settings:\n %v"
-  :value-to-internal 'enwc-profile-props-to-widget
-  :value-to-external 'enwc-widget-to-profile-props
-  :match #'(lambda nil t)
-  :indent 1
-  :args '((string :tag "Address")
-          (string :tag "Netmask")
-          (string :tag "Gateway")
-          (string :tag "DNS1")
-          (string :tag "DNS2")))
-
-(defun enwc-profile-props-to-widget (widget props)
-  "Create a profile props widget."
-  (list
-   (alist-get 'addr props "")
-   (alist-get 'netmask props "")
-   (alist-get 'gateway props "")
-   (alist-get 'dns1 props "")
-   (alist-get 'dns2 props "")))
-
-(defun enwc-widget-to-profile-props (widget vals)
-  "Convert widget values to a profile properties alist.
-WIDGET is unused.
-VALS is the list of widget values."
-  (let ((addr (nth 0 vals))
-        (netmask (nth 1 vals))
-        (gateway (nth 2 vals))
-        (dns1 (nth 3 vals))
-        (dns2 (nth 4 vals)))
-    `((addr . ,addr)
-      (netmask . ,netmask)
-      (gateway . ,gateway)
-      (dns1 . ,dns1)
-      (dns2 . ,dns2))))
-
-;;;;;;;;;;;;;;
-;; Security ;;
-;;;;;;;;;;;;;;
-
-(eval-when-compile
-  (defmacro enwc--make-supplicant-multi (key &rest args)
-    `(cons (quote ,key)
-           (quote (checklist :tag ,(capitalize (enwc--sym-to-str key))
-                             :format "%{%t%}: %v"
-                             :sample-face bold
-                             :indent ,(+ 4 (length (enwc--sym-to-str key)))
-                             :args ,(mapcar
-                                     (lambda (arg)
-                                       `(item :tag ,(upcase arg) :value 
,(downcase arg)))
-                                     args)))))
-
-  (defmacro enwc--make-supplicant-choice (key &rest args)
-    `(cons (quote ,key)
-           (quote (menu-choice :tag ,(capitalize (enwc--sym-to-str key))
-                               :format "%[%t%]: %v"
-                               :sample-face bold
-                               :args
-                               ,(mapcar
-                                 (lambda (arg)
-                                   `(item :tag ,(upcase arg) :value (downcase 
,arg)))
-                                 args)))))
-
-  (defmacro enwc--make-supplicant-secret (key)
-    `(cons (quote ,key)
-           (quote (editable-field :tag ,(capitalize (enwc--sym-to-str key))
-                                  :format "%{%t%}: %v"
-                                  :sample-face bold
-                                  :keymap enwc-edit-field-map
-                                  :secret ?*))))
-
-  (defmacro enwc--make-supplicant-entry (key)
-    `(cons (quote ,key)
-           (quote (editable-field :tag ,(capitalize (enwc--sym-to-str key))
-                                  :sample-face bold
-                                  :format "%{%t%}: %v"))))
-
-  (defmacro enwc--make-supplicant-file (key)
-    `(cons (quote ,key)
-           (quote (file :tag ,(capitalize (enwc--sym-to-str key))
-                        :format "%{%t%}: %v"
-                        :sample-face bold
-                        :must-match t))))
-
-  (defmacro enwc--make-supplicant-list (key &rest args)
-    `(cons (quote ,key)
-           (quote (list :tag ,(capitalize (enwc--sym-to-str key))
-                        :format "%{%t%}: %v"
-                        :sample-face bold
-                        :indent ,(length (enwc--sym-to-str key))
-                        :args ,(mapcar (lambda (x) (cdr (eval x))) args))))))
-
-(defconst enwc-supplicant-alist
-  (list
-   (enwc--make-supplicant-multi proto "WPA" "RSN")
-   (enwc--make-supplicant-multi key-mgmt "None" "WPA-PSK" "WPA-EAP" 
"IEEE8021X")
-   (enwc--make-supplicant-choice auth-alg "OPEN" "SHARED" "LEAP")
-   (enwc--make-supplicant-multi pairwise "CCMP" "TKIP" "NONE")
-   (enwc--make-supplicant-multi group "CCMP" "TKIP" "WEP104" "WEP40")
-   (enwc--make-supplicant-secret psk)
-   (enwc--make-supplicant-secret wep-key0)
-   (enwc--make-supplicant-secret wep-key1)
-   (enwc--make-supplicant-secret wep-key2)
-   (enwc--make-supplicant-secret wep-key3)
-   (enwc--make-supplicant-choice wep-tx-keyidx "0" "1" "2" "3")
-   (enwc--make-supplicant-choice eap "TLS" "PEAP" "TTLS" "LEAP" "FAST")
-   (enwc--make-supplicant-entry identity)
-   (enwc--make-supplicant-entry anonymous-identity)
-   (enwc--make-supplicant-secret password)
-   (enwc--make-supplicant-file ca-cert)
-   (enwc--make-supplicant-file client-cert)
-   (enwc--make-supplicant-file private-key)
-   (enwc--make-supplicant-secret private-key-passwd)
-   (enwc--make-supplicant-file pac-file)
-   (enwc--make-supplicant-list phase1
-                               (enwc--make-supplicant-choice peapver "" "0" 
"1")
-                               (enwc--make-supplicant-choice peaplabel "" "0" 
"1")
-                               (enwc--make-supplicant-choice fast-provisioning 
"" "0" "1" "2" "3"))
-   (enwc--make-supplicant-list phase2
-                               (enwc--make-supplicant-choice auth "" "MD5" 
"MSCHAPV2" "OTP" "GTC" "TLS")
-                               (enwc--make-supplicant-choice autheap "" "MD5" 
"MSCHAPV2" "OTP" "GTC" "TLS")
-                               (enwc--make-supplicant-file ca-cert)
-                               (enwc--make-supplicant-file client-cert)
-                               (enwc--make-supplicant-file private-key)
-                               (enwc--make-supplicant-secret 
private-key-passwd)))
-  "An alist that maps supplicant entries to a widget type.
-
-For more information, see the documentation for wpa_supplicant.")
-
-(defcustom enwc-supplicant-template-alist
-  `((wep . ((key-mgmt . ("none"))
-            (wep-key0 . req)
-            (wep-tx-keyidx . "0")))
-    (wpa2 . ((proto . ("wpa" "rsn"))
-             (key-mgmt . ("wpa-psk"))
-             (pairwise . ("ccmp" "tkip"))
-             (group . ("ccmp" "tkip"))
-             (psk . req)))
-    (leap . ((eap . "leap")
-             (key-mgmt . ("ieee8021x"))
-             (auth-alg . "leap")
-             (identity . req)
-             (password . req)))
-    (eap-fast . ((proto . ("rsn" "wpa"))
-                 (pairwise . ("ccmp" "tkip"))
-                 (group . ("ccmp" "tkip"))
-                 (key-mgmt . ("wpa-eap"))
-                 (eap . "fast")
-                 (identity . req)
-                 (password . req)
-                 (phase1 . ((fast-provisioning . "1")))
-                 (pac-file . opt)))
-    (eap-tls . ((key-mgmt . ("wpa-eap"))
-                (pairwise . ("tkip"))
-                (group . ("tkip"))
-                (eap . "tls")
-                (identity . req)
-                (ca-cert . opt)
-                (client-cert . opt)
-                (private-key . req)
-                (private-key-passwd . req)))
-    (peap . ((proto . ("rsn"))
-             (key-mgmt . ("wpa-eap"))
-             (pairwise . ("ccmp"))
-             (eap . "peap")
-             (identity . req)
-             (password . req)))
-    (peap-tkip . ((proto . ("wpa"))
-                  (key-mgmt . ("wpa-eap"))
-                  (pairwise . ("tkip"))
-                  (group . ("tkip"))
-                  (eap . "peap")
-                  (identity . req)
-                  (password . req)
-                  (ca-cert . opt)
-                  (phase1 . ((peaplabel . "0")))
-                  (phase2 . ((auth . "mschapv2"))))))
-  "The alist of templates for security.
-This should be an alist of the form (KEY . ((SUPPLICANT-KEY . INITIAL-INPUT) 
...))
-Each SUPPLICANT-KEY should be a key from `enwc-supplicant-alist', and 
INITIAL-INPUT
-should be an acceptable value for SUPPLICANT-KEY.
-
-If INITIAL-INPUT is the symbol req, then this option is required.
-The value opt means that the option is optional."
-  :group 'enwc
-  :type '(alist :key-type symbol :value-type (alist :key-type symbol)))
-
-(defun enwc--get-supplicant-entry (ent &optional sec-info)
-  "Create a widget definition from ENT.
-
-If optional parameter SEC-INFO is non-nil, then use it
-for security information."
-  (let ((init (cdr ent))
-        (wid (assq (car ent) enwc-supplicant-alist))
-        fin)
-    (unless wid
-      (error "Unknown supplicant type %s" (car ent)))
-    ;; Set the initial value for the widget.
-    (when (eq (cadr wid) 'list)
-      (let (act-init)
-        (dolist (arg (widget-get (cdr wid) :args))
-          (push (alist-get (enwc--str-to-sym (downcase (widget-get arg :tag))) 
init "")
-                act-init))
-        (setq init (nreverse act-init))))
-    (cons (cadr wid)
-          (append (pcase init
-                    (`req `(:required t :value ,(alist-get (car ent) sec-info 
"")))
-                    (`opt `(:value ,(alist-get (car ent) sec-info "")))
-                    (_ `(:value ,init)))
-                  (cddr wid)))))
-
-(defun enwc-create-template-menu (&optional sec-info)
-  "Create the widget declaration for the menu of templates.
-
-If specified, SEC-INFO is passed to the templates to initialize them."
-  `(menu-choice
-    :tag "Security"
-    :indent 2
-    ,@(mapcar
-       (lambda (tm)
-         `(list
-           :tag ,(symbol-name (car tm))
-           :menu-tag ,(symbol-name (car tm))
-           ,@(mapcar
-              (lambda (ent)
-                (enwc--get-supplicant-entry ent sec-info))
-              (cdr tm))))
-       enwc-supplicant-template-alist)))
-
-(defun enwc-display-sec-widget (&optional sec-info)
-  "Create the menu of security templates.
-If specified, SEC-INFO is passed to the templates to initialize them."
-  (widget-create (enwc-create-template-menu sec-info)))
-
-(defun enwc-sec-widget-data (widget)
-  "Get the data from a security widget WIDGET."
-  (let* ((type (widget-get (widget-get widget :choice) :tag))
-         (values (widget-value widget))
-         (template (assq (intern type) enwc-supplicant-template-alist)))
-    (unless template
-      (error "Unrecognized security template \"%s\"." type))
-    (setq template (cdr template))
-    (cons
-     `(sec-type . ,(intern type))
-     (cl-mapcar
-      (lambda (val v)
-        (let ((vl v))
-          (when (or (eq (car val) 'phase1)
-                    (eq (car val) 'phase2))
-            (let ((subs
-                   (mapcar
-                    (lambda (arg)
-                      (enwc--str-to-sym (downcase (widget-get arg :tag))))
-                    (widget-get (alist-get (car val) enwc-supplicant-alist) 
:args))))
-              (setq vl (cl-mapcar 'cons subs v))))
-          (print vl)
-          (cons (car val) vl)))
-      template values))))
-
-(defvar enwc-network-edit-widget nil
-  "The network information widget used in the edit buffer.")
-
-(defvar enwc-security-edit-widget nil
-  "The security widget used in the edit buffer.")
-
-(defun enwc-setup-edit-buffer ()
-  "Setup the edit buffer.  This removes the old one if neccessary,
-and redisplays the settings from the network profile
- with id `enwc-edit-id', which is set in `enwc-edit-entry-at-point'."
-  (when (get-buffer "*ENWC Edit*")
-    (kill-buffer "*ENWC Edit*"))
-  (with-current-buffer (get-buffer-create "*ENWC Edit*")
-    (let ((nw-info (enwc-get-profile-info enwc-edit-id)))
-
-      (widget-insert (concat "Settings for access point "
-                             (enwc-value-from-scan 'essid enwc-edit-id)
-                             "\n"))
-      (widget-insert "\n")
-      (setq enwc-network-edit-widget
-            (widget-create 'enwc-profile-props-widget :value nw-info))
-
-      (widget-insert "\n")
-      (setq enwc-security-edit-widget (enwc-display-sec-widget nw-info))
-
-      (use-local-map enwc-edit-map)
-      (widget-setup)))
-
-  (switch-to-buffer "*ENWC Edit*"))
-
-(defun enwc-edit-save ()
-  "Save the network settings from the edit buffer."
-  (interactive)
-  (unless (get-buffer "*ENWC Edit*")
-    (error "Not editing a network entry"))
-  (unless (eq (current-buffer) (get-buffer "*ENWC Edit*"))
-    (switch-to-buffer "*ENWC Edit*"))
-
-  (enwc-save-nw-settings
-   enwc-edit-id
-   (append (widget-value enwc-network-edit-widget)
-           (enwc-sec-widget-data enwc-security-edit-widget))))
-
-(defun enwc-edit-entry-at-point ()
-  "Edit the current network entry."
-  (interactive)
-  (setq enwc-edit-id (tabulated-list-get-id))
-  ;; TODO: Use pop-to-buffer
-  (enwc-setup-edit-buffer))
-
-(defvar enwc-edit-map
-  (let ((map (copy-keymap widget-keymap)))
-    (define-key map (kbd "C-x C-s") 'enwc-edit-save)
-    map)
-  "The keymap for editing network profiles with ENWC.")
-
-(defvar enwc-edit-field-map
-  (let ((map (copy-keymap widget-field-keymap)))
-    (define-key map (kbd "C-x C-a") 'enwc-edit-view-entry)
-    map)
-  "The keymap for editable fields within the ENWC edit buffer.")
-
-;;; enwc-edit.el ends here
diff --git a/packages/enwc/enwc-nm.el b/packages/enwc/enwc-nm.el
deleted file mode 100644
index 391f4ee..0000000
--- a/packages/enwc/enwc-nm.el
+++ /dev/null
@@ -1,725 +0,0 @@
-;;; enwc-nm.el - The NetworkManager backend to ENWC
-
-;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
-
-;; Author: Ian Dunn <dunni@gnu.org>
-;; Keywords: external, network, wicd, manager, nm
-;; Version: 2.0
-;; Homepage: https://savannah.nongnu.org/p/enwc
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-;; 02110-1301, USA.
-
-;;; Commentary:
-;;
-;;   This requires NetworkManager >= 0.9.6
-;;
-
-(require 'enwc-backend)
-(require 'enwc)
-(require 'dbus)
-(require 'subr-x)
-
-(defgroup enwc-nm nil
-  "*NetworkManager variables for ENWC"
-  :prefix "enwc-nm-"
-  :group 'enwc)
-
-(defcustom enwc-nm-dbus-service "org.freedesktop.NetworkManager"
-  "NetworkManager D-Bus service."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-path "/org/freedesktop/NetworkManager"
-  "The default D-Bus path for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-settings-path 
"/org/freedesktop/NetworkManager/Settings"
-  "The settings D-Bus path for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-interface "org.freedesktop.NetworkManager"
-  "The default D-Bus interface for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-wireless-interface 
"org.freedesktop.NetworkManager.Device.Wireless"
-  "The wireless D-Bus interface for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-wired-interface 
"org.freedesktop.NetworkManager.Device.Wired"
-  "The wired D-Bus interface for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-device-interface 
"org.freedesktop.NetworkManager.Device"
-  "The device D-Bus interface for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-accesspoint-interface 
"org.freedesktop.NetworkManager.AccessPoint"
-  "The access point D-Bus interface for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-settings-interface 
"org.freedesktop.NetworkManager.Settings"
-  "The settings D-Bus interface for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-connections-interface 
"org.freedesktop.NetworkManager.Settings.Connection"
-  "The connections D-Bus interface for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-(defcustom enwc-nm-dbus-active-interface 
"org.freedesktop.NetworkManager.Connection.Active"
-  "The active connection D-Bus interface for NetworkManager."
-  :group 'enwc-nm
-  :type 'string)
-
-;;TODO: Make this customizable.
-(defconst enwc-nm-dbus-settings-groups
-  '(("802-11-wireless-security" . ("name"
-                                   "key-mgmt"
-                                   "wep-tx-keyidx"
-                                   "auth-alg"
-                                   "proto"
-                                   "pairwise"
-                                   "group"
-                                   "leap-username"
-                                   "wep-key0"
-                                   "wep-key1"
-                                   "wep-key2"
-                                   "wep-key3"
-                                   "wep-key-type"
-                                   "psk"
-                                   "leap-password"))
-    ("ipv4" . ("addresses"
-               "dns"))))
-
-(defvar enwc-nm-wired-dev nil
-  "The wired device object path.")
-
-(defvar enwc-nm-wireless-dev nil
-  "The wireless device object path.")
-
-(defvar enwc-nm-active-ap nil
-  "The active access point object path.")
-
-(defvar enwc-nm-connecting-p nil
-  "Whether or not NetworkManager is connecting.")
-
-(defvar enwc-nm-wired-p nil
-  "Whether or not NetworkManager is wired.")
-
-(defvar enwc-nm-edit-info nil
-  "The information for the network connection being edited.")
-
-;; D-Bus Signals:
-
-(defvar enwc-nm-access-point-added-signal nil
-  "D-Bus signal object for the \"AccessPointAdded\" signal.")
-
-(defvar enwc-nm-access-point-removed-signal nil
-  "D-Bus signal object for the \"AccessPointRemoved\" signal.")
-
-(defvar enwc-nm-properties-changed-signal nil
-  "D-Bus signal object for the \"PropertiesChanged\" signal.")
-
-(defvar enwc-nm-wired-state-changed-signal nil
-  "D-Bus signal object for the \"StateChanged\" signal for the wired device.")
-
-(defvar enwc-nm-state-changed-signal nil
-  "D-Bus signal object for the \"StateChanged\" signal for the default path.")
-
-(defun enwc-nm-dbus-call-method (method &optional path interface &rest args)
-  (unless path (setq path enwc-nm-dbus-path))
-  (unless interface (setq interface enwc-nm-dbus-interface))
-  (apply 'dbus-call-method :system
-         enwc-nm-dbus-service
-         path
-         interface
-         method
-         :timeout 25000
-         args))
-
-(defun enwc-nm-dbus-default-call-method (method &rest args)
-  (apply 'enwc-nm-dbus-call-method method nil nil args))
-
-(defun enwc-nm-dbus-settings-call-method (method &rest args)
-  (apply 'enwc-nm-dbus-call-method
-         method
-         enwc-nm-dbus-settings-path
-         enwc-nm-dbus-settings-interface
-         args))
-
-(defun enwc-nm-dbus-wireless-call-method (method &rest args)
-  (apply 'enwc-nm-dbus-call-method
-         method
-         enwc-nm-wireless-dev
-         enwc-nm-dbus-wireless-interface
-         args))
-
-(defun enwc-nm-dbus-wired-call-method (method &rest args)
-  (apply 'enwc-nm-dbus-call-method
-         method
-         enwc-nm-wired-dev
-         enwc-nm-dbus-wired-interface
-         args))
-
-(defun enwc-nm-get-settings (conn)
-  "Get the connection settings from CONN."
-  (enwc-nm-dbus-call-method "GetSettings" conn
-                            enwc-nm-dbus-connections-interface))
-
-(defun enwc-nm-list-connections ()
-  "List the connections."
-  (enwc-nm-dbus-settings-call-method "ListConnections"))
-
-;; Default
-(defun enwc-nm-get-device-by-name (name)
-  (enwc-nm-dbus-default-call-method "GetDeviceByIpIface" :string name))
-
-(defun enwc-nm--ap-to-conn (nw)
-  "Get the connection that corresponds to NW."
-  (let ((ap-ssid (dbus-byte-array-to-string
-                  (enwc-nm-get-wireless-network-property nw "Ssid")))
-        (profile-table (make-hash-table :test #'equal)))
-    ;; Create a hash table of connections, indexed by ssid
-    ;; TODO: Store this somewhere else
-    (dolist (conn (enwc-nm-list-connections))
-      (let ((settings (enwc-nm-get-settings conn)))
-        (map-put profile-table
-                 (dbus-byte-array-to-string (enwc-nm-get-dbus-dict-entry
-                                             "802-11-wireless/ssid"
-                                             settings))
-                 conn)))
-    (map-elt profile-table ap-ssid)))
-
-(defun enwc-nm-connection-p (conn)
-  "Return non-nil if CONN is a connection object."
-  (and conn
-       (stringp conn)
-       (string-match "^/org/freedesktop/NetworkManager/Settings/[0-9]+$" 
conn)))
-
-(defun enwc-nm--profile-wired-p (conn)
-  "Return non-nil if CONN is a wired profile."
-  (let ((props (enwc-nm-get-settings conn)))
-    (string= (enwc-nm-get-dbus-dict-entry "connection/type" props)
-             "802-3-ethernet")))
-
-;;;;;;;;;;;;;;;;;;
-;; Get networks ;;
-;;;;;;;;;;;;;;;;;;
-
-(defun enwc-nm-get-networks (&optional wired)
-  (if wired
-      (enwc-nm-get-wired-profiles)
-    (enwc-nm-get-wireless-networks)))
-
-(defun enwc-nm-get-wireless-networks ()
-  "The NetworkManager get networks function.
-This returns a list of D-Bus paths to the access points."
-  (enwc-nm-dbus-wireless-call-method "GetAccessPoints"))
-
-(defun enwc-nm-get-wired-profiles ()
-  (let ((profs-list (enwc-nm-list-connections)))
-    (cl-remove-if-not #'enwc-nm--profile-wired-p profs-list)))
-
-;;;;;;;;;;;;;
-;; Connect ;;
-;;;;;;;;;;;;;
-
-(defun enwc-nm-connect (nw &optional wired)
-  "The NetworkManager connect function.
-This gets the connection path from NW, and connects to it."
-  (if wired
-      (enwc-nm-wired-connect nw)
-    (enwc-nm-wireless-connect nw)))
-
-(defun enwc-nm-wireless-connect (nw)
-  (when-let ((conn (enwc-nm--ap-to-conn nw)))
-    (enwc-nm-dbus-default-call-method "ActivateConnection"
-                                      :object-path conn
-                                      :object-path enwc-nm-wireless-dev
-                                      :object-path conn)))
-
-(defun enwc-nm-wired-connect (nw)
-  (enwc-nm-dbus-default-call-method "ActivateConnection"
-                                    :object-path nw
-                                    :object-path enwc-nm-wired-dev
-                                    :object-path nw))
-
-;;;;;;;;;;;;;;;;
-;; Disconnect ;;
-;;;;;;;;;;;;;;;;
-
-(defun enwc-nm-disconnect (&optional wired)
-  (if wired
-      (enwc-nm-wired-disconnect)
-    (enwc-nm-disconnect-wireless)))
-
-;; Device
-(defun enwc-nm-disconnect-wireless ()
-  (enwc-nm-dbus-call-method "Disconnect"
-                            enwc-nm-wireless-dev
-                            enwc-nm-dbus-device-interface))
-
-(defun enwc-nm-wired-disconnect ()
-  (enwc-nm-dbus-call-method "Disconnect"
-                            enwc-nm-wired-dev
-                            enwc-nm-dbus-device-interface))
-
-;;;;;;;;;;
-;; Scan ;;
-;;;;;;;;;;
-
-(defun enwc-nm-scan (&optional wired)
-  "The NetworkManager scan function."
-  (let ((dev (if wired
-                 enwc-nm-wired-dev
-               enwc-nm-wireless-dev))
-        (interface (if wired
-                       enwc-nm-dbus-wired-interface
-                     enwc-nm-dbus-wireless-interface)))
-    (enwc-nm-dbus-call-method "RequestScan"
-                              dev interface
-                              '(:array :signature "{sv}"))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Get network properties ;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-nm-get-wireless-network-property (nw prop)
-  "The NetworkManager get wireless network property function.
-This runs like normal, using element ID of `enwc-access-points'
- to determine the access point path, then obtains the property
-PROP from that access point.  It also sets the channel from the
- frequency if necessary."
-  (dbus-get-property :system
-                     enwc-nm-dbus-service
-                     nw
-                     enwc-nm-dbus-accesspoint-interface
-                     prop))
-
-(defun enwc-nm--freq-to-channel (freq)
-  "Convert a frequency FREQ into a channel."
-  (1+ (/ (- freq 2412) 5)))
-
-(defun enwc-nm-get-wireless-nw-props (nw)
-  "Get the network properties for the network NW."
-  (let ((props (dbus-get-all-properties :system
-                                        enwc-nm-dbus-service
-                                        nw
-                                        enwc-nm-dbus-accesspoint-interface)))
-
-    `((essid    . ,(dbus-byte-array-to-string (cdr (assoc "Ssid" props))))
-      (bssid    . ,(cdr (assoc "HwAddress" props)))
-      (strength . ,(cdr (assoc "Strength" props)))
-      (encrypt  . ,(or (enwc-nm-get-encryption-type nw) "Unsecured"))
-      (channel  . ,(enwc-nm--freq-to-channel
-                    (cdr (assoc "Frequency" props)))))))
-
-(defun enwc-nm-get-encryption-type (nw)
-  "The NetworkManager get encryption type function.
-This gets the WPA flags and RSN flags from access point in NW.
-If both are 0, then it returns WEP, otherwise WPA."
-  (let ((wpa-flags (enwc-nm-get-wireless-network-property nw "WpaFlags"))
-        (rsn-flags (enwc-nm-get-wireless-network-property nw "RsnFlags")))
-    (if (and (= wpa-flags 0) (= rsn-flags 0))
-        "WEP"
-      "WPA")))
-
-(defun enwc-nm-get-wired-nw-props (nw)
-  (let ((settings (enwc-nm-get-settings nw)))
-    `((name . ,(enwc-nm-get-dbus-dict-entry "connection/id" settings)))))
-
-(defun enwc-nm-get-nw-props (nw &optional wired-p)
-  (if wired-p
-      (enwc-nm-get-wired-nw-props nw)
-    (enwc-nm-get-wireless-nw-props nw)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Get Current network id ;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-nm-wireless-prop-changed (props)
-  "Called when network properties are changed.
-PROPS is a list of updated properties."
-  (let ((ap (assoc "ActiveAccessPoint" props)))
-    (when ap
-      (setq enwc-nm-active-ap (car (cadr ap))))))
-
-(defun enwc-nm-get-current-nw-id (wired)
-  "The NetworkManager get current network id function.
-This simply checks for the active access point."
-  (cond
-   (wired 'wired)
-   ((string= enwc-nm-active-ap "/") nil)
-   (t enwc-nm-active-ap)))
-
-(defun enwc-nm-prop-changed (state)
-  "Called when NetworkManager's state is changed.
-STATE is the new state
-
-If STATE is 40, then NetworkManager is connecting to a new AP."
-  (setq enwc-nm-connecting-p (eq state 40)))
-
-;;;;;;;;;;;;;;;;;;;;;;
-;; Check Connecting ;;
-;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-nm-check-connecting ()
-  "The NetworkManager check connecting function."
-  enwc-nm-connecting-p)
-
-(defun enwc-nm-dev-prop-changed (new-state old-state reason)
-  (setq enwc-nm-wired-p (eq new-state 100)))
-
-(defun enwc-nm-is-wired ()
-  enwc-nm-wired-p)
-
-;;;;;;;;;;;;;;;;;;;;;;
-;; Profile Handling ;;
-;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-nm-gen-uuid ()
-  "Generate a UUID."
-  (random t)
-  (apply 'format
-         "%04x%04x-%04x-%04x-%04x-%04x%04x%04x"
-         (mapcar (lambda (x)
-                   (random 65535))
-                 (number-sequence 0 7))))
-
-(defmacro enwc-nm--hex-substring (str st ed)
-  "Get a standard integer from hex string STR starting at ST and ending st ED"
-  `(string-to-number (substring ,str ,st ,ed) 16))
-
-(defun enwc-nm-convert-addr (addr)
-  "Convert an address ADDR from an integer in network byte order to a string."
-  (if (and addr (integerp addr))
-      (let* ((hex-addr (format "%08x" addr))
-             (subs (mapcar
-                    (lambda (n)
-                      (enwc-nm--hex-substring hex-addr n (+ n 2)))
-                    (number-sequence 6 0 -2))))
-        (apply 'format "%i.%i.%i.%i" subs))
-    ""))
-
-(defun enwc-nm-addr-back (addr)
-  "Convert an IP address ADDR in dots notation to an integer."
-  (cl-check-type addr string)
-  (let* ((bytes (split-string addr "\\."))
-         (byte-string (mapcar
-                       (lambda (n) (lsh (string-to-number (nth n bytes))
-                                   (* 8 n)))
-                       (number-sequence 0 3))))
-    (apply 'logior byte-string)))
-
-;; These next two come from libnm-util/nm-utils.c in NM's source.
-
-;; (defun enwc-nm-netmask-to-prefix (netmask)
-;;   "Convert a netmask to a CIDR prefix.
-;; NETMASK is an ip address in network byte order."
-;;   (if (and netmask (integerp netmask))
-;;       (progn
-;;         (setq netmask (enwc--htonl netmask))
-;;         (while (cl-evenp netmask)
-;;           (setq netmask (lsh netmask -1)))
-;;         (floor (log (1+ netmask) 2)))
-;;     0))
-
-;; (defun enwc-nm-prefix-to-netmask (prefix)
-;;   "Convert a CIDR prefix to a netmask.
-;; PREFIX is an integer <= 32."
-;;   (if (and prefix (integerp prefix))
-;;       (progn
-;;         (setq prefix (min prefix 32))
-;;         (enwc--htonl (lsh (1- (expt 2 prefix)) (- 32 prefix))))
-;;     0))
-
-;;;;;;;;;;;;;;;;;;;;;;
-;; D-Bus Conversion ;;
-;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-nm-get-dbus-dict-entry (entry dict)
-  "Get an entry ENTRY from D-Bus dictionary DICT.
-
-ENTRY is in the form LVL1/LVL2/.../LVLN, where each LVLi is a string
-representing another layer in the dictionary."
-  (cl-check-type entry string)
-  (cl-check-type dict list)
-  (let ((ent-strs (split-string entry "/"))
-        (cur-ent dict)
-        cur-str)
-    (while ent-strs
-      (setq cur-str (pop ent-strs))
-      (setq cur-ent (assoc cur-str cur-ent))
-      (when cur-ent
-        (setq cur-ent (cadr cur-ent))))
-    (when cur-ent (car cur-ent))))
-
-(defun enwc-nm--recurse-dbus-entry (dict value entries)
-  "Look in DICT for ENTRIES, and set the final one to VALUE."
-  (if (not entries)
-      (setcar dict value)
-    (let* ((cur-str (car entries))
-           (cur-ent (assoc cur-str dict)))
-      (unless cur-ent
-        (if (equal dict '(nil))
-            (setcar dict `(,cur-str (nil)))
-          (nconc dict `((,cur-str (nil)))))
-        (setq cur-ent (assoc cur-str dict)))
-      (enwc-nm--recurse-dbus-entry (cadr cur-ent) value (cdr entries)))))
-
-(defun enwc-nm-set-dbus-dict-entry (entry dict value)
-  "Set entry ENTRY in D-Bus dictionary DICT to VALUE."
-  (cl-check-type entry string)
-  (cl-check-type dict list)
-  (enwc-nm--recurse-dbus-entry dict value (split-string entry "/")))
-
-(defun enwc-nm-convert-dict-list (dict-ent settings)
-  "Convert a D-Bus dictionary entry DICT-ENT from SETTINGS to an alist."
-  (mapcar
-   (lambda (ent)
-     (cons
-      (intern (car ent))
-      (cl-caadr ent)))
-   (cadr (assoc dict-ent settings))))
-
-(defun enwc-nm-get-sec-info (settings)
-  "Get security information from SETTINGS."
-  (append
-   (enwc-nm-convert-dict-list "802-11-wireless-security" settings)
-   (enwc-nm-convert-dict-list "802-1x" settings)))
-
-(defun enwc-nm-pair-to-dbus-dict-ent (pair)
-  "Convert PAIR into a D-Bus dictionary entry."
-  (let ((str (car pair))
-        (var (cdr pair)))
-    `(:dict-entry (:string ,str :variant ,var))))
-
-(defun enwc-nm-alist-to-dbus-dict (alist)
-  "Convert ALIST into a D-Bus dictionary."
-  (let (dict)
-    (append
-     '(:array)
-     (dolist (pr alist dict)
-       (setq dict (apply 'list dict (enwc-nm-pair-to-dbus-dict-ent pr)))))))
-
-(defun enwc-nm-process-profile-info (settings prof-info)
-  (dolist (ent prof-info settings)
-    ;; Find the corresponding entry in settings, and set it to the new value.
-    ;; Check 802-11-wireless-security, then 802-1x, then ipv4.
-    (let ((ent-list '("802-11-wireless-security"
-                      "ipv4"))
-          cur-ent)
-      (while ent-list
-        (setq cur-ent (pop ent-list))
-        (when (enwc-nm-set-dbus-dict-entry (concat cur-ent "/"
-                                                   (symbol-name (car ent)))
-                                           settings
-                                           (cdr ent))
-          (setq ent-list nil))))))
-
-(defun enwc-nm-alist-to-dbus-str-str-var-map-map (alist)
-  (let (ret)
-    (dolist (ent alist ret)
-      (push `(:string (car ent) ,(enwc-nm-alist-to-dbus-dict (cadr ent))) ret)
-      (push :dict-entry ret))))
-
-;; (defun enwc-nm-get-profile-info (ap &optional wired)
-;;   "Get the profile info for access point AP."
-;;   (let ((conn (enwc-nm--ap-to-conn ap))
-;;         settings)
-;;     (when conn
-;;       (setq settings (enwc-nm-get-settings conn)))
-;;     (when settings
-;;       (let* ((adr-info (caar (enwc-nm-get-dbus-dict-entry "ipv4/addresses" 
settings)))
-;;              (ip-addr (enwc-nm-convert-addr (nth 0 adr-info)))
-;;              (netmask (enwc-nm-convert-addr (enwc-nm-prefix-to-netmask (nth 
1 adr-info))))
-;;              (gateway (enwc-nm-convert-addr (nth 2 adr-info)))
-;;              (dns-list (mapcar 'enwc-nm-convert-addr
-;;                                (car (enwc-nm-get-dbus-dict-entry "ipv4/dns"
-;;                                                                  
settings))))
-;;              (sec-info (enwc-nm-get-sec-info settings)))
-;;         `((addr . ,ip-addr)
-;;           (netmask . ,netmask)
-;;           (gateway . ,gateway)
-;;           (dns1    . ,(nth 0 dns-list))
-;;           (dns2    . ,(nth 1 dns-list))
-;;           ,@sec-info)))))
-
-(defun enwc-nm-finalize-settings (settings)
-  "Set up all of the D-BUS types of a settings list SETTINGS.
-This will place all of the necessary markers in the list, such as :array,
-:dict-entry, etc."
-  `(:array ,@(enwc-nm-alist-to-dbus-str-str-var-map-map settings)))
-
-(defun enwc-nm-setup-settings (conn settings wired)
-  "Set up NetworkManager settings.
-Get the current network properties of network CONN
-and uses the information in the association list SETTINGS
-to put it in the form that NetworkManager will recognize."
-  (let (conn-settings)
-    (if (enwc-nm-connection-p conn)
-        (setq conn-settings (enwc-nm-get-settings conn))
-      (message "Not a connection")
-      (print conn)
-      ;;TODO: ssid will be invalid for wired connections.
-      ;; This would actually throw an error in that case.
-      (let ((ssid (dbus-byte-array-to-string 
(enwc-nm-get-wireless-network-property
-                                              conn "Ssid")))
-            (type (if wired "802-3-ethernet" "802-11-wireless")))
-        (setq conn-settings `(("connection"
-                               (("id" (,(concat ssid " settings")))
-                                ("uuid" (,(enwc-nm-gen-uuid)))
-                                ("autoconnect" (nil))
-                                ("type" (,type))))))))
-    (setq conn-settings (enwc-nm-process-profile-info conn-settings settings))
-    (pp conn-settings)
-    (print conn-settings)
-    (enwc-nm-finalize-settings conn-settings)))
-
-(defun enwc-nm-save-nw-settings (ap settings wired)
-  "Save network AP with settings SETTINGS."
-  (let ((conn (enwc-nm--ap-to-conn ap)))
-    (print conn)
-    (if conn
-        (enwc-nm-dbus-call-method "Update"
-                                  conn
-                                  enwc-nm-dbus-connections-interface
-                                  (enwc-nm-setup-settings conn settings wired))
-      (enwc-nm-dbus-call-method "AddConnection"
-                                enwc-nm-dbus-settings-path
-                                enwc-nm-dbus-settings-interface
-                                (enwc-nm-setup-settings ap settings wired)))))
-
-
-                                        ; ;;;;;;;;;;;;;;;;; ;
-                                        ; ;; Load/Unload ;; ;
-                                        ; ;;;;;;;;;;;;;;;;; ;
-
-
-(defun enwc-nm-load ()
-  "Setup the NetworkManager back-end."
-  ;;TODO: Add way of changing these two after load.
-  (setq enwc-nm-wired-dev (enwc-nm-get-device-by-name enwc-wired-device)
-        enwc-nm-wireless-dev (enwc-nm-get-device-by-name enwc-wireless-device))
-
-  (setq enwc-nm-access-point-added-signal
-        (dbus-register-signal :system
-                              enwc-nm-dbus-service
-                              enwc-nm-wireless-dev
-                              enwc-nm-dbus-wireless-interface
-                              "AccessPointAdded"
-                              'enwc-process-scan))
-
-  (setq enwc-nm-access-point-removed-signal
-        (dbus-register-signal :system
-                              enwc-nm-dbus-service
-                              enwc-nm-wireless-dev
-                              enwc-nm-dbus-wireless-interface
-                              "AccessPointRemoved"
-                              'enwc-process-scan))
-
-  (setq enwc-nm-active-ap
-        (let ((cur-net (dbus-get-property :system
-                                          enwc-nm-dbus-service
-                                          enwc-nm-wireless-dev
-                                          enwc-nm-dbus-wireless-interface
-                                          "ActiveAccessPoint")))
-          (if (string= cur-net "/")
-              "/"
-            cur-net)))
-
-  (setq enwc-nm-properties-changed-signal
-        (dbus-register-signal :system
-                              enwc-nm-dbus-service
-                              enwc-nm-wireless-dev
-                              enwc-nm-dbus-wireless-interface
-                              "PropertiesChanged"
-                              'enwc-nm-wireless-prop-changed))
-
-  (setq enwc-nm-connecting-p
-        (let ((state (dbus-get-property :system
-                                        enwc-nm-dbus-service
-                                        enwc-nm-dbus-path
-                                        enwc-nm-dbus-interface
-                                        "State")))
-          (eq state 40)))
-
-  (setq enwc-nm-wired-state-changed-signal
-        (dbus-register-signal :system
-                              enwc-nm-dbus-service
-                              enwc-nm-wired-dev
-                              enwc-nm-dbus-device-interface
-                              "StateChanged"
-                              'enwc-nm-dev-prop-changed))
-
-  (setq enwc-nm-wired-p
-        (let ((state (dbus-get-property :system
-                                        enwc-nm-dbus-service
-                                        enwc-nm-wired-dev
-                                        enwc-nm-dbus-device-interface
-                                        "State")))
-          (eq state 100)))
-  (setq enwc-nm-state-changed-signal
-        (dbus-register-signal :system
-                              enwc-nm-dbus-service
-                              enwc-nm-dbus-path
-                              enwc-nm-dbus-interface
-                              "StateChanged"
-                              'enwc-nm-prop-changed)))
-
-(defun enwc-nm-unload ()
-  "Unload the NetworkManager back-end.
-
-Unregister all of the D-Bus signals set up during load."
-  (dbus-unregister-object enwc-nm-access-point-added-signal)
-  (dbus-unregister-object enwc-nm-access-point-removed-signal)
-  (dbus-unregister-object enwc-nm-properties-changed-signal)
-  (dbus-unregister-object enwc-nm-wired-state-changed-signal)
-  (dbus-unregister-object enwc-nm-state-changed-signal))
-
-(defun enwc-nm-can-load-p ()
-  ;; (dbus-ping :system enwc-nm-dbus-service)
-  ;; NetworkManager doesn't allow Ping, so we have to use an alternative.
-  (dbus-introspect :system enwc-nm-dbus-service enwc-nm-dbus-path))
-
-(enwc-register-backend
- (make-enwc-backend
-  :key 'nm
-  :can-load-p #'enwc-nm-can-load-p
-  :load #'enwc-nm-load
-  :unload #'enwc-nm-unload
-  :network-ids #'enwc-nm-get-networks
-  :scan #'enwc-nm-scan
-  :connect #'enwc-nm-connect
-  :disconnect #'enwc-nm-disconnect
-  :current-nw-id #'enwc-nm-get-current-nw-id
-  :is-connecting-p #'enwc-nm-check-connecting
-  :nw-props #'enwc-nm-get-nw-props
-  :is-wired-p #'enwc-nm-is-wired))
-
-(provide 'enwc-nm)
-
-;;; enwc-nm.el ends here
diff --git a/packages/enwc/enwc-test.el b/packages/enwc/enwc-test.el
deleted file mode 100644
index 5b3c6f1..0000000
--- a/packages/enwc/enwc-test.el
+++ /dev/null
@@ -1,66 +0,0 @@
-;;; enwc-test.el --- Tests for ENWC
-
-;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
-
-;; Author: Ian Dunn <dunni@gnu.org>
-;; Keywords: external, network, wicd, manager, nm
-;; Version: 2.0
-;; Package-Requires: ((emacs "25.1"))
-;; Homepage: https://savannah.nongnu.org/p/enwc
-
-;;; Commentary:
-
-;;; Code:
-
-(require 'enwc)
-(require 'ert)
-
-;; Test enwc-setup
-
-(ert-deftest enwc-test-select-interface-save ()
-  ;; Test saving the interfaces and using the ip selection back-end
-  (let ((enwc-interface-list-function 'enwc--ip-interface-list)
-        (enwc-ask-to-save-interfaces t)
-        ;; Temporarily save our changes to a different file
-        (custom-file (make-temp-file "enwc-custom-"))
-        (enwc-wired-device "")
-        (enwc-wireless-device ""))
-    (enwc--setup-select-interfaces)
-    (should (not (string-empty-p enwc-wired-device)))
-    (should (not (string-empty-p enwc-wireless-device)))
-    ;; Test whether the interfaces were saved
-    (let ((enwc-wired-device "")
-          (enwc-wireless-device ""))
-      (load custom-file)
-      (should (not (string-empty-p enwc-wired-device)))
-      (should (not (string-empty-p enwc-wireless-device))))
-    ;; Delete our temporary custom file
-    (delete-file custom-file)))
-
-(ert-deftest enwc-test-select-interface-no-save ()
-  ;; Test not saving the interfaces and using the ifconfig selection back-end
-  (let ((enwc-interface-list-function 'enwc--ifconfig-interface-list)
-        (enwc-ask-to-save-interfaces nil)
-        ;; Temporarily save our "changes" to a different file
-        (custom-file (make-temp-file "enwc-custom-"))
-        (enwc-wired-device "")
-        (enwc-wireless-device ""))
-    (enwc--setup-select-interfaces)
-    (should (not (string-empty-p enwc-wired-device)))
-    (should (not (string-empty-p enwc-wireless-device)))
-    ;; Test whether the interfaces were saved
-    (let ((enwc-wired-device "")
-          (enwc-wireless-device ""))
-      (load custom-file)
-      (should (string-empty-p enwc-wired-device))
-      (should (string-empty-p enwc-wireless-device)))
-    ;; Delete our temporary custom file
-    (delete-file custom-file)))
-
-(provide 'enwc-test)
-
-;; Local Variables:
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; enwc-test.el ends here
diff --git a/packages/enwc/enwc-wicd.el b/packages/enwc/enwc-wicd.el
deleted file mode 100644
index f0e157c..0000000
--- a/packages/enwc/enwc-wicd.el
+++ /dev/null
@@ -1,483 +0,0 @@
-;;; enwc-wicd.el --- The Wicd backend to ENWC
-
-;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
-
-;; Author: Ian Dunn <dunni@gnu.org>
-;; Keywords: external, network, wicd, manager, nm
-;; Version: 2.0
-;; Homepage: https://savannah.nongnu.org/p/enwc
-
-;; This file is part of GNU Emacs
-
-;; GNU Emacs 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 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-;; 02110-1301, USA.
-
-;;; Commentary:
-
-;; Wicd is one of the default supported back-ends for ENWC.
-
-;;; Code:
-
-(require 'enwc-backend)
-(require 'enwc)
-(require 'dbus)
-
-(defgroup enwc-wicd nil
-  "*Wicd variables for ENWC."
-  :prefix "enwc-wicd-"
-  :group 'enwc)
-
-(defcustom enwc-wicd-dbus-service "org.wicd.daemon"
-  "The wicd D-Bus service identifier."
-  :group 'enwc-wicd
-  :type 'string)
-
-(defcustom enwc-wicd-dbus-wireless-path "/org/wicd/daemon/wireless"
-  "The wicd wireless D-Bus path."
-  :group 'enwc-wicd
-  :type 'string)
-
-(defcustom enwc-wicd-dbus-wireless-interface "org.wicd.daemon.wireless"
-  "The wicd wireless D-Bus interface."
-  :group 'enwc-wicd
-  :type 'string)
-
-(defcustom enwc-wicd-dbus-wired-path "/org/wicd/daemon/wired"
-  "The wicd wired D-Bus path."
-  :group 'enwc-wicd
-  :type 'string)
-
-(defcustom enwc-wicd-dbus-wired-interface "org.wicd.daemon.wired"
-  "The wicd wired D-Bus interface."
-  :group 'enwc-wicd
-  :type 'string)
-
-(defvar enwc-wicd-details-list
-  '("essid" "bssid" "quality" "encryption" "channel")
-  "The list of the desired details to be obtained from each network.")
-
-(defvar enwc-wicd-current-ap ""
-  "Current access point.
-UNUSED")
-
-(defvar enwc-wicd-current-nw-id -1
-  "Id of the current network.
-UNUSED")
-
-(defvar enwc-wicd-end-scan-signal nil
-  "D-Bus signal object for the \"SendEndScanSignal\" signal.")
-
-(defvar enwc-wicd-status-changed-signal nil
-  "D-Bus signal objects for the \"StatusChanged\" signal.")
-
-(defun enwc-wicd-dbus-wireless-call-method (method &rest args)
-  "Calls D-Bus method METHOD with arguments ARGS within
-the wicd wireless interface."
-  (apply 'dbus-call-method :system
-         enwc-wicd-dbus-service
-         enwc-wicd-dbus-wireless-path
-         enwc-wicd-dbus-wireless-interface
-         method
-         :timeout 25000
-         args))
-
-(defun enwc-wicd-dbus-wired-call-method (method &rest args)
-  "Calls D-Bus method METHOD with arguments ARGS within
-the wicd wired interface."
-  (apply 'dbus-call-method :system
-         enwc-wicd-dbus-service
-         enwc-wicd-dbus-wired-path
-         enwc-wicd-dbus-wired-interface
-         method
-         :timeout 25000
-         args))
-
-;;;;;;;;;;
-;; Scan ;;
-;;;;;;;;;;
-
-(defun enwc-wicd-scan ()
-  "Wicd scan function."
-  (enwc-wicd-dbus-wireless-call-method "Scan"))
-
-;;;;;;;;;;;;;;;;;;
-;; Get networks ;;
-;;;;;;;;;;;;;;;;;;
-
-(defun enwc-wicd-get-networks (&optional wired)
-  (if wired
-      (enwc-wicd-get-wired-profiles)
-    (enwc-wicd-get-wireless-networks)))
-
-(defun enwc-wicd-get-wireless-networks ()
-  "Wicd get networks function.
-Just returns a number sequence."
-  (number-sequence 0 (1- (enwc-wicd-dbus-wireless-call-method 
"GetNumberOfNetworks"))))
-
-(defun enwc-wicd-get-wired-profiles ()
-  "Get the list of wired network profiles."
-  (enwc-wicd-dbus-wired-call-method "GetWiredProfileList"))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Get network properties ;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defvar enwc-wicd-prop-values nil)
-(defvar enwc-wicd-prop-num 0)
-(defvar enwc-wicd-prop-timeout 3)
-
-(defun enwc-wicd-nw-prop-handler (prop &rest args)
-  "The handler for `enwc-wicd-get-wireless-network-property'.
-This receives the value of network property PROP,
-and appends the value to `enwc-wicd-prop-values'."
-  (push (cons prop (car args)) enwc-wicd-prop-values)
-  (setq enwc-wicd-prop-num (1+ enwc-wicd-prop-num)))
-
-(defun enwc-wicd-prop-to-prop (prop)
-  "Convert a Wicd network property to an ENWC network property."
-  (cond
-   ((equal prop "essid") 'essid)
-   ((equal prop "bssid") 'bssid)
-   ((equal prop "quality") 'strength)
-   ((equal prop "encryption") 'encrypt)
-   ((equal prop "mode") 'mode)
-   ((equal prop "channel") 'channel)))
-
-(defun enwc-wicd-get-wireless-network-property (id prop)
-  "Wicd get wireless network property function.
-This calls the D-Bus method on Wicd to get the property PROP
-from wireless network with id ID."
-  (dbus-call-method-asynchronously :system
-                                   enwc-wicd-dbus-service
-                                   enwc-wicd-dbus-wireless-path
-                                   enwc-wicd-dbus-wireless-interface
-                                   "GetWirelessProperty"
-                                   `(lambda (x) (enwc-wicd-nw-prop-handler 
,prop x))
-                                   :timeout 1000
-                                   :int32 id
-                                   :string prop))
-
-(defun enwc-wicd-build-prop-list (prop-list det-list)
-  (mapcar
-   (lambda (det)
-     (let* ((cur-prop (assoc det prop-list))
-            (act-det (enwc-wicd-prop-to-prop det))
-            (act-prop (when cur-prop (cdr cur-prop))))
-       (when (or (string-equal det "essid")
-                 (string-equal det "channel"))
-         (setq act-prop (string-to-number cur-prop)))
-       (cons act-det act-prop)))
-   det-list))
-
-(defun enwc-wicd-get-wireless-nw-props (id)
-  "Get the network properties of a network.
-This function returns an associative list of properties
-for the network with id ID.
-For a list of properties, see `enwc-wicd-details-list'."
-  (setq enwc-wicd-prop-values nil)
-  (setq enwc-wicd-prop-num 0)
-  (dolist (x enwc-wicd-details-list)
-    (enwc-wicd-get-wireless-network-property id x))
-
-  (with-timeout (enwc-wicd-prop-timeout)
-    (while (< enwc-wicd-prop-num (length enwc-wicd-details-list))
-      (read-event nil nil 0.001)))
-
-  (if (assoc "encryption" enwc-wicd-prop-values)
-      (let ((enc-type (enwc-wicd-get-encryption-type id)))
-        (setcdr (assoc "encryption" enwc-wicd-prop-values)
-                (or enc-type "Unsecured")))
-    (setq enwc-wicd-prop-values
-          (cons (cons "encryption" "Unsecured")
-                enwc-wicd-prop-values)))
-
-  (enwc-wicd-build-prop-list enwc-wicd-prop-values enwc-wicd-details-list))
-
-(defalias 'enwc-wicd-get-wireless-network-props 
'enwc-wicd-get-wireless-nw-props)
-
-(defun enwc-wicd-get-encryption-type (id)
-  "Wicd get encryption type function.
-This calls the D-Bus method on Wicd to get the encryption_method
-property from wireless network with id ID."
-  (enwc-wicd-dbus-wireless-call-method "GetWirelessProperty"
-                                       id "encryption_method"))
-
-(defun enwc-wicd-get-wired-nw-prop (id det)
-  "Get property DET from the wired network with id ID."
-  (enwc-wicd-dbus-wired-call-method "GetWiredProperty" id det))
-
-(defun enwc-wicd-get-wired-nw-props (id)
-  ;; TODO Do wicd wired profiles have names?
-  (ignore id)
-  `((name . "Wired Profile")))
-
-(defun enwc-wicd-get-network-props (id &optional wired)
-  (if wired
-      (enwc-wicd-get-wired-nw-props id)
-    (enwc-wicd-get-wireless-network-props id)))
-
-;;;;;;;;;;;;;;;;;;;;;;;
-;; Connect Functions ;;
-;;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-wicd-connect (id &optional wired)
-  "Wicd connect function.
-This calls the D-Bus method on Wicd to connect to a
-wired or wireless network with id ID."
-  (if wired
-      (enwc-wicd-wired-connect id)
-    (enwc-wicd-dbus-wireless-call-method "ConnectWireless" id)))
-
-(defun enwc-wicd-wireless-connect (id)
-  "Wicd connect function.
-This calls the D-Bus method on Wicd to connect to a
-wireless network with id ID."
-  (enwc-wicd-dbus-wireless-call-method "ConnectWireless" id))
-
-(defun enwc-wicd-wired-connect (id)
-  "Connect to the wired network with profile id ID."
-  (let* ((profs (enwc-wicd-get-wired-profiles))
-         (prf (nth id profs)))
-    (enwc-wicd-dbus-wired-call-method "ReadWiredNetworkProfile" prf)
-    (enwc-wicd-dbus-wired-call-method "ConnectWired")))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Disconnect functions ;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-wicd-disconnect (&optional wired)
-  (if wired
-      (enwc-wicd-wired-disconnect)
-    (enwc-wicd-wireless-disconnect)))
-
-(defun enwc-wicd-wireless-disconnect ()
-  "Wicd disconnect function."
-  (enwc-wicd-dbus-wireless-call-method "DisconnectWireless"))
-
-(defun enwc-wicd-wired-disconnect ()
-  "Disconnect from the wired connection."
-  (enwc-wicd-dbus-wired-call-method "DisconnectWired"))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Get current network id ;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-wicd-get-current-nw-id (wired-p)
-  "Wicd get current network id function.
-The current network id is updated upon connect,
-so this jut returns the tracked network id."
-  (let ((ap (enwc-wicd-dbus-wireless-call-method "GetCurrentNetworkID")))
-    (cond
-     (wired-p 'wired)
-     ((< ap 0) nil)
-     (t ap))))
-
-;;;;;;;;;;;;;;;;;;;;;;
-;; Check Connecting ;;
-;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-wicd-check-connecting ()
-  "Return non-nil if currently connecting to a network."
-  (enwc-wicd-dbus-wireless-call-method "CheckIfWirelessConnecting"))
-
-;;;;;;;;;;;;;
-;; Is Wired
-;;;;;;;;;;;;;
-
-(defun enwc-wicd-is-wired ()
-  "Return non-nil if connected to a wired network."
-  (not (not (enwc-wicd-dbus-wired-call-method "GetWiredIP"))))
-
-;;;;;;;;;;;;;;;;;;;;;;
-;; Get Profile Info ;;
-;;;;;;;;;;;;;;;;;;;;;;
-
-;; (defun enwc-wicd-get-profile-ent (id ent wired)
-;;   "Get profile entry ENT from the network with id ID.
-;; WIRED is set to indicate whether this is a wired network.
-;; This function is a wrapper around the *-get-(wired|wireless)-nw-prop
-;; functions, allowing for a single function that checks for wired."
-;;   (if wired
-;;       (enwc-wicd-get-wired-nw-prop id ent)
-;;     (enwc-wicd-dbus-wireless-call-method "GetWirelessProperty" id ent)))
-
-;; (defun enwc-wicd-get-profile-info (id &optional wired)
-;;   "Get the profile for profile ID.
-;; WIRED is set to indicate whether this is a wired network."
-;;   (let ((dns-list (enwc-wicd-get-dns id wired))
-;;         (sec-info (enwc-wicd-get-profile-sec-info id wired)))
-;;     `((addr . ,(enwc-wicd-get-ip-addr id wired))
-;;       (netmask . ,(enwc-wicd-get-netmask id wired))
-;;       (gateway . ,(enwc-wicd-get-gateway id wired))
-;;       (dns1 . ,(nth 0 dns-list))
-;;       (dns2 . ,(nth 1 dns-list))
-;;       ,@sec-info)))
-
-;; (defun enwc-wicd-get-profile-sec-info (id &optional wired)
-;;   "Get the security info for profile with id ID.
-;; WIRED is set to indicate whether this is a wired network."
-;;   (remq nil
-;;    (mapcar
-;;     (lambda (ent)
-;;       (let ((info (enwc-wicd-get-profile-ent wired id (symbol-name (car 
ent)))))
-;;         (if info
-;;             (cons (car ent) info)
-;;           nil)))
-;;     enwc-supplicant-alist)))
-
-;; (defun enwc-wicd-get-ip-addr (id wired)
-;;   "Get the IP Address from the network with id ID.
-;; Wired is set to indicate whether this is a wired network."
-;;   (or (enwc-wicd-get-profile-ent id "ip" wired) ""))
-
-;; (defun enwc-wicd-get-netmask (id wired)
-;;   "Get the Netmask from the network with id ID.
-;; WIRED is set to indicate whether this is a wired network."
-;;   (or (enwc-wicd-get-profile-ent id "netmask" wired) ""))
-
-;; (defun enwc-wicd-get-gateway (id wired)
-;;   "Get the Gateway from the network with id ID.
-;; WIRED is set to indicate whether this is a wired network."
-;;   (or (enwc-wicd-get-profile-ent id "gateway" wired) ""))
-
-;; (defun enwc-wicd-get-dns (id wired)
-;;   "Get the list of DNS servers from the network with id ID.
-;; WIRED is set to indicate whether this is a wired network."
-;;   (list (or (enwc-wicd-get-profile-ent id "dns1" wired) "")
-;;         (or (enwc-wicd-get-profile-ent id "dns2" wired) "")
-;;         (or (enwc-wicd-get-profile-ent id "dns3" wired) "")))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Save Network Settings ;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-wicd-set-nw-prop (wired id prop val)
-  "Set the network property PROP of the network with id ID
-to VAL.
-WIRED indicates whether this is a wired network."
-  (if wired
-      (enwc-wicd-dbus-wired-call-method "SetWiredProperty"
-                                        id prop val)
-    (enwc-wicd-dbus-wireless-call-method "SetWirelessProperty"
-                                         id prop val)))
-
-(defun enwc-wicd-save-nw-profile (wired id)
-  "Save the network profile with for the network with id ID.
-WIRED indicates whether this is a wired network."
-  (if wired
-      (enwc-wicd-dbus-wired-call-method "SaveWiredNetworkProfile" id)
-    (enwc-wicd-dbus-wireless-call-method "SaveWirelessNetworkProfile" id)))
-
-(defun enwc-wicd--phase-to-string (phase)
-  "Convert a list of phase settings PHASE into a string.
-
-The format of this string is \"ENT0=VAL0 ENT1=VAL1 ... ENTN=VALN\",
-for each entry in PHASE."
-  (mapconcat
-   (lambda (ent)
-     (format "%s=%s" (car ent) (cdr ent)))
-   phase " "))
-
-(defun enwc-wicd-save-nw-settings (id settings &optional wired)
-  "Set the settings for network ID to SETTINGS and save the profile.
-The association list SETTINGS contains the settings for the network.
-WIRED indicates whether or not ID is a wired connection."
-  (dolist (setting settings)
-    (let (key ent)
-      ;; There are four special cases in here:
-      ;;  1. IP Address, which has a different key.
-      ;;  2. Encryption type, which has a different key and value.
-      ;;  3,4. Phases, both of which need to have their results concatenated.
-      (pcase (car setting)
-        ('addr (setq key "ip"
-                     ent (cdr setting)))
-        ('sec-type (setq key "enctype"
-                         ent (if (cdr setting)
-                                 (symbol-name (cdr setting))
-                               "None")))
-        ('phase1 (setq key "phase1"
-                       ent (enwc-wicd--phase-to-string (cdr setting))))
-        ('phase2 (setq key "phase2"
-                       ent (enwc-wicd--phase-to-string (cdr setting))))
-        (_ (setq key (symbol-name (car setting))
-                 ent (or (cdr setting) ""))))
-      (enwc-wicd-set-nw-prop wired id key ent)))
-
-  (enwc-wicd-save-nw-profile wired id))
-
-(defun enwc-wicd-wireless-prop-changed (state info)
-  "Callback for when the network status changes."
-  (when state
-    (if (eq state 0)
-        (setq enwc-wicd-current-ap ""
-              enwc-wicd-current-nw-id nil)
-      (setq enwc-wicd-current-ap (car (cadr info))
-            enwc-wicd-current-nw-id (and info
-                                         (nthcdr 3 info)
-                                         (caar (nthcdr 3 info))
-                                         (string-to-number (caar (nthcdr 3 
info))))))))
-
-
-; ;;;;;;;;;;;;;;;;; ;
-; ;; Load/Unload ;; ;
-; ;;;;;;;;;;;;;;;;; ;
-
-(defun enwc-wicd-load ()
-  "Load the Wicd backend."
-  ;; Thanks to Michael Albinus for pointing out this signal.
-  (setq enwc-wicd-end-scan-signal
-        (dbus-register-signal :system
-                              enwc-wicd-dbus-service
-                              enwc-wicd-dbus-wireless-path
-                              enwc-wicd-dbus-wireless-interface
-                              "SendEndScanSignal"
-                              'enwc-process-scan))
-
-  (setq enwc-wicd-status-changed-signal
-        (dbus-register-signal :system
-                              enwc-wicd-dbus-service
-                              "/org/wicd/daemon"
-                              enwc-wicd-dbus-service
-                              "StatusChanged"
-                              'enwc-wicd-wireless-prop-changed)))
-
-(defun enwc-wicd-unload ()
-  "Unload the Wicd back-end.
-
-Unregister all of the D-Bus signals set up during load."
-  (dbus-unregister-object enwc-wicd-end-scan-signal)
-  (dbus-unregister-object enwc-wicd-status-changed-signal))
-
-(defun enwc-wicd-can-load-p ()
-  (dbus-ping :system enwc-wicd-dbus-service))
-
-(enwc-register-backend
- (make-enwc-backend
-  :key 'enwc
-  :can-load-p #'enwc-wicd-can-load-p
-  :load #'enwc-wicd-load
-  :unload #'enwc-wicd-unload
-  :network-ids #'enwc-wicd-get-networks
-  :scan #'enwc-wicd-scan
-  :connect #'enwc-wicd-connect
-  :disconnect #'enwc-wicd-disconnect
-  :current-nw-id #'enwc-wicd-get-current-nw-id
-  :is-connecting-p #'enwc-wicd-check-connecting
-  :nw-props #'enwc-wicd-get-network-props
-  :is-wired-p #'enwc-wicd-is-wired))
-
-(provide 'enwc-wicd)
-
-;;; enwc-wicd.el ends here.
diff --git a/packages/enwc/enwc.el b/packages/enwc/enwc.el
deleted file mode 100644
index 088f340..0000000
--- a/packages/enwc/enwc.el
+++ /dev/null
@@ -1,835 +0,0 @@
-;;; enwc.el --- The Emacs Network Client
-
-;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
-
-;; Author: Ian Dunn <dunni@gnu.org>
-;; Keywords: external, network, wicd, manager, nm
-;; Version: 2.0
-;; Package-Requires: ((emacs "25.1"))
-;; Homepage: https://savannah.nongnu.org/p/enwc
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-;; 02110-1301, USA.
-
-;;; Commentary:
-;;
-;; ENWC is the Emacs Network Client.  It is designed to provide a front-end to
-;; various network managers, such as NetworkManager and Wicd.
-;;
-;; Currently, only NetworkManager and Wicd are supported, although experimental
-;; support exists for Connman.
-;;
-;; In order to use this package, add
-;;
-;; (setq enwc-default-backend BACKEND-SYMBOL)
-;;
-;; where BACKEND-SYMBOL is either 'wicd or 'nm, to your .emacs file (or other 
init
-;; file).
-;;
-;; Then you can just run `enwc' to start everything.
-;;
-;; Example:
-;;
-;; (setq enwc-default-backend 'nm)
-
-;;; TODO:
-;;
-;; - Add hooks for scan completion, and possibly upon network connection.
-
-;;; Code:
-
-(require 'enwc-backend)
-
-(require 'tabulated-list)
-(require 'cl-lib)
-(require 'cl-macs)
-(require 'format-spec)
-
-(require 'map)
-(require 'seq)
-
-(defgroup enwc nil
-  "*The Emacs Network Client"
-  :prefix "enwc-"
-  :group 'external)
-
-(defcustom enwc-wireless-device ""
-  "The wireless device/interface to use for ENWC.
-
-If this is unset when `enwc-setup' is called, the user will be
-prompted for an interface."
-  :group 'enwc
-  :type 'string)
-
-(defcustom enwc-wired-device ""
-  "The wired device/interface to use for ENWC.
-
-If this is unset when `enwc-setup' is called, the user will be
-prompted for an interface."
-  :group 'enwc
-  :type 'string)
-
-(defcustom enwc-display-mode-line t
-  "Non-nil means display network information in the mode line.
-The specific information can be set using `enwc-mode-line-format'."
-  :group 'enwc
-  :type 'boolean)
-
-(defcustom enwc-enable-auto-scan-on-startup nil
-  "Whether to enable auto-scan during `enwc-setup'.
-
-If non-nil, ENWC will automatically scan for networks every
-`enwc-auto-scan-interval' seconds.
-
-To enable auto-scan after startup, use `enwc-enable-auto-scan'."
-  :group 'enwc
-  :type 'boolean)
-
-(defvar enwc--auto-scan nil
-  "Current state of auto-scan.
-
-To enable auto-scan, use `enwc-enable-auto-scan'.
-
-To enable auto-scan at startup, set
-`enwc-enable-auto-scan-on-startup'.")
-
-(defcustom enwc-auto-scan-interval 20
-  "The interval between automatic scans.
-
-To make any changes to this variable take effect outside of the
-customization interface, use `enwc-restart-auto-scan'."
-  :group 'enwc
-  :type 'integer)
-
-(defcustom enwc-mode-line-format " [%s%%] "
-  "The format for displaying information in the mode line.
-
-The following format specifiers display information about the
-current wireless connection:
-
-%s = signal strength
-
-%e = essid
-
-%b = bssid
-
-%n = encryption type
-
-%c = channel
-
-When a wired connection is active, signal strength is 100, essid
-and bssid are \"Wired\", and encryption and channel are \"None\".
-
-The following format specifiers are also significant:
-
-%% = A Normal '%'"
-  :group 'enwc
-  :type 'string)
-
-(defcustom enwc-warn-if-already-setup t
-  "Whether to warn the user if ENWC is already setup when calling 
`enwc-setup'."
-  :group 'enwc
-  :type 'boolean)
-
-(defcustom enwc-ask-to-save-interfaces t
-  "Whether to ask about saving changes to the network interfaces during 
`enwc-setup'."
-  :group 'enwc
-  :type 'boolean)
-
-(defvar enwc-display-string " [0%] "
-  "The mode line display string.
-
-This is updated after every scan using `enwc-update-mode-line'.")
-
-(defun enwc--print-strength (s)
-  "Convert signal strength S to a string to dispay."
-  (format "%s%%" s))
-
-(defmacro enwc--make-number-sorter (n)
-  `(lambda (a b)
-     (let ((act-a (aref (nth 1 a) ,n))
-           (act-b (aref (nth 1 b) ,n)))
-       (< act-a act-b))))
-
-(defalias 'enwc--str-sorter (enwc--make-number-sorter 0))
-(defalias 'enwc--chnl-sorter (enwc--make-number-sorter 4))
-
-(cl-defstruct enwc-column-spec ()
-  detail display sorter width conv)
-
-(defvar enwc-wireless-column-specs
-  (list
-   (make-enwc-column-spec
-    :detail 'strength
-    :display "Str"
-    :sorter #'enwc--str-sorter
-    :conv #'enwc--print-strength)
-   (make-enwc-column-spec
-    :detail 'essid
-    :display "Essid"
-    :sorter t
-    :conv #'identity)
-   (make-enwc-column-spec
-    :detail 'encrypt
-    :display "Encrypt"
-    :sorter t
-    :conv #'identity)
-   (make-enwc-column-spec
-    :detail 'bssid
-    :display "Bssid"
-    :sorter t
-    :conv #'identity)
-   (make-enwc-column-spec
-    :detail 'channel
-    :display "Channel"
-    :sorter #'enwc--chnl-sorter
-    :conv #'number-to-string)))
-
-(defvar enwc-wired-column-specs
-  (list
-   (make-enwc-column-spec
-    :detail 'name
-    :display "Profile"
-    :sorter t
-    :conv #'identity)))
-
-(defvar enwc-column-specs enwc-wireless-column-specs
-  "Specifications for each column in the display.
-
-This should always be set to the value of either
-`enwc-wireless-column-specs' or `enwc-wired-column-specs'.")
-
-(defvar enwc--last-scan-results (make-hash-table :test #'equal)
-  "The most recent scan results.
-
-This will be an association list of the form:
-
-((ID . ((strength . STRENGTH) (essid . ESSID) ...)) ...)
-
-The form will be different when wired is enabled (see
-`enwc-using-wired').  This will have the form:
-
-((ID . ((name . PROFILE-NAME))) ...)
-
-Each ID is a backend-specific network ID.
-
-Each key in the children association lists corresponds to an entry in
-`enwc-column-specs'.")
-
-(defvar enwc-access-points nil
-  "The most recent access point list.")
-
-(defvar enwc-using-wired nil
-  "Non-nil means ENWC is using wired connections.
-
-Note that this is NOT the same as `enwc-is-wired-p'.  This
-variable indicates whether ENWC itself is in wired mode.")
-
-(defvar enwc-edit-id nil
-  "This is the network id of the network being edited.")
-
-(defvar enwc-scan-requested nil
-  "This is non-nil when a scan has been requested.
-This is used so as to avoid multiple updates of the scan data.")
-
-(defvar enwc-scan-interactive nil
-  "This is non-nil that a scan was interactively requested.
-This is only used internally.")
-
-(defvar enwc-scan-timer nil
-  "The timer for automatic scanning.")
-
-(make-local-variable 'enwc-edit-id)
-
-;; The Faces
-
-(defface enwc-header
-  '((((class color) (background light))
-     (:foreground "Blue"))
-    (((class color) (background dark))
-     (:foreground "Blue"))
-    (t (:background "Blue")))
-  "The face for the headers."
-  :group 'enwc)
-
-(defface enwc-connected
-  '((((class color) (background dark))
-     (:foreground "Green"))
-    (((class color) (background light))
-     (:foreground "Green"))
-    (t (:background "Green")))
-  "The face for the connected network."
-  :group 'enwc)
-
-;;;;;;;;;;;;;;;;;;;;
-;; ENWC functions ;;
-;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-get-networks ()
-  "Get the identifiers for the access points
-from a previous scan."
-  (enwc--network-ids enwc--current-backend enwc-using-wired))
-
-(defun enwc-request-scan ()
-  "Request a backend scan."
-  (setq enwc-scan-requested t)
-  (enwc--scan enwc--current-backend))
-
-(defun enwc-connect (id)
-  "Connect to network with id ID.
-
-ID is specific to the backend."
-  (enwc--connect enwc--current-backend id enwc-using-wired))
-
-(defun enwc-disconnect ()
-  "Disconnect from the current network."
-  (enwc--disconnect enwc--current-backend enwc-using-wired))
-
-(defun enwc-get-current-nw-id ()
-  "Get the id of the current network id,
-or nil if there isn't one.
-
-The returned id is specific to the backend."
-  (enwc--current-nw-id enwc--current-backend enwc-using-wired))
-
-(defun enwc-check-connecting-p ()
-  "Check to see if there is a connection in progress.
-Returns `non-nil' if there is one, nil otherwise."
-  (enwc--is-connecting-p enwc--current-backend))
-
-(defun enwc-get-nw-props (id)
-  "Get the network properties of the wireless network with id ID.
-This will return an associative list with the keys
-corresponding to `enwc-column-specs'.
-
-ID is specific to the backend."
-  (enwc--nw-props enwc--current-backend id enwc-using-wired))
-
-(defun enwc-is-wired-p ()
-  "Check whether or not ENWC is connected to a wired network.
-Note that this is NOT the same as `enwc-using-wired'.
-This checks for an active wired connection."
-  (enwc--is-wired-p enwc--current-backend))
-
-;;;;;;;;;;;;;;;;;;;;;;
-;; Actual Functions ;;
-;;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-connected-to-network-p ()
-    (enwc-is-valid-nw-id-p (enwc-get-current-nw-id)))
-
-(defun enwc-is-valid-nw-id-p (id)
-  "Confirm that ID is a valid network id."
-  (and id (not (eq id 'wired))))
-
-(defun enwc-value-from-scan (detail &optional id)
-  "Retrieve a value for DETAIL from `enwc--last-scan-results'.
-If ID is specified, then it will get the entry for ID.
-Otherwise, ID is set to the current network ID.
-
-If DETAIL is not found in `enwc--last-scan-results', then return nil."
-  (setq id (or id (enwc-get-current-nw-id)))
-  (when enwc--last-scan-results
-    (map-nested-elt enwc--last-scan-results `(,id ,detail))))
-
-(defun enwc-make-format-spec ()
-  "Create a format specification for the mode line string."
-  ;; Variables here are cached to avoid latencies when communicating with 
D-Bus.
-  (let* ((cur-id (enwc-get-current-nw-id))
-         (wiredp (enwc-is-wired-p))
-         (no-last (not enwc--last-scan-results))
-         (invalid-id (not (enwc-is-valid-nw-id-p cur-id)))
-         (connectingp (enwc-check-connecting-p)))
-    (format-spec-make ?s (cond
-                          (wiredp "100")
-                          ((or invalid-id no-last) "0")
-                          (connectingp "*")
-                          (t (enwc-value-from-scan 'strength cur-id)))
-                      ?e (cond
-                          (wiredp "Wired")
-                          ((or invalid-id connectingp no-last) "None")
-                          (t (enwc-value-from-scan 'essid cur-id)))
-                      ?b (cond
-                          (wiredp "Wired")
-                          ((or invalid-id connectingp no-last) "none")
-                          (t (enwc-value-from-scan 'bssid cur-id)))
-                      ?n (cond
-                          (wiredp "None")
-                          ((or invalid-id connectingp no-last) "None")
-                          (t (enwc-value-from-scan 'encrypt cur-id)))
-                      ?c (cond
-                          (wiredp "None")
-                          ((or invalid-id connectingp no-last) "None")
-                          (t (enwc-value-from-scan 'channel cur-id)))
-                      ?% "%")))
-
-(defun enwc-format-mode-line-string ()
-  "Format the mode line string.
-This is derived from `enwc-mode-line-format'.
-See the documentation for it for more details."
-  (format-spec enwc-mode-line-format (enwc-make-format-spec)))
-
-(defun enwc-update-mode-line ()
-  "Update the mode line display.
-This uses the format specified by `enwc-mode-line-format'.
-This is initiated during setup, and runs once every second."
-  (when enwc-display-mode-line
-    (setq enwc-display-string (enwc-format-mode-line-string))
-    (force-mode-line-update)))
-
-(defun enwc-enable-display-mode-line ()
-  "Enable the mode line display."
-  (interactive)
-  (or global-mode-string (setq global-mode-string '("")))
-  (setq enwc-display-mode-line t)
-  (unless (member 'enwc-display-string global-mode-string)
-    (setq global-mode-string (append global-mode-string 
'(enwc-display-string))))
-  (message "ENWC mode line enabled"))
-
-(defun enwc-disable-display-mode-line ()
-  "Disable the mode line display."
-  (interactive)
-  (or global-mode-string (setq global-mode-string '("")))
-  (setq enwc-display-mode-line nil)
-  (setq global-mode-string (remove 'enwc-display-string global-mode-string))
-  (message "ENWC mode line disabled"))
-
-(defun enwc-toggle-display-mode-line ()
-  "Toggles the mode line display."
-  (interactive)
-  (if (not enwc-display-mode-line)
-      (enwc-enable-display-mode-line)
-    (enwc-disable-display-mode-line)))
-
-(defun enwc-enable-auto-scan ()
-  "Enable auto scanning."
-  (interactive)
-  (if (or (not (numberp enwc-auto-scan-interval))
-          (< enwc-auto-scan-interval 0))
-      (message "Unable to start ENWC auto-scan with invalid scan \
-interval - Got %s, but need positive number" enwc-auto-scan-interval)
-    (unless enwc-scan-timer
-      (setq enwc-scan-timer
-            (run-at-time t enwc-auto-scan-interval 'enwc-scan t)))
-    (setq enwc--auto-scan t)
-    (message "Auto-scan enabled")))
-
-(defun enwc-disable-auto-scan ()
-  "Disable auto scanning."
-  (interactive)
-  (when enwc-scan-timer (cancel-timer enwc-scan-timer))
-  (setq enwc--auto-scan nil)
-  (message "Auto scan disabled"))
-
-(defun enwc-toggle-auto-scan ()
-  "Toggles automatic scanning.
-This will use the current value of `enwc-auto-scan-interval'."
-  (interactive)
-  (if enwc--auto-scan
-      (enwc-disable-auto-scan)
-    (enwc-enable-auto-scan)))
-
-(defun enwc-restart-auto-scan ()
-  "Restart automatic scanning."
-  (interactive)
-  (enwc-disable-auto-scan)
-  (enwc-enable-auto-scan))
-
-;;;;;;;;;;;;;;;;;;;
-;; Scan internal ;;
-;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-scan (&optional nodisp)
-  "The frontend of the scanning routine.
-Set up and move to the ENWC buffer if necessary, and scan and display the
- networks.  If NODISP is `non-nil', then do not display the results in the ENWC
-buffer."
-  (interactive)
-  (unless nodisp
-    (setq enwc-scan-interactive t)
-    (enwc-ensure-buffer))
-  (with-current-buffer "*ENWC*"
-    (enwc-scan-internal)))
-
-(defun enwc-scan-internal ()
-  "The entry point for the internal scan routines.
-This checks whether or not wired is being used, and runs the appropriate
-function.
-
-If wireless is used, a scan is requested.  All back-ends must
-call `enwc-process-scan' in some way upon completion of a
-wireless scan.
-
-A wired scan displays the available wired profiles."
-  (when enwc-scan-interactive
-    (message "Scanning..."))
-
-  (if enwc-using-wired
-      (enwc-process-scan)
-    (enwc-request-scan)))
-
-(defun enwc--update-scan-results ()
-  (setq enwc--last-scan-results (make-hash-table :test #'equal))
-  (dolist (ap (enwc-get-networks))
-    (puthash ap (enwc-get-nw-props ap) enwc--last-scan-results)))
-
-(defun enwc-redisplay-networks ()
-  (interactive)
-  (enwc--update-scan-results)
-  (enwc-display-networks enwc--last-scan-results)
-  (enwc-update-mode-line))
-
-(defun enwc-process-scan (&rest args)
-  "The scanning callback.
-After a scan has been performed, this processes and displays the scan results.
-
-ARGS is only for compatibility with the calling function."
-  (when enwc-scan-requested
-    (setq enwc-scan-requested nil)
-    (when enwc-scan-interactive
-      (message "Scanning... Done"))
-    (enwc-redisplay-networks)
-    (setq enwc-scan-interactive nil)))
-
-;;;;;;;;;;;;;;;;;;;;;;
-;; Display Networks ;;
-;;;;;;;;;;;;;;;;;;;;;;
-
-(cl-defun enwc-refresh-widths (&optional (networks enwc--last-scan-results))
-  "Refresh the column widths for display."
-  (setq enwc-column-specs
-        (mapcar
-         (lambda (spec)
-           (pcase-let* (((cl-struct enwc-column-spec detail display conv) spec)
-                        (new-max (if (mapp networks)
-                                     (seq-max
-                                      (map-apply
-                                       (lambda (id nw)
-                                         (length (funcall conv (alist-get 
detail nw))))
-                                       networks))
-                                   0))
-                        (min-width (+ (length display) 2)))
-             (setf (enwc-column-spec-width spec) (max new-max min-width)))
-           spec)
-         enwc-column-specs)))
-
-(defun enwc--get-details (network-entry)
-  (mapcar
-   (lambda (detail)
-     (alist-get (enwc-column-spec-detail detail) network-entry))
-   enwc-column-specs))
-
-(defun enwc--tabulated-list-entries ()
-  (map-apply
-   (lambda (id nw) (list id (vconcat (enwc--get-details nw))))
-   enwc--last-scan-results))
-
-(defun enwc--tabulated-list-printer (id cols)
-  "Print the row ID with column values COL."
-  (let ((cur-id (enwc-get-current-nw-id)))
-    (tabulated-list-print-entry
-     id
-     (vconcat
-      (seq-map-indexed
-       (lambda (col idx)
-         (let* ((detail (nth idx enwc-column-specs))
-                (conv   (funcall (enwc-column-spec-conv detail) col)))
-           (if (equal cur-id id)
-               (propertize conv 'font-lock-face 'enwc-connected)
-             conv)))
-       cols)))))
-
-(defun enwc-display-networks (networks)
-  "Displays the network in NETWORKS.
-This is an entry to the display functions, and checks whether or not ENWC is
- using wired."
-  (enwc-ensure-buffer)
-  ;; Update the display widths.
-  (enwc-refresh-widths)
-  (with-current-buffer (get-buffer "*ENWC*")
-    (setq tabulated-list-format
-          (vconcat
-           (mapcar
-            (pcase-lambda ((cl-struct enwc-column-spec display width sorter))
-              (list display width sorter))
-            enwc-column-specs)))
-    (setq tabulated-list-entries #'enwc--tabulated-list-entries)
-    (setq tabulated-list-printer #'enwc--tabulated-list-printer)
-
-    (tabulated-list-init-header)
-    (tabulated-list-print)))
-
-(defun enwc-find-network (essid &optional networks)
-  "Checks through NETWORKS for the network with essid ESSID,
-and returns the network identifier.  Uses `enwc--last-scan-results' if
-NETWORKS is nil.  If the network is not found, then it returns nil.
-
-   When called interactively, this only prints out what it finds.
-Otherwise, it actually returns it."
-  (interactive "sNetwork ESSID: ")
-  ;; TODO: Fix this for wired networks
-  (when enwc-using-wired
-    (error "Can't find wireless networks while on wired."))
-  (unless (or networks enwc--last-scan-results)
-    (setq enwc-scan-interactive nil)
-    (enwc-scan-internal))
-  (let ((nets (or networks enwc--last-scan-results))
-        need-break cur-net)
-    (while (and nets (not cur-net))
-      (setq cur-net (pop nets))
-      (unless (string-equal (alist-get 'essid (cdr-safe cur-net))
-                            essid)
-        (setq cur-net nil)))
-    (if cur-net
-        (if (called-interactively-p 'any)
-            (message "Network %d has essid %s" (number-to-string (car 
cur-net)) essid)
-          (car cur-net))
-      (when (called-interactively-p 'any)
-        (message "Network not found.")))))
-
-;;;;;;;;;;;;;;;;;;;;;
-;; Connect Network ;;
-;;;;;;;;;;;;;;;;;;;;;
-
-(defun enwc-connect-network (id)
-  "Connect to network with id ID.
-This is an entry point for the internal connection functions,
-and checks whether or not ENWC is using wired."
-  (enwc-connect id)
-  (let ((name-sym (if enwc-using-wired 'name 'essid)))
-    (when enwc--last-scan-results
-      (enwc-value-from-scan name-sym id))))
-
-(defun enwc-connect-to-network (net-id)
-  "Connect the the network with network id NET-ID.
-Confirms that NET-ID is a valid network id.
-This calls `enwc-connect-network' as a subroutine."
-  (interactive "sNetwork ID: ")
-  (let (cur-net)
-    (unless (enwc-is-valid-nw-id-p net-id)
-      (error "Invalid network id."))
-    (setq cur-net (enwc-connect-network net-id))
-    (message "Connecting to %s" cur-net)))
-
-(defun enwc-connect-to-network-essid (essid)
-  "Connect to the network with essid ESSID."
-  (interactive "sNetwork ESSID: ")
-  (let ((net-id (enwc-find-network essid)))
-    (if net-id
-        (enwc-connect-to-network net-id)
-      (message "Network not found."))))
-
-(defun enwc-connect-to-network-at-point ()
-  "Connect to the network at the current line number.
-Moves to the enwc buffer if necessary."
-  (interactive)
-  (unless (eq major-mode 'enwc-mode)
-    (enwc-setup-buffer))
-  (enwc-connect-to-network (tabulated-list-get-id)))
-
-(defun enwc-disconnect-network ()
-  "Disconnect from the network, if any."
-  (interactive)
-  (message "Disconnecting")
-  (enwc-disconnect))
-
-
-
-(defun enwc-enable-wired ()
-  (setq enwc-using-wired t)
-  (setq enwc-column-specs enwc-wired-column-specs)
-  (setq tabulated-list-sort-key nil))
-
-(defun enwc-enable-wireless ()
-  (setq enwc-using-wired nil)
-  (setq enwc-column-specs enwc-wireless-column-specs)
-  (setq tabulated-list-sort-key nil))
-
-(defun enwc-toggle-wired ()
-  "Toggle the display and mode between wireless and wired.
-This has the side-effect of setting the variable
-`enwc-using-wired', and calling a scan.
-
-In lisp code, calling `enwc-enable-wired' or
-`enwc-enable-wireless' will directly set the wired state, rather
-than just toggling it."
-  (interactive)
-  (unless (eq major-mode 'enwc-mode)
-    (enwc-setup-buffer))
-  (let ((inhibit-read-only t))
-    (erase-buffer)
-    (if enwc-using-wired
-        (enwc-enable-wireless)
-      (enwc-enable-wired))
-    (enwc-scan)))
-
-
-
-(defcustom enwc-interface-list-function 'enwc--ip-interface-list
-  "Function to use to collect network interfaces.
-
-ENWC comes with two functions for this purpose:
-
-  - enwc--ip-interface-list: Use ip to determine the network interfaces
-
-  - enwc--ifconfig-interface-list: Use ifconfig to determine the network 
interfaces
-
-This must be a function of no arguments that returns a list of
-strings.  Each element of the returned list should be a network
-interface, i.e. lo or eth0."
-  :group 'enwc
-  :type 'function)
-
-(defun enwc--ip-interface-list ()
-  "Use `ip' to get a list of network interfaces."
-  (let ((interfaces))
-    (with-temp-buffer
-      (call-process "ip" nil t nil "link")
-      (goto-char (point-min))
-      (while (re-search-forward "^[0-9]+:\s-*\\([[:alnum:]]+\\):" nil t)
-        (push (match-string 1) interfaces)))
-    (nreverse interfaces)))
-
-(defun enwc--ifconfig-interface-list ()
-  "Use `ifconfig' to get a list of network interfaces."
-  (let ((interfaces))
-    (with-temp-buffer
-      (call-process "ifconfig" nil t nil "-a")
-      (goto-char (point-min))
-      (while (re-search-forward "^\\([[:alnum:]]+\\):" nil t)
-        (push (match-string 1) interfaces)))
-    (nreverse interfaces)))
-
-(defun enwc--select-interfaces ()
-  "Collect a list of network interfaces and prompt the user to select two.
-
-One interface will be used for wireless, and the other for wired.
-
-There is no need to call this function manually; that should be
-left to `enwc-setup'.  Instead, set `enwc-wireless-device' and
-`enwc-wired-device'."
-  (let ((interfaces (funcall enwc-interface-list-function))
-        changed)
-    (when (string-empty-p enwc-wired-device)
-      (setq enwc-wired-device (completing-read "Wired Interface: " interfaces))
-      (setq changed t))
-    (when (string-empty-p enwc-wireless-device)
-      (setq enwc-wireless-device (completing-read "Wireless Interface: " 
interfaces))
-      (setq changed t))
-    (when (and changed
-               enwc-ask-to-save-interfaces
-               (y-or-n-p "Network Interfaces changed.  Save for future 
sessions? "))
-      (customize-save-variable 'enwc-wired-device enwc-wired-device)
-      (customize-save-variable 'enwc-wireless-device enwc-wireless-device))))
-
-(defvar enwc-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map (kbd "R") 'enwc-scan)
-    (define-key map (kbd "C") 'enwc-connect-to-network-essid)
-    (define-key map (kbd "D") 'enwc-disconnect-network)
-    (define-key map (kbd "W") 'enwc-toggle-wired)
-    ;; (define-key map (kbd "E") 'enwc-edit-entry-at-point)
-    (define-key map (kbd "RET") 'enwc-connect-to-network-at-point)
-    map)
-  "The keymap for network display in ENWC.")
-
-(define-derived-mode enwc-mode tabulated-list-mode "enwc"
-  "Mode for working with network connections.
-\\{enwc-mode-map}"
-  (add-hook 'tabulated-list-revert-hook 'enwc-redisplay-networks nil t))
-
-(defun enwc-setup-buffer (&optional nomove)
-  "Sets up the ENWC buffer.
-This first checks to see that it exists,
-and if it doesn't, then create it.
-
-If NOMOVE is non-nil, then do not move to the
-newly created buffer."
-  (unless (get-buffer "*ENWC*")
-    (with-current-buffer (get-buffer-create "*ENWC*")
-      (enwc-mode)))
-  (unless nomove
-    (switch-to-buffer "*ENWC*")))
-
-(defun enwc-ensure-buffer ()
-  (unless (get-buffer "*ENWC*")
-    (enwc-setup-buffer t)))
-
-;; Setup is broken into four functions to ease testing.  This allows developers
-;; to test each one individually without worrying about the side effects of
-;; others
-
-(defun enwc--setup-select-interfaces ()
-  (when (or (string-empty-p enwc-wired-device)
-            (string-empty-p enwc-wireless-device))
-    (enwc--select-interfaces)))
-
-(defun enwc--setup-load-default-backend ()
-  (enwc-load-default-backend enwc-force-backend-loading))
-
-(defun enwc--setup-display-mode-line ()
-  (when enwc-display-mode-line
-    (enwc-enable-display-mode-line)))
-
-(defun enwc--setup-auto-scan ()
-  (when enwc-enable-auto-scan-on-startup
-    (enwc-enable-auto-scan)))
-
-(defvar enwc--setup-done nil
-  "Non-nil if enwc has already been set up.")
-
-(defun enwc-setup ()
-  "Set up ENWC.
-
-If `enwc-wired-device' or `enwc-wireless-device' is empty, prompt
-the user to set them from a list of interfaces.
-
-Load the default backend, forcing it if
-`enwc-force-backend-loading' is non-nil.
-
-If `enwc-display-mode-line' is non-nil, enable the mode line.
-
-If `enwc-enable-auto-scan-on-startup' is non-nil, start the
-auto-scan timer."
-  (cond
-   ((and enwc--setup-done enwc-warn-if-already-setup)
-    (message "ENWC is already setup."))
-   (enwc--setup-done t)
-   (t
-    (enwc--setup-select-interfaces)
-    (enwc--setup-load-default-backend)
-    (enwc--setup-display-mode-line)
-    (enwc--setup-auto-scan)
-
-    (setq enwc--setup-done t))))
-
-;;;###autoload
-(defun enwc ()
-  "The main front-end to ENWC.
-This sets up the buffer and scans for networks.
-In order to use this, one must have already run
-`enwc-setup'.
-
-\\{enwc-mode-map}"
-  (interactive)
-  (enwc-setup)
-  (enwc-setup-buffer)
-  (enwc-scan))
-
-(provide 'enwc)
-
-;;; enwc.el ends here
diff --git a/packages/gnorb/.elpaignore b/packages/gnorb/.elpaignore
deleted file mode 100644
index f614ef7..0000000
--- a/packages/gnorb/.elpaignore
+++ /dev/null
@@ -1 +0,0 @@
-gnorb.org
\ No newline at end of file
diff --git a/packages/gnorb/.gitignore b/packages/gnorb/.gitignore
deleted file mode 100644
index c8ea459..0000000
--- a/packages/gnorb/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*.elc
-notes.org
-gnorb-pkg.el
-gnorb-autoloads.el
-TAGS
diff --git a/packages/gnorb/NEWS b/packages/gnorb/NEWS
deleted file mode 100644
index feca7da..0000000
--- a/packages/gnorb/NEWS
+++ /dev/null
@@ -1,47 +0,0 @@
-GNU Emacs Gnorb NEWS -- history of user-visible changes.  -*- org -*-
-
-* Version 1.2 [2017-03-21 Tue]
-** Add `gnorb-install-defaults'
-New command for installing sane default bindings.
-* Version 1.1.3 [2017-03-12 Sun]
-** Provide a better interface for trigger action selection
-New function `gnorb-select-from-list' providing a nicer interface for
-choosing items from a list.
-** Change to format of gnorb-org-trigger-actions
-Due to previous item, this custom option has changed format, see
-docstring for details.
-** Compatibility with newest BBDB
-Updates to match newest version of BBDB in package repos (mostly with
-regard to displaying multi-line field values, BBDB is now
-lexically bound).
-** Many compiler fixes, and lexical binding
-Move to lexical binding.
-* Version 1.1.0 [2015-04-23 Thu]
-** New trigger actions
-Two new trigger actions allow you to capture a new sibling or child
-heading relative to the heading you're triggering.
-** Persistent Gnorb groups
-Give a prefix argument to `gnorb-org-view' to create a named,
-persistent group containing tracked headings.
-** Gnorb registry usage reports
-Call `gnorb-report-tracking-usage' to see how much of the Gnus
-registry Gnorb is occupying, and run cleaning routines.
-* Version 1.0.1 [2014-10-22 Wed]
-** Deleting associations
-It's now possible to delete associations between messages and
-headings; the user is also prompted to do this at a few points.
-** Link following
-Following links to messages is a little more clever, and will re-use
-existing windows/frames when possible.
-** Cleanups/Bugfixes
-Proper autoloads, addressing compiler warnings, better chain of
-requires, bugfixes.
-* Version 1 [2014-10-07 Tue]
-** First Elpa Version
-** Email Tracking
-The mechanism for email tracking has changed since Gnorb was made
-available on Elpa. See the manual for set-up instructions.
-** Directory Structure
-The directory structure has changed since Gnorb was made available on
-Elpa. There is no longer a lisp/ directory -- all *.el files are now
-at the top level.
diff --git a/packages/gnorb/README.org b/packages/gnorb/README.org
deleted file mode 100644
index 5ba6e76..0000000
--- a/packages/gnorb/README.org
+++ /dev/null
@@ -1,116 +0,0 @@
-* Gnorb
-
-Glue code between the Gnus, Org, and BBDB packages for Emacs.
-
-This package connects Emacs-based email, project management, and
-contact management a little more closely together. The goal is to
-reduce friction when manipulating TODOs, contacts, messages, and
-files.
-
-Probably the most interesting thing Gnorb does is tracking
-correspondences between Gnus email messages and Org headings. Rather
-than "turning your inbox into a TODO list", as some software puts it,
-Gnorb (kind of) does the opposite: turning your TODO headings into
-mini mailboxes. See the Info manual for details.
-
-*Note for previous users*: If you were using Gnorb from Github before
-it shifted to the Elpa repository, the email tracking mechanism has
-changed, please see the manual for details.
-** Known bugs/issues
-*** Gnus Registry
-Prior to late December, 2014, the Gnus registry had some issues with
-preserving "precious" entries while pruning.
-
-When the registry approaches its maximum size it will delete excess
-entries, a process referred to as "pruning". "Precious" entries are
-those that contain important information: they should not be pruned.
-
-Gnorb uses the registry to track associations between messages and Org
-headings, and marks those entries as precious. The entire process of
-tracking, in fact, relies on these entries being preserved, and Gnorb
-goes to some lengths to protect this information. Older versions of
-the registry could nevertheless delete those entries.
-
-These issues are fixed circa the end of December, 2014, around "Ma
-Gnus v0.12", whatever that means. If you think there's a possibility
-your registry is full, and associations are being deleted, you might
-consider upgrading to a recent Gnus.
-*** Multiple Associations
-Gnorb theoretically supports email messages being associated with
-multiple Org headings. In practice, however, this situation hasn't
-been thought through completely, and you may experience weirdness. If
-you do, and you have some ideas about how it should be handled, please
-contact the author and suggest them.
-** Installation
-
-Gnorb is developed inside the Elpa repository -- install with M-x
-package-install RET gnorb RET. There is a 
[[https://github.com/girzel/gnorb/][Github repository]], but the
-code there is stale as of March 2017. Any issues opened there will be
-addressed, though obviously pull requests won't work. Prefer
-submitting bugs via `emacs-report-bug'.
-
-** Roadmap
-*** More fully utilize nngnorb
-Instead of just being place to put nnir searches, the nngnorb server
-should have groups in its own right. Users will still be able to make
-ephemeral search groups if they like, but they'll also have the option
-of creating regular Gnus groups that track certain Org subtrees. These
-groups will be persistent, and they will auto-update, so it's possible
-to handle more TODO stuff from the Gnus group buffer. Copying a
-message into the group will set up tracking for the message; deleting
-it from the group will remove tracking.
-*** Comprehensive views of related information
-For instance, A `gnorb-view' command that takes a tags-todo search
-phrase (or a single Org heading ID), finds all relevant messages, Org
-headings, and BBDB records, and sets up a four-pane view: Org Agenda,
-BBDB buffer, Gnus Summary buffer, and Gnus Article buffer.
-
-Or something like that -- more pondering is necessary.
-*** Consider consolidating posting styles, personas, etc
-There are many solutions out there for setting up "personas" in Gnus
-or elsewhere: wrappers for mail composition and reply that create
-certain identities by setting variables and mail headers.
-
-Do we need another one? Gnorb seems so well placed for this sort of
-thing: we've already got bbdb-posting-styles, and allowing further
-configuration based on, say, the Org tags of the subtree we're
-composing messages from... Or maybe it's just a case of NIH.
-** To do list
-*** TODO Agenda date-span message search
-Provide an Org Agenda command that does an email search for messages
-received in the visible date span, or day under point, etc. Make it
-work in the calendar, as well?
-*** TODO Collect BBDB messages by thread
-At present, when you collect message links on a BBDB contact, each
-message is a separate link. If you have lengthy conversations with
-this contact, you'll get a whole bunch of links with the same summary:
-not very useful. Provide an option to collect one /thread/ per link:
-each link represents the top-level message in the thread, and
-following the link opens a Summary buffer where the whole thread is
-visible.
-*** TODO Automatic org-tagging for BBDB contacts
-When messages from a contact are associated with an Org heading, make
-it possible for the contact to inherit that heading's tags
-automatically.
-*** TODO gnorb-bbdb-view
-Provide a `gnorb-bbdb-view' command that opens a Summary buffer
-containing all the tracked messages from the contact(s) under point.
-*** DONE Gnus message tagging
-:LOGBOOK:
-- State "DONE"       from "TODO"       [2017-12-09 Sat 17:23]
-:END:
-Allow tagging of Gnus messages, by giving the message's registry entry
-an 'org-tags key.
-*** DONE Email subtree export to doc and rtf
-:LOGBOOK:
-- State "DONE"       from "TODO"       [2017-03-11 Sat 12:35]
-:END:
-When using `gnorb-email-subtree', provide built-in options for
-exporting to doc and rtf attachments; these are such commonly-needed
-formats. Do the odt conversion automatically.
-*** DONE Capture to child/subtree trigger actions
-:LOGBOOK:
-- State "DONE"       from "TODO"       [2015-03-17 Tue 17:42]
-:END:
-Add trigger actions that create new sibling or child headings on the
-original Org heading.
diff --git a/packages/gnorb/dir b/packages/gnorb/dir
deleted file mode 100644
index b0d0ad6..0000000
--- a/packages/gnorb/dir
+++ /dev/null
@@ -1,18 +0,0 @@
-This is the file .../info/dir, which contains the
-topmost node of the Info hierarchy, called (dir)Top.
-The first time you invoke Info you start off looking at this node.
-
-File: dir,     Node: Top       This is the top of the INFO tree
-
-  This (the Directory node) gives a menu of major topics.
-  Typing "q" exits, "?" lists all Info commands, "d" returns here,
-  "h" gives a primer for first-timers,
-  "mEmacs<Return>" visits the Emacs manual, etc.
-
-  In Emacs, you can click mouse button 2 on a menu item or cross reference
-  to select it.
-
-* Menu:
-
-Emacs
-* Gnorb: (gnorb).               Glue code for Gnus, Org, and BBDB.
diff --git a/packages/gnorb/gnorb-bbdb.el b/packages/gnorb/gnorb-bbdb.el
deleted file mode 100644
index e961152..0000000
--- a/packages/gnorb/gnorb-bbdb.el
+++ /dev/null
@@ -1,637 +0,0 @@
-;;; gnorb-bbdb.el --- The BBDB-centric functions of gnorb  -*- 
lexical-binding: t -*-
-
-;; Copyright (C) 2018-2020  Free Software Foundation, Inc.
-
-;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
-
-;; 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 3 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, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; The Gnorb package has no hard dependency on BBDB, so you'll have to
-;; install it manually.  Gnorb is compatible with whichever version of
-;; BBDB is current in the Emacs package manager.  I believe it comes
-;; from Melpa.
-
-;;; Code:
-
-;; Don't explicity require BBDB libraries.  BBDB is the "weakest leg"
-;; of the Gnorb tripod: it has the least functionality, and many
-;; people are using Gnorb without BBDB. So don't require, only
-;; autoload.
-
-;; (require 'bbdb)
-;; (require 'bbdb-com)
-;; (require 'bbdb-mua)
-
-(autoload 'bbdb-do-records "bbdb-com")
-(autoload 'bbdb-completing-read-record "bbdb-com")
-(autoload 'bbdb-current-record "bbdb")
-
-(defvar bbdb-buffer-name)
-(defvar bbdb-separator-alist)
-(defvar bbdb-crm-local-completion-map)
-
-(require 'gnorb-utils)
-(require 'cl-lib)
-
-(defgroup gnorb-bbdb nil
-  "The BBDB bits of gnorb."
-  :tag "Gnorb BBDB"
-  :group 'gnorb)
-
-(defcustom gnorb-bbdb-org-tag-field 'org-tags
-  "The name (as a symbol) of the field to use for org tags."
-  :type 'symbol)
-
-(when (boundp 'bbdb-separator-alist)    ;Allow compilation if BBDB is absent!
-  (unless (assoc gnorb-bbdb-org-tag-field bbdb-separator-alist)
-    (push `(,gnorb-bbdb-org-tag-field ":" ":") bbdb-separator-alist)))
-
-(defcustom gnorb-bbdb-messages-field 'messages
-  "The name (as a symbol) of the field where links to recent gnus
-messages from this record are stored.
-
-\\<bbdb-mode-map>Records that do not have this field defined
-will not collect links to messages: you have to call
-\"\\[gnorb-bbdb-open-link]\" on the record once -- after that,
-message links will be collected and updated automatically."
-  :type 'symbol)
-
-(defcustom gnorb-bbdb-collect-N-messages 5
-  "For records with a `gnorb-bbdb-messages-field' defined,
-collect links to a maximum of this many messages."
-  :type 'integer)
-
-(defcustom gnorb-bbdb-define-recent 'seen
-  "For records with a `gnorb-bbdb-message-tag-field' defined,
-this variable controls how gnorb defines a \"recent\" message.
-Setting it to the symbol seen will collect the messages most
-recently opened and viewed. The symbol received means gnorb will
-collect the most recent messages by Date header.
-
-In other words, if this variable is set to `received', and a
-record's messages field is already full of recently-received
-messages, opening a five-year-old message (for instance) from
-this record will not push a link to the message into the field."
-  :type '(choice (const :tag "Most recently seen" 'seen)
-                 (const :tag "Most recently received" 'received)))
-
-(defcustom gnorb-bbdb-message-link-format-multi "%:count. %D: %:subject"
-  "How a single message is formatted in the list of recent messages.
-This format string is used in multi-line record display.
-
-Available information for each message includes the subject, the
-date, and the message's count in the list, as an integer. You can
-access subject and count using the %:subject and %:count escapes.
-The message date can be formatted using any of the escapes
-mentioned in the docstring of `format-time-string', which see."
-  :type 'string)
-
-(defcustom gnorb-bbdb-message-link-format-one "%:count"
-  "How a single message is formatted in the list of recent messages.
-This format string is used in single-line display -- note that by
-default, no user-created xfields are displayed in the `one-line'
-layout found in `bbdb-layout-alist'. If you want this field to
-appear there, put its name in the \"order\" list of the `one-line'
-layout.
-
-Available information for each message includes the subject, the
-date, and the message's count in the list, as an integer. You can
-access subject and count using the %:subject and %:count escapes.
-The message date can be formatted using any of the escapes
-mentioned in the docstring of `format-time-string', which see."
-  :type 'string)
-
-(defface gnorb-bbdb-link '((t :inherit org-link))
-  "Custom face for displaying message links in the *BBDB* buffer.
-  Defaults to org-link.")
-
-(cl-defstruct gnorb-bbdb-link
-  subject date group id)
-
-(defcustom gnorb-bbdb-posting-styles nil
-  "An alist of styles to use when composing messages to the BBDB
-record(s) under point. This is entirely analogous to
-`gnus-posting-styles', it simply works by examining record fields
-rather than group names.
-
-When composing a message to multiple contacts (using the \"*\"
-prefix), the records will be scanned in order, with the record
-initially under point (if any) set aside for last. That means
-that, in the case of conflicting styles, the record under point
-will override the others.
-
-In order not to be too intrusive, this option has no effect on
-the usual `bbdb-mail' command. Instead, the wrapper command
-`gnorb-bbdb-mail' is provided, which consults this option and
-then hands off to `bbdb-compose-mail'. If you'd always like to
-use `gnorb-bbdb-mail', you can simply bind it to \"m\" in the
-`bbdb-mode-map'.
-
-The value of the option should be a list of sexps, each one
-matching a single field. The first element should match a field
-name: one of the built-in fields like lastname, or an xfield.
-Field names should be given as symbols.
-
-The second element is a regexp used to match against the value of
-the field (non-string field values will be cast to strings, if
-possible). It can also be a cons of two strings, the first of
-which matches the field label, the second the field value.
-
-Alternately, the first element can be the name of a custom
-function that is called with the record as its only argument, and
-returns either t or nil. In this case, the second element of the
-list is disregarded.
-
-All following elements should be field setters for the message to
-be composed, just as in `gnus-posting-styles'."
-  :type 'list)
-
-(when (fboundp 'bbdb-record-xfield-string)
-  (defalias (intern (format "bbdb-read-xfield-%s"
-                           gnorb-bbdb-org-tag-field))
-    (lambda (&optional init)
-      (gnorb-bbdb-read-org-tags init)))
-
-  (defalias (intern (format "bbdb-display-%s-multi-line"
-                           gnorb-bbdb-org-tag-field))
-    (lambda (record indent)
-      (gnorb-bbdb-display-org-tags record indent))))
-
-(defun gnorb-bbdb-read-org-tags (&optional init)
-  "Read Org mode tags, with `completing-read-multiple'."
-  (if (string< "24.3" (substring emacs-version 0 4))
-      (let ((crm-separator
-            (concat "[ \t\n]*"
-                    (cadr (assq gnorb-bbdb-org-tag-field
-                                bbdb-separator-alist))
-                    "[ \t\n]*"))
-           (crm-local-completion-map bbdb-crm-local-completion-map)
-           (table (cl-mapcar #'car
-                             (org-global-tags-completion-table
-                              (org-agenda-files))))
-           (init (if (consp init)
-                     (apply #'bbdb-concat (nth 2 (assq gnorb-bbdb-org-tag-field
-                                                       bbdb-separator-alist))
-                            init)
-                   init)))
-       (completing-read-multiple
-        "Tags: " table
-        nil nil init))
-    (bbdb-split gnorb-bbdb-org-tag-field
-               (bbdb-read-string "Tags: " init))))
-
-(defun gnorb-bbdb-display-org-tags (record indent)
-  "Display the Org tags associated with the record.
-
-Org tags are stored in the `gnorb-bbdb-org-tags-field'."
-  (let ((full-field (assq gnorb-bbdb-org-tag-field
-                         (bbdb-record-xfields record)))
-       (val (bbdb-record-xfield
-             record
-             gnorb-bbdb-org-tag-field)))
-    (when val
-      (bbdb-display-text (format (format " %%%ds: " (- indent 3))
-                                gnorb-bbdb-org-tag-field)
-                        `(xfields ,full-field field-label)
-                        'bbdb-field-name)
-      (if (consp val)
-         (bbdb-display-list val gnorb-bbdb-org-tag-field "\n")
-       (insert
-        (bbdb-indent-string (concat val "\n") indent))))))
-
-(defvar message-mode-hook)
-
-;;;###autoload
-(defun gnorb-bbdb-mail (records &optional subject n verbose)
-  "\\<bbdb-mode-map>Acts just like `bbdb-mail', except runs
-RECORDS through `gnorb-bbdb-posting-styles', allowing
-customization of message styles for certain records. From the
-`bbdb-mail' docstring:
-
-Compose a mail message to RECORDS (optional: using SUBJECT).
-Interactively, use BBDB prefix \\[bbdb-do-all-records], see
-`bbdb-do-all-records'. By default, the first mail addresses of
-RECORDS are used. If prefix N is a number, use Nth mail address
-of RECORDS (starting from 1). If prefix N is C-u (t
-noninteractively) use all mail addresses of RECORDS. If VERBOSE
-is non-nil (as in interactive calls) be verbose."
-  ;; see the function `gnus-configure-posting-styles' for tips on how
-  ;; to actually do this.
-  (interactive (list (bbdb-do-records) nil
-                    (or (consp current-prefix-arg)
-                         current-prefix-arg)
-                    t))
-  (setq records (bbdb-record-list records))
-  (if (not records)
-      (user-error "No records displayed")
-    (let ((head (bbdb-current-record))
-         (to (bbdb-mail-address records n nil verbose))
-         (message-mode-hook (copy-sequence message-mode-hook)))
-      (setq records (remove head records))
-      (when gnorb-bbdb-posting-styles
-       (add-hook 'message-mode-hook
-                 `(lambda ()
-                    (gnorb-bbdb-configure-posting-styles (quote ,records))
-                    (gnorb-bbdb-configure-posting-styles (list ,head)))))
-      (bbdb-compose-mail to subject))))
-
-(defun gnorb-bbdb-configure-posting-styles (recs)
-  ;; My most magnificent work of copy pasta!
-  (dolist (r recs)
-    (let (field val label rec-val filep
-               element v value results name address)
-      (dolist (style gnorb-bbdb-posting-styles)
-       (setq field (pop style)
-             val (pop style))
-       (when (consp val) ;; (label value)
-         (setq label (pop val)
-               val (pop val)))
-       (unless (fboundp field)
-         ;; what's the record's existing value for this field?
-         (setq rec-val (bbdb-record-field r field)))
-       (when (catch 'match
-               (cond
-                ((eq field 'address)
-                 (dolist (a rec-val)
-                   (unless (and label
-                                (not (string-match label (car a))))
-                     (when
-                         (string-match-p
-                          val
-                          (bbdb-format-address-default a))
-                       (throw 'match t)))))
-                ((eq field 'phone)
-                 (dolist (p rec-val)
-                   (unless (and label
-                                (not (string-match label (car p))))
-                     (when
-                         (string-match-p val (bbdb-phone-string p))
-                       (throw 'match t)))))
-                ((consp rec-val)
-                 (dolist (f rec-val)
-                   (when (string-match-p val f)
-                     (throw 'match t))))
-                ((fboundp field)
-                 (when (string-match-p (funcall field r))
-                   (throw 'match t)))
-                ((stringp rec-val)
-                 (when (string-match-p val rec-val)
-                   (throw 'match t)))))
-         ;; there are matches, run through the field setters in last
-         ;; element of the sexp
-         (dolist (attribute style)
-           (setq element (pop attribute)
-                 filep nil)
-           (setq value
-                 (cond
-                  ((eq (car attribute) :file)
-                   (setq filep t)
-                   (cadr attribute))
-                  ((eq (car attribute) :value)
-                   (cadr attribute))
-                  (t
-                   (car attribute))))
-           ;; We get the value.
-           (setq v
-                 (cond
-                  ((stringp value)
-                   value)
-                  ((or (symbolp value)
-                       (functionp value))
-                   (cond ((functionp value)
-                          (funcall value))
-                         ((boundp value)
-                          (symbol-value value))))
-                  ((listp value)
-                   (eval value))))
-           ;; Post-processing for the signature posting-style:
-           (and (eq element 'signature) filep
-                message-signature-directory
-                ;; don't actually use the signature directory
-                ;; if message-signature-file contains a path.
-                (not (file-name-directory v))
-                (setq v (nnheader-concat message-signature-directory v)))
-           ;; Get the contents of file elems.
-           (when (and filep v)
-             (setq v (with-temp-buffer
-                       (insert-file-contents v)
-                       (buffer-substring
-                        (point-min)
-                        (progn
-                          (goto-char (point-max))
-                          (if (zerop (skip-chars-backward "\n"))
-                              (point)
-                            (1+ (point))))))))
-           (setq results (delq (assoc element results) results))
-           (push (cons element v) results))))
-      (setq name (assq 'name results)
-           address (assq 'address results))
-      (setq results (delq name (delq address results)))
-      (setq results (sort results (lambda (x y)
-                                   (string-lessp (car x) (car y)))))
-      (dolist (result results)
-       (add-hook 'message-setup-hook
-                 (cond
-                  ((eq 'eval (car result))
-                   'ignore)
-                  ((eq 'body (car result))
-                   `(lambda ()
-                      (save-excursion
-                        (message-goto-body)
-                        (insert ,(cdr result)))))
-                  ((eq 'signature (car result))
-                   (set (make-local-variable 'message-signature) nil)
-                   (set (make-local-variable 'message-signature-file) nil)
-                   (if (not (cdr result))
-                       'ignore
-                     `(lambda ()
-                        (save-excursion
-                          (let ((message-signature ,(cdr result)))
-                            (when message-signature
-                              (message-insert-signature)))))))
-                  (t
-                   (let ((header
-                          (if (symbolp (car result))
-                              (capitalize (symbol-name (car result)))
-                            (car result))))
-                     `(lambda ()
-                        (save-excursion
-                          (message-remove-header ,header)
-                          (let ((value ,(cdr result)))
-                            (when value
-                              (message-goto-eoh)
-                              (insert ,header ": " value)
-                              (unless (bolp)
-                                (insert "\n")))))))))
-                 t 'local))
-      (when (or name address)
-       (add-hook 'message-setup-hook
-                 `(lambda ()
-                    (set (make-local-variable 'user-mail-address)
-                         ,(or (cdr address) user-mail-address))
-                    (let ((user-full-name ,(or (cdr name) (user-full-name)))
-                          (user-mail-address
-                           ,(or (cdr address) user-mail-address)))
-                      (save-excursion
-                        (message-remove-header "From")
-                        (message-goto-eoh)
-                        (insert "From: " (message-make-from) "\n"))))
-                 t 'local)))))
-
-;;;###autoload
-(defun gnorb-bbdb-tag-agenda (records)
-  "Open an Org agenda tags view from the BBDB buffer, using the
-value of the record's org-tags field. This shows only TODOs by
-default; a prefix argument shows all tagged headings; a \"*\"
-prefix operates on all currently visible records. If you want
-both, use \"C-u\" before the \"*\"."
-  (interactive (list (bbdb-do-records)))
-  (require 'org-agenda)
-  (unless (and (eq major-mode 'bbdb-mode)
-              (equal (buffer-name) bbdb-buffer-name))
-    (error "Only works in the BBDB buffer"))
-  (setq records (bbdb-record-list records))
-  (let ((tag-string
-        (mapconcat
-         'identity
-         (delete-dups
-          (cl-mapcan
-           (lambda (r)
-             (bbdb-record-xfield-split r gnorb-bbdb-org-tag-field))
-           records))
-         "|")))
-    (if tag-string
-       ;; C-u = all headings, not just todos
-       (if (equal current-prefix-arg '(4))
-           (org-tags-view nil tag-string)
-         (org-tags-view t tag-string))
-      (error "No org-tags field present"))))
-
-;;;###autoload
-(defun gnorb-bbdb-mail-search (records)
-  "Initiate a mail search from the BBDB buffer.
-
-Use the prefix arg to edit the search string first, and the \"*\"
-prefix to search mails from all visible contacts. When using both
-a prefix arg and \"*\", the prefix arg must come first."
-  (interactive (list (bbdb-do-records)))
-  (unless (and (eq major-mode 'bbdb-mode)
-              (equal (buffer-name) bbdb-buffer-name))
-    (error "Only works in the BBDB buffer"))
-  (setq records (bbdb-record-list records))
-  (require 'gnorb-gnus)
-  (let* ((backend (or (assoc gnorb-gnus-mail-search-backend
-                            gnorb-gnus-mail-search-backends)
-                     (error "No search backend specified")))
-        (search-string
-         (funcall (cl-second backend)
-                  (cl-mapcan 'bbdb-record-mail records))))
-    (when (equal current-prefix-arg '(4))
-      (setq search-string
-           (read-from-minibuffer
-            (format "%s search string: " (first backend)) search-string)))
-    (funcall (cl-third backend) search-string)
-    (delete-other-windows)))
-
-;;;###autoload
-(defun gnorb-bbdb-cite-contact (rec)
-  (interactive (list (bbdb-completing-read-record "Record: ")))
-  (let ((mail-string (bbdb-dwim-mail rec)))
-   (if (called-interactively-p 'any)
-       (insert mail-string)
-     mail-string)))
-
-;;; Field containing links to recent messages
-(when (boundp 'bbdb-xfield-label-list)
- (add-to-list 'bbdb-xfield-label-list gnorb-bbdb-messages-field nil 'eq))
-
-(defun gnorb-bbdb-display-messages (record format &optional indent)
-  "Show links to the messages collected in the
-`gnorb-bbdb-messages-field' field of a BBDB record. Each link
-will be formatted using the format string in
-`gnorb-bbdb-message-link-format-multi' or
-`gnorb-bbdb-message-link-format-one', depending on the current
-layout type."
-  (let ((full-field (assq gnorb-bbdb-messages-field
-                         (bbdb-record-xfields record)))
-       (val (bbdb-record-xfield record gnorb-bbdb-messages-field))
-       (map (make-sparse-keymap))
-       (count 1)) ; one-indexed to fit with prefix arg to 
`gnorb-bbdb-open-link'
-    (define-key map [mouse-1] 'gnorb-bbdb-mouse-open-link)
-    (define-key map (kbd "<RET>") 'gnorb-bbdb-RET-open-link)
-    (when val
-      (when (eq format 'multi)
-       (bbdb-display-text (format (format " %%%ds: " (- indent 3))
-                                  gnorb-bbdb-messages-field)
-                          `(xfields ,full-field field-label)
-                          'bbdb-field-name))
-      (insert (cond ((and (stringp val)
-                         (eq format 'multi))
-                    (bbdb-indent-string (concat val "\n") indent))
-                   ((listp val)
-                    ;; Why aren't I using `bbdb-display-list' with a
-                    ;; preformatted list of messages?
-                    (concat
-                     (bbdb-indent-string
-                      (mapconcat
-                       (lambda (m)
-                         (prog1
-                             (propertize
-                              (concat
-                               (format-time-string
-                                (replace-regexp-in-string
-                                 "%:subject" (gnorb-bbdb-link-subject m)
-                                 (replace-regexp-in-string
-                                  "%:count" (number-to-string count)
-                                  (if (eq format 'multi)
-                                      gnorb-bbdb-message-link-format-multi
-                                    gnorb-bbdb-message-link-format-one)))
-                                (gnorb-bbdb-link-date m)))
-                              'face 'gnorb-bbdb-link
-                              'mouse-face 'highlight
-                              'gnorb-bbdb-link-count count
-                              'keymap map)
-                           (incf count)))
-                       val (if (eq format 'multi)
-                               "\n" ", "))
-                      indent)
-                     (if (eq format 'multi) "\n" "")))
-                   (t
-                    ""))))))
-
-(defalias (intern (format "bbdb-display-%s-multi-line"
-                         gnorb-bbdb-messages-field))
-  (lambda (record indent)
-    (gnorb-bbdb-display-messages record 'multi indent)))
-
-(defalias (intern (format "bbdb-display-%s-one-line"
-                         gnorb-bbdb-messages-field))
-  (lambda (record)
-    (gnorb-bbdb-display-messages record 'one)))
-
-;; Don't allow direct editing of this field
-
-(defalias (intern (format "bbdb-read-xfield-%s"
-                         gnorb-bbdb-messages-field))
-  (lambda (&optional _init)
-    (user-error "This field shouldn't be edited manually")))
-
-;; Open links from the *BBDB* buffer.
-
-;;;###autoload
-(defun gnorb-bbdb-open-link (record arg)
-  "\\<bbdb-mode-map>Call this on a BBDB record to open one of the
-links in the message field. By default, the first link will be
-opened. Use a prefix arg to open different links. For instance,
-M-3 \\[gnorb-bbdb-open-link] will open the third link in the
-list. If the %:count escape is present in the message formatting
-string (see `gnorb-bbdb-message-link-format-multi' and
-`gnorb-bbdb-message-link-format-one'), that's the number to use.
-
-This function also needs to be called on a contact once before
-that contact will start collecting links to messages."
-  (interactive (list
-               (or (bbdb-current-record)
-                   (user-error "No record under point"))
-               current-prefix-arg))
-  (unless (fboundp 'bbdb-record-xfield-string)
-    (user-error "This function only works with the git version of BBDB"))
-  (let (msg-list target-msg)
-    (if (not (memq gnorb-bbdb-messages-field
-                  (mapcar 'car (bbdb-record-xfields record))))
-       (when (y-or-n-p
-              (format "Start collecting message links for %s?"
-                      (bbdb-record-name record)))
-         (bbdb-record-set-xfield record gnorb-bbdb-messages-field "no links 
yet")
-         (message "Opening messages from %s will add links to the %s field"
-                  (bbdb-record-name record)
-                  gnorb-bbdb-messages-field)
-         (bbdb-change-record record))
-       (setq msg-list
-             (bbdb-record-xfield record gnorb-bbdb-messages-field))
-       (setq target-msg
-             (or (and arg
-                      (nth (1- arg) msg-list))
-                 (car msg-list)))
-       (when target-msg
-         (org-gnus-follow-link (gnorb-bbdb-link-group target-msg)
-                               (gnorb-bbdb-link-id target-msg))))))
-
-(defun gnorb-bbdb-mouse-open-link (event)
-  (interactive "e")
-  (mouse-set-point event)
-  (let ((rec (bbdb-current-record))
-       (num (get-text-property (point) 'gnorb-bbdb-link-count)))
-    (if (not num)
-       (user-error "No link under point")
-      (gnorb-bbdb-open-link rec num))))
-
-(defun gnorb-bbdb-RET-open-link ()
-  (interactive)
-  (let ((rec (bbdb-current-record))
-       (num (get-text-property (point) 'gnorb-bbdb-link-count)))
-    (if (not num)
-       (user-error "No link under point")
-      (gnorb-bbdb-open-link rec num))))
-
-(defun gnorb-bbdb-store-message-link (record)
-  "Used in the `bbdb-notice-record-hook' to possibly save a link
-to a message into the record's `gnorb-bbdb-messages-field'."
-
-  (when (not (fboundp 'bbdb-record-xfield-string))
-    (user-error "This function only works with the git version of BBDB"))
-  (unless (or (not (and (memq gnorb-bbdb-messages-field
-                             (mapcar 'car (bbdb-record-xfields record)))
-                       (memq major-mode '(gnus-summary-mode 
gnus-article-mode))))
-             (with-current-buffer gnus-article-buffer
-               (not ; only store messages if the record is the sender
-                (member (nth 1 (car (bbdb-get-address-components 'sender)))
-                        (bbdb-record-mail record)))))
-    (with-current-buffer gnus-summary-buffer
-      (let* ((val (bbdb-record-xfield record gnorb-bbdb-messages-field))
-            (art-no (gnus-summary-article-number))
-            (heads (gnus-summary-article-header art-no))
-            (date (apply 'encode-time
-                         (parse-time-string (mail-header-date heads))))
-            (subject (mail-header-subject heads))
-            (id (mail-header-id heads))
-            (group (gnorb-get-real-group-name
-                    gnus-newsgroup-name
-                    art-no))
-            link)
-       (if (not (and date subject id group))
-           (message "Could not save a link to this message")
-         (setq link (make-gnorb-bbdb-link :subject subject :date date
-                                          :group group :id id))
-         (when (stringp val)
-           (setq val nil))
-         (setq val (cons link (delete link val)))
-         (when (eq gnorb-bbdb-define-recent 'received)
-           (setq val (sort val
-                           (lambda (a b)
-                             (time-less-p
-                              (gnorb-bbdb-link-date b)
-                              (gnorb-bbdb-link-date a))))))
-         (setq val (cl-subseq val 0 (min (length val) 
gnorb-bbdb-collect-N-messages)))
-         (bbdb-record-set-xfield record
-                                 gnorb-bbdb-messages-field
-                                 (delq nil val))
-         (bbdb-change-record record))))))
-
-(add-hook 'bbdb-notice-record-hook 'gnorb-bbdb-store-message-link)
-
-(provide 'gnorb-bbdb)
-;;; gnorb-bbdb.el ends here
diff --git a/packages/gnorb/gnorb-gnus.el b/packages/gnorb/gnorb-gnus.el
deleted file mode 100644
index f34c816..0000000
--- a/packages/gnorb/gnorb-gnus.el
+++ /dev/null
@@ -1,1271 +0,0 @@
-;;; gnorb-gnus.el --- The gnus-centric fuctions of gnorb -*- lexical-binding: 
t -*-
-
-;; Copyright (C) 2018-2020  Free Software Foundation, Inc.
-
-;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
-
-;; 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 3 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, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;
-
-;;; Code:
-
-(require 'gnus)
-(require 'gnus-sum)
-(require 'gnus-art)
-(require 'message)
-(require 'org)
-(require 'org-attach)
-(require 'org-capture)
-(require 'gnorb-utils)
-(require 'gnorb-registry)
-(require 'mm-decode)
-
-(declare-function org-gnus-article-link "org-gnus"
-                 (group newsgroups message-id x-no-archive))
-(declare-function org-gnus-follow-link "org-gnus"
-                 (group article))
-(declare-function org-make-tags-matcher "org" (match))
-(declare-function gnorb-org-restore-after-send "gnorb-org")
-(declare-function gnorb-org-attachment-list "gnorb-org")
-
-(autoload 'gnorb-gnus-nnir-search "nngnorb")
-(autoload 'gnorb-gnus-nnir-registry-search "nngnorb")
-
-(defgroup gnorb-gnus nil
-  "The Gnus bits of Gnorb."
-  :tag "Gnorb Gnus"
-  :group 'gnorb)
-
-(defcustom gnorb-gnus-mail-search-backends
-  '((notmuch (lambda (terms)
-              (mapconcat
-               (lambda (m)
-                 (replace-regexp-in-string "\\." "\\\\." m))
-               terms " OR "))
-            notmuch-search)
-    (mairix (lambda (terms)
-             (mapconcat 'identity
-                        terms ","))
-           mairix-search)
-    (namazu (lambda (terms)
-             (mapconcat 'identity
-                        terms " or "))
-           namazu-search))
-  "Various backends for mail search.
-
-An alist of backends, where each element consists of three parts:
-the symbol name of the backend, a lambda form which receives a
-list of email addresses and returns a properly-formatted search
-string, and the symbol name of the function used to initiate the
-search."
-  :type 'list)
-
-(defcustom gnorb-gnus-mail-search-backend nil
-  "Mail search backend currently in use. One of the three symbols
-notmuch, namazu, or mairix."
-  :type 'symbol)
-
-(defcustom gnorb-gnus-capture-always-attach nil
-  "Always prompt about attaching attachments when capturing from
-  a Gnus message, even if the template being used hasn't
-  specified the :gnus-attachments key.
-
-Basically behave as if all attachments have \":gnus-attachments t\"."
-  :type 'boolean)
-
-(defcustom gnorb-gnus-new-todo-capture-key nil
-  "Key for the capture template to use when creating a new TODO
-  from an outgoing message."
-  :type 'string)
-
-(defcustom gnorb-gnus-copy-message-text nil
-  "When capturing or triggering a TODO from a Gnus message,
-should the text of the message be saved?
-
-If t, the body text of the message is pushed onto the kill ring.
-If a char value, the text is saved into the corresponding
-register."
-  :type '(choice boolean
-                character))
-
-(defcustom gnorb-gnus-hint-relevant-article t
-  "When opening a gnus message, should gnorb let you know if the
-  message is relevant to an existing TODO?"
-  :type 'boolean)
-
-(defcustom gnorb-gnus-tick-all-tracked-messages nil
-  "When non-nil, add the tick mark to all tracked messages.
-This happens only once, at the time the association is created.
-Ticks can be safely removed later."
-  :type 'boolean)
-
-(defcustom gnorb-gnus-auto-tag-messages nil
-  "When non-nil, tag messages with associated heading tags.
-When creating associations between Org headings and messages,
-automatically copy the heading's tags on to the message, using
-the registry."
-  :type 'boolean)
-
-(defcustom gnorb-gnus-summary-mark-format-letter "g"
-  "Format letter to be used as part of your
-  `gnus-summary-line-format', to indicate in the *Summary* buffer
-  which articles might be relevant to TODOs. Since this is a user
-  format code, it should be prefixed with %u, eg %ug. It will
-  result in the insertion of the value of
-  `gnorb-gnus-summary-mark', for relevant messages, or
-  else a space."
-  :type 'string)
-
-(defcustom gnorb-gnus-summary-tags-format-letter "G"
-  "Format letter to be replaced with message tags.
-Add this format specification to your `gnus-summary-line-format'
-to show the tags which are currently applied to the message.
-Must be prefixed with \"u\", eg. \"%uG\"."
-  :type 'string)
-
-(defcustom gnorb-gnus-summary-mark "¡"
-  "Default mark to insert in the summary format line of articles
-  that are likely relevant to existing TODO headings."
-  :type 'string)
-
-(defcustom gnorb-gnus-summary-tracked-mark "&"
-  "Default mark to insert in the summary format line of articles
-  that are already tracked by TODO headings."
-  :type 'string)
-
-(defcustom gnorb-gnus-trigger-refile-targets
-  '((org-agenda-files :maxlevel . 4))
-  "A value to use as an equivalent of `org-refile-targets' (which
-  see) when offering trigger targets for
-  `gnorb-gnus-incoming-do-todo'."
-  :type 'list)
-
-(defcustom gnorb-gnus-refile-use-outline-path 'org
-  "Gnorb equivalent of `org-refile-use-outline-path' (which see).
-Used when selecting Org headings for triggering or attaching
-attachments."
-  :type '(choice
-         (const :tag "Not" nil)
-         (const :tag "Yes" t)
-         (const :tag "Start with file name" file)
-         (const :tag "Start with full file path" full-file-path)
-         (const :tag "Start with buffer name" buffer-name)
-         (const :tag "Use org-refile-use-outline-path" org)))
-
-(defcustom gnorb-gnus-sent-groups nil
-  "A list of strings indicating sent mail groups.
-In some cases, Gnorb can't detect where your sent messages are
-stored (ie if you're using IMAP sent mail folders instead of
-local archiving. If you want Gnorb to be able to find sent
-messages, this option can help it do that. It should be set to a
-list of strings, which are assumed to be fully qualified
-server+group combinations, ie \"nnimap+Server:[Gmail]/Sent
-Mail\", or something similar. This only has to be done once for
-each message."
-  :type '(repeat (string :tag "Group name")))
-
-(defvar gnorb-gnus-capture-attachments nil
-  "Holding place for attachment names during the capture
-  process.")
-
-(defvar-local gnorb-gnus-attachment-file-list nil
-  "A place to store Org attachments relevant to the subtree being
-  viewed.")
-
-;;; What follows is a very careful copy-pasta of bits and pieces from
-;;; mm-decode.el and gnus-art.el. Voodoo was involved.
-
-;;;###autoload
-(defun gnorb-gnus-article-org-attach (n)
-  "Save MIME part N, which is the numerical prefix, of the
-  article under point as an attachment to the specified org
-  heading."
-  (interactive "P")
-  (gnus-article-part-wrapper n 'gnorb-gnus-attach-part))
-
-;;;###autoload
-(defun gnorb-gnus-mime-org-attach ()
-  "Save the MIME part under point as an attachment to the
-  specified org heading."
-  (interactive)
-  (gnus-article-check-buffer)
-  (let ((data (get-text-property (point) 'gnus-data)))
-    (when data
-      (gnorb-gnus-attach-part data))))
-
-(defun gnorb-gnus-attach-part (handle)
-  "Attach HANDLE to an existing org heading."
-  (let* ((filename (gnorb-gnus-save-part handle))
-        (org-refile-targets gnorb-gnus-trigger-refile-targets)
-        (org-refile-use-outline-path
-         (if (eq gnorb-gnus-refile-use-outline-path 'org)
-             org-refile-use-outline-path
-           gnorb-gnus-refile-use-outline-path))
-        (headers (gnus-data-header
-                  (gnus-data-find
-                   (gnus-summary-article-number))))
-        (tracked-headings (gnorb-find-tracked-headings headers))
-        (target-heading
-         (gnorb-choose-trigger-heading tracked-headings)))
-    (require 'org-attach)
-    (save-window-excursion
-      (org-id-goto target-heading)
-      (org-attach-attach filename nil 'mv))))
-
-(defun gnorb-gnus-save-part (handle)
-  (let ((filename (or (mail-content-type-get
-                      (mm-handle-disposition handle) 'filename)
-                     (mail-content-type-get
-                      (mm-handle-type handle) 'name))))
-    (setq filename
-         (gnus-map-function mm-file-name-rewrite-functions
-                            (file-name-nondirectory filename)))
-    (setq filename (expand-file-name filename gnorb-tmp-dir))
-    (mm-save-part-to-file handle filename)
-    filename))
-
-(defun gnorb-gnus-collect-all-attachments (&optional capture-p store)
-  "Collect all the attachments from the message under point, and
-save them into `gnorb-tmp-dir'."
-  (save-window-excursion
-    (when capture-p
-      (set-buffer (org-capture-get :original-buffer)))
-    (unless (memq major-mode '(gnus-summary-mode gnus-article-mode))
-      (error "Only works in Gnus summary or article buffers"))
-    (let ((article (gnus-summary-article-number))
-         mime-handles)
-      (when (or (null gnus-current-article)
-               (null gnus-article-current)
-               (/= article (cdr gnus-article-current))
-               (not (equal (car gnus-article-current) gnus-newsgroup-name)))
-       (gnus-summary-display-article article))
-      (gnus-eval-in-buffer-window gnus-article-buffer
-       (setq mime-handles (cl-remove-if-not
-                           (lambda (h)
-                             (let ((disp (mm-handle-disposition (cdr h))))
-                               (and (member (car disp)
-                                            '("inline" "attachment"))
-                                    (mail-content-type-get disp 'filename))))
-                           gnus-article-mime-handle-alist)))
-      (when mime-handles
-       (dolist (h mime-handles)
-         (let ((filename
-                (gnorb-gnus-save-part (cdr h))))
-           (when (or capture-p store)
-             (push filename gnorb-gnus-capture-attachments))))))))
-
-;;; Storing, removing, and acting on Org headers in messages.
-
-(defvar gnorb-gnus-message-info nil
-  "Place to store the To, Subject, Date, and Message-ID headers
-  of the currently-sending or last-sent message.")
-
-(defun gnorb-gnus-check-outgoing-headers ()
-  "Save the value of the `gnorb-mail-header' for the current
-message; multiple header values returned as a string. Also save
-information about the outgoing message into
-`gnorb-gnus-message-info'."
-  (save-restriction
-    (message-narrow-to-headers)
-    (setq gnorb-gnus-message-info nil)
-    (let* ((org-ids (mail-fetch-field gnorb-mail-header nil nil t))
-          (msg-id (mail-fetch-field "Message-ID"))
-          (refs (mail-fetch-field "References"))
-          (in-reply-to (mail-fetch-field "In-Reply-To"))
-          (to (if (message-news-p)
-                  (mail-fetch-field "Newsgroups")
-                (mail-fetch-field "To")))
-          (from (mail-fetch-field "From"))
-          (subject (mail-fetch-field "Subject"))
-          (date (mail-fetch-field "Date"))
-          ;; If we can get a link, that's awesome.
-          (gcc (mail-fetch-field "Gcc"))
-          (link (or (and gcc
-                         (org-store-link nil))
-                    nil))
-          (group (ignore-errors (car (split-string link "#")))))
-      ;; If we can't make a real link, then save some information so
-      ;; we can fake it.
-      (when in-reply-to
-       (setq refs (concat refs " " in-reply-to)))
-      (when refs
-       (setq refs (gnus-extract-references refs)))
-      (setq gnorb-gnus-message-info
-           `(:subject ,subject :msg-id ,msg-id
-                      :to ,to :from ,from
-                      :link ,link :date ,date :refs ,refs
-                      :group ,group))
-      (if org-ids
-         (progn
-           (require 'gnorb-org)
-           (setq gnorb-message-org-ids org-ids)
-           ;; `gnorb-org-setup-message' may have put this here, but
-           ;; if we're working from a draft, or triggering this from
-           ;; a reply, it might not be there yet.
-           (add-to-list 'message-send-actions
-                        'gnorb-org-restore-after-send t))
-       (setq gnorb-message-org-ids nil)))))
-
-(add-hook 'message-sent-hook #'gnorb-gnus-check-outgoing-headers t)
-
-;;;###autoload
-(defun gnorb-gnus-outgoing-do-todo (&optional arg)
-  "Use this command to use the message currently being composed
-as an email todo action.
-
-If it's a new message, or a reply to a message that isn't
-referenced by any TODOs, a new TODO will be created.
-
-If it references an existing TODO, you'll be prompted to trigger
-a state-change or a note on that TODO after the message is sent.
-
-You can call it with a prefix arg to force choosing an Org
-subtree to associate with.
-
-If you've already called this command, but realize you made a
-mistake, you can call this command with a double prefix to reset
-the association.
-
-If a new todo is made, it needs a capture template: set
-`gnorb-gnus-new-todo-capture-key' to the string key for the
-appropriate capture template. If you're using a gnus-based
-archive method (ie you have `gnus-message-archive-group' set to
-something, and your outgoing messages have a \"Fcc\" header),
-then a real link will be made to the outgoing message, and all
-the gnus-type escapes will be available (see the Info
-manual (org) Template expansion section). If you don't, then the
-%:subject, %:to, %:toname, %:toaddress, and %:date escapes for
-the outgoing message will still be available -- nothing else will
-work."
-  (interactive "P")
-  (let ((org-refile-targets gnorb-gnus-trigger-refile-targets)
-       (org-refile-use-outline-path
-        (if (eq gnorb-gnus-refile-use-outline-path 'org)
-            org-refile-use-outline-path
-          gnorb-gnus-refile-use-outline-path))
-       (compose-marker (make-marker))
-       header-ids ref-ids rel-headings
-       gnorb-window-conf in-reply-to)
-    (when (equal arg '(4))
-      (setq rel-headings
-           (org-refile-get-location "Trigger action on" nil t))
-      (setq rel-headings
-           (list (list (save-window-excursion
-                         (find-file (nth 1 rel-headings))
-                         (goto-char (nth 3 rel-headings))
-                         (org-id-get-create))))))
-    (if (not (derived-mode-p 'message-mode 'mail-mode))
-       ;; The message is already sent, so we're relying on whatever was
-       ;; stored into `gnorb-gnus-message-info'.
-       (if (equal arg '(16))
-           (user-error "A double prefix is only useful with an
-           unsent message.")
-         (if arg
-             (progn
-               (push (caar rel-headings) gnorb-message-org-ids)
-               (gnorb-org-restore-after-send))
-           (setq ref-ids (plist-get gnorb-gnus-message-info :refs))
-           (if ref-ids
-               ;; the message might be relevant to some TODO
-               ;; heading(s). But if there had been org-id
-               ;; headers, they would already have been
-               ;; handled when the message was sent.
-               (progn
-                 (setq rel-headings (gnorb-find-visit-candidates ref-ids))
-                 (if (not rel-headings)
-                     (gnorb-gnus-outgoing-make-todo-1)
-                   (dolist (h rel-headings)
-                     (push h gnorb-message-org-ids))
-                   (gnorb-org-restore-after-send)))
-             ;; not relevant, just make a new TODO
-             (gnorb-gnus-outgoing-make-todo-1))))
-      ;; We are still in the message composition buffer, so let's see
-      ;; what we've got.
-
-      (if (equal arg '(16))
-         ;; Double prefix arg means delete the association we already
-         ;; made.
-         (save-excursion
-           (save-restriction
-             (widen)
-             (setq message-send-actions
-                   (remove 'gnorb-gnus-outgoing-make-todo-1
-                           message-send-actions))
-             (message-narrow-to-headers-or-head)
-             (message-remove-header
-              gnorb-mail-header)
-             (message "Message associations have been reset")))
-       ;; Save-excursion won't work, because point will move if we
-       ;; insert headings.
-       (move-marker compose-marker (point))
-       (save-restriction
-         (widen)
-         (message-narrow-to-headers-or-head)
-         (setq header-ids (mail-fetch-field gnorb-mail-header nil nil t))
-         ;; With a prefix arg we do not check references, because the
-         ;; whole point is to add new references. We still want to know
-         ;; what org id headers are present, though, so we don't add
-         ;; duplicates.
-         (setq ref-ids (unless arg (mail-fetch-field "References" t)))
-         (setq in-reply-to (unless arg (mail-fetch-field "In-Reply-to" t)))
-         (when in-reply-to
-           (setq ref-ids (concat ref-ids " " in-reply-to)))
-         (when ref-ids
-           ;; if the References header points to any message ids that are
-           ;; tracked by TODO headings...
-           (setq rel-headings (gnorb-find-visit-candidates ref-ids)))
-         (when rel-headings
-           (goto-char (point-min))
-           (dolist (h (delete-dups rel-headings))
-             ;; then get the org-ids of those headings, and insert
-             ;; them into this message as headers. If the id was
-             ;; already present in a header, don't add it again.
-             (unless (member h header-ids)
-               (goto-char (point-at-bol))
-               (open-line 1)
-               (message-insert-header
-                (intern gnorb-mail-header)
-                h)
-               ;; tell the rest of the function that this is a relevant
-               ;; message
-               (push h header-ids)))))
-       (goto-char compose-marker)
-       (unless header-ids
-         (add-to-list 'message-send-actions
-          'gnorb-gnus-outgoing-make-todo-1 t))
-       (message
-        (if header-ids
-            "Message will trigger TODO state-changes after sending"
-          "A TODO will be made from this message after it's sent"))))))
-
-(defvar org-capture-link-is-already-stored)
-
-(defun gnorb-gnus-outgoing-make-todo-1 ()
-  (unless gnorb-gnus-new-todo-capture-key
-    (error "No capture template key set, customize 
gnorb-gnus-new-todo-capture-key"))
-  (let* ((link (plist-get gnorb-gnus-message-info :link))
-        (group (plist-get gnorb-gnus-message-info :group))
-        (date (plist-get gnorb-gnus-message-info :date))
-        (date-ts (and date
-                      (ignore-errors
-                        (format-time-string
-                         (org-time-stamp-format t)
-                         (date-to-time date)))))
-        (date-ts-ia (and date
-                         (ignore-errors
-                           (format-time-string
-                            (org-time-stamp-format t t)
-                            (date-to-time date)))))
-        (msg-id (plist-get gnorb-gnus-message-info :msg-id))
-        (sender (plist-get gnorb-gnus-message-info :from))
-        (subject (plist-get gnorb-gnus-message-info :subject))
-        ;; Convince Org we already have a link stored, even if we
-        ;; don't.
-        (org-capture-link-is-already-stored t))
-    (if link
-       ;; Even if you make a link to not-yet-sent messages, even if
-       ;; you've saved the draft and it has a Date header, that
-       ;; header isn't saved into the link plist. So fake that, too.
-       (org-link-add-props
-        :date date
-        :date-timestamp date-ts
-        :date-timestamp-inactive date-ts-ia
-        :annotation link)
-      (org-link-store-props
-       :subject (plist-get gnorb-gnus-message-info :subject)
-       :to (plist-get gnorb-gnus-message-info :to)
-       :date date
-       :date-timestamp date-ts
-       :date-timestamp-inactive date-ts-ia
-       :message-id msg-id
-       :annotation link))
-    (org-capture nil gnorb-gnus-new-todo-capture-key)
-    (when msg-id
-      (gnorb-registry-make-entry msg-id sender subject (org-id-get-create) 
group))))
-
-;;; If an incoming message should trigger state-change for a Org todo,
-;;; call this function on it.
-
-;;;###autoload
-(defun gnorb-gnus-incoming-do-todo (arg &optional id)
-  "Use the message under point to trigger an action on an Org heading.
-This function stores a link to the message, prompts for a related
-Org heading, visits the heading, and triggers an action on
-it (see `gnorb-org-trigger-actions').
-
-If you've set up message tracking (with
-`gnorb-tracking-initialize'), Gnorb can guess which Org heading
-you probably want to trigger, which can save some time.  It does
-this by looking in the References header, and seeing if any of
-the messages referenced there are already being tracked by any
-headings.
-
-If you mark several messages before calling this function, or
-call it with a numerical prefix arg, those messages will be
-\"bulk associated\" with the chosen Org heading: associations
-will be made, but you won't be prompted to trigger an action, and
-you'll stay in the Gnus summary buffer."
-  (interactive "P")
-  (when (not (memq major-mode '(gnus-summary-mode gnus-article-mode)))
-    (user-error "Only works in gnus summary or article mode"))
-  ;; We should only store a link if it's not already at the head of
-  ;; `org-stored-links'. There's some duplicate storage, at
-  ;; present. Take a look at calling it non-interactively.
-  (setq gnorb-window-conf (current-window-configuration))
-  (move-marker gnorb-return-marker (point))
-  (setq gnorb-gnus-message-info nil)
-  (let* ((buf (current-buffer))
-        (articles (gnus-summary-work-articles arg))
-        (art-no (gnus-summary-article-number))
-        (headers (gnus-data-header
-                  (gnus-data-find art-no)))
-        (msg-id (mail-header-id headers))
-        (from (mail-header-from headers))
-        (subject (mail-header-subject headers))
-        (date (mail-header-date headers))
-        (to (cdr (assoc 'To (mail-header-extra headers))))
-        (group (gnorb-get-real-group-name
-                gnus-newsgroup-name
-                art-no))
-        (text (gnus-with-article-buffer
-                (article-goto-body)
-                (buffer-substring-no-properties
-                 (point) (point-max))))
-        (link (call-interactively 'org-store-link))
-        (org-refile-targets gnorb-gnus-trigger-refile-targets)
-        (org-refile-use-outline-path
-         (if (eq gnorb-gnus-refile-use-outline-path 'org)
-             org-refile-use-outline-path
-           gnorb-gnus-refile-use-outline-path))
-        (ref-msg-ids (concat (mail-header-references headers) " "
-                             msg-id))
-        (related-headings
-         (when (and (null id) ref-msg-ids)
-           ;; Specifically ask for zombies, so the user has chance to
-           ;; flush them out.
-           (gnorb-find-tracked-headings headers t)))
-        targ tags)
-    (setq gnorb-gnus-message-info
-         `(:subject ,subject :msg-id ,msg-id
-                    :to ,to :from ,from
-                    :link ,link :date ,date :refs ,ref-msg-ids
-                    :group ,group))
-    (gnorb-gnus-collect-all-attachments nil t)
-    (unwind-protect
-       (if id
-           (progn
-             (delete-other-windows)
-             (gnorb-trigger-todo-action nil id))
-         ;; Flush out zombies (dead associations).
-         (setq related-headings
-               (cl-remove-if
-                (lambda (h)
-                  (when (null (org-id-find-id-file h))
-                    (when (y-or-n-p
-                           (format
-                            "ID %s no longer exists, disassociate message?"
-                            h))
-                      (gnorb-delete-association msg-id h))))
-                related-headings))
-         ;; See if one of the related headings is chosen.
-         (unless (catch 'target
-                   (dolist (h related-headings nil)
-                     (when (yes-or-no-p
-                            (format "Trigger action on %s"
-                                    (gnorb-pretty-outline h)))
-                       (throw 'target (setq targ h)))))
-           ;; If not, use the refile interface to choose one.
-           (setq targ (org-refile-get-location
-                       "Trigger heading" nil))
-           (setq targ
-                 (save-window-excursion
-                   (find-file (nth 1 targ))
-                   (goto-char (nth 3 targ))
-                   (setq tags (org-get-tags))
-                   (org-id-get-create))))
-         ;; Either bulk associate multiple messages...
-         (if (> (length articles) 1)
-             (progn
-               (dolist (a articles)
-                 (gnorb-registry-make-entry
-                  (mail-header-id
-                   (gnus-data-header
-                    (gnus-data-find a)))
-                  from subject targ group)
-                 (gnus-summary-remove-process-mark a))
-               (message "Associated %d messages with %s"
-                        (length articles) (gnorb-pretty-outline targ)))
-           ;; ...or just trigger the one.
-           (delete-other-windows)
-           (gnorb-trigger-todo-action nil targ)
-           (when gnorb-gnus-copy-message-text
-             (if (characterp gnorb-gnus-copy-message-text)
-                 (with-temp-buffer
-                   (insert text)
-                   (copy-to-register
-                    gnorb-gnus-copy-message-text
-                    (point-min) (point-max))
-                   (message "Message text copied to register %c"
-                            gnorb-gnus-copy-message-text))
-               (kill-new text)
-               (message "Message text copied to kill ring"))))
-         (with-current-buffer buf
-           (dolist (a articles)
-             (when gnorb-gnus-tick-all-tracked-messages
-               (gnus-summary-mark-article a gnus-ticked-mark))
-             (when gnorb-gnus-auto-tag-messages
-               (gnorb-gnus-tag-message
-                (mail-header-id (gnus-data-header (gnus-data-find a)))
-                tags))
-             (gnus-summary-update-article a))))
-      ;; No matter what, clear these two variables.
-      (setq gnorb-gnus-message-info nil)
-      (setq gnorb-gnus-capture-attachments nil))))
-
-;;;###autoload
-(defun gnorb-gnus-quick-reply ()
-  "Compose a reply to the message under point, and associate both
-the original message and the reply with the selected heading.
-Take no other action.
-
-Use this when you want to compose a reply to a message on the
-spot, and track both messages, without having to go through the
-hassle of triggering an action on a heading, and then starting a
-reply."
-  (interactive)
-  (when (not (memq major-mode '(gnus-summary-mode gnus-article-mode)))
-    (user-error "Only works in gnus summary or article mode"))
-  (let* ((art-no (gnus-summary-article-number))
-        (headers (gnus-data-header
-                  (gnus-data-find art-no)))
-        (msg-id (mail-header-id headers))
-        (from (mail-header-from headers))
-        (subject (mail-header-subject headers))
-        (group (gnorb-get-real-group-name
-                gnus-newsgroup-name
-                art-no))
-        (ref-msg-ids (concat (mail-header-references headers) " "
-                             msg-id))
-        (related-headings
-         (when ref-msg-ids
-           (gnorb-find-tracked-headings headers t)))
-        (targ (car-safe related-headings)))
-    (if targ
-       (let ((ret (make-marker)))
-         (setq gnorb-window-conf (current-window-configuration))
-         (move-marker gnorb-return-marker (point))
-         (when gnorb-gnus-tick-all-tracked-messages
-           (gnus-summary-mark-article art-no gnus-ticked-mark))
-         ;; Assume the first heading is the one we want.
-         (gnorb-registry-make-entry
-          msg-id from subject targ group)
-         ;; Maybe tag the message.
-         (when gnorb-gnus-auto-tag-messages
-           (let ((tags (save-window-excursion
-                         (org-id-goto targ)
-                         (org-get-tags))))
-             (gnorb-gnus-tag-message msg-id tags)))
-         (gnus-summary-update-article art-no)
-         (gnus-summary-wide-reply-with-original 1)
-         (move-marker ret (point))
-         (save-restriction
-           (widen)
-           (message-narrow-to-headers-or-head)
-           (goto-char (point-min))
-           (open-line 1)
-           (message-insert-header
-            (intern gnorb-mail-header) targ))
-         (goto-char ret)
-         (message
-          (format "Original message and reply will be associated with %s"
-                  (gnorb-pretty-outline targ))))
-      (message "No associated headings found"))))
-
-(with-eval-after-load 'gnus-registry
-  (add-to-list 'gnus-registry-extra-entries-precious 'org-tags)
-  (add-to-list 'gnus-registry-track-extra 'org-tags))
-
-(defvar gnorb-registry-search-history nil)
-
-;;;###autoload
-(defun gnorb-gnus-search-registry (search-string)
-  "Search for and display messages using the registry.
-Prompt for a registry-specific SEARCH-STRING, then create an
-ephemeral group containing the resulting messages.  All tracked
-registry data keys are acceptable, see (slot-value
-gnus-registry-db 'tracked).  Unknown keys will be ignored.  Keys
-and search strings should be given as \"key:value\", with extra
-quotes around multi-word search values.  Eg:
-
-sender:google.com subject:\"your search results\""
-  (interactive
-   (list (read-string "Registry search terms: " nil
-                     gnorb-registry-search-history)))
-  (let ((case-fold-search t)
-       parsed found this-pass term)
-    (with-temp-buffer
-      (insert search-string)
-      (goto-char (point-min))
-      (while (re-search-forward
-             "\\([[:alpha:]]+\\):\\(\\(?:[^\"[:blank:]]+\\|\"[^\"]+\"\\)\\)"
-             (point-at-eol) t)
-       (push (cons (intern (match-string 1))
-                   (replace-regexp-in-string "\\`\"\\|\"\\'" ""
-                                             (match-string 2)))
-             parsed)))
-    (dolist (sym (slot-value gnus-registry-db 'tracked))
-      (when (setq term (cdr-safe (assoc sym parsed)))
-       (maphash
-        (lambda (k v)
-          (when (string-match-p term k)
-            (setq this-pass (append v this-pass))))
-        (gethash sym (slot-value gnus-registry-db 'tracker)))
-       (setq found (if found
-                       (seq-intersection found this-pass)
-                     this-pass)
-             this-pass nil)))
-    (if found
-       (let ((artlist
-              (delq
-               nil
-               (mapcar
-                (lambda (msg)
-                  (pcase-let ((`(,group . ,artno)
-                               (gnorb-msg-id-request-head
-                                msg (car-safe
-                                     (gnus-registry-get-id-key msg 'group)))))
-                    (when (and group artno (integerp artno) (> artno 0))
-                      (vector group artno 100))))
-                (delq nil (delete-dups found))))))
-         (switch-to-buffer gnus-group-buffer)
-         (if (featurep 'nnselect)
-             (gnus-group-read-ephemeral-group
-              "registry messages" '(nnselect "nnselect-gnorb") nil
-              `(switch-to-buffer ,gnus-group-buffer)
-              nil nil `((nnselect-artlist . ,artlist)))
-           (gnorb-gnus-nnir-registry-search artlist)))
-      (message "No results found"))))
-
-;;;###autoload
-(defun gnorb-gnus-tag-message (arg &optional tags)
-  "Tag message or messages with TAGS.
-ARG is used to specify which messages to work on (according to
-Gnus' process prefix convention).  TAGS should be a list of Org
-tags.  The tags are stored under the `org-tags' key in the
-registry.  If called from a lisp program, TAGS are added to any
-existing tags.
-
-If multiple messages are to be tagged, only the first message's
-existing tags are offered as a default."
-  (interactive "P")
-  (let* ((articles (or (gnus-summary-work-articles arg)
-                      (user-error "This command must be used within Gnus")))
-        (first (mail-header-id
-                (gnus-data-header
-                 (gnus-data-find (car articles)))))
-        (crm-separator ":")
-        (current (gnus-registry-get-id-key first 'org-tags))
-        (default (when current
-                   (mapconcat #'identity current ":"))))
-    (setq tags
-         (if tags
-             (delete-dups (append current tags))
-           (completing-read-multiple
-            "Tags: "
-            (org-global-tags-completion-table) nil t default)))
-    (dolist (a articles)
-      (let ((msg-id (mail-header-id
-                    (gnus-data-header
-                     (gnus-data-find a)))))
-       (gnus-registry-set-id-key msg-id 'org-tags tags)
-       (gnus-summary-update-article a)))
-    (gnus-message 5 "%d message%s tagged: %s"
-                 (length articles)
-                 (if (= 1 (length articles)) "" "s")
-                 (mapconcat #'identity tags ":"))))
-
-;;;###autoload
-(defun gnorb-gnus-insert-tagged-messages (tags)
-  "Insert articles in this group with tags matching TAGS.
-TAGS is a string possibly containing multiple tags to include or
-exclude.  See Info node `(org)Matching tags and properties'."
-  (interactive "MTags: ")
-  (let ((matcher (cdr (org-make-tags-matcher tags)))
-       (tagged-messages (registry-search gnus-registry-db
-                                         :regex `((org-tags ".+"))
-                                         :member `((group 
,gnus-newsgroup-name))))
-       (old (sort (mapcar 'car gnus-newsgroup-data) '<))
-       selected-messages)
-    ;; Funcall the matcher with t, (list of tags), and 1.
-    (dolist (m tagged-messages)
-      (when (funcall matcher t (gnus-registry-get-id-key m 'org-tags) 1)
-       (push m selected-messages)))
-    (if selected-messages
-       ;; Turn message ids into article numbers.
-       (progn
-         (setq selected-messages
-               (mapcar (lambda (id) (cdr (gnus-request-head id 
gnus-newsgroup-name)))
-                       selected-messages))
-         (gnus-summary-insert-articles selected-messages)
-         (gnus-summary-limit (gnus-sorted-nunion old selected-messages))
-         (gnus-summary-position-point))
-      (message "No matching messages in this group"))))
-
-;;;###autoload
-(defun gnorb-gnus-insert-tracked-messages (show-all)
-  "Insert tracked messages into the Summary buffer.
-Only inserts tracked messages belonging to this group.  If
-SHOW-ALL (interactively, the prefix arg) is non-nil, insert all
-messages; otherwise only insert messages that are tracked by a
-heading in a non-DONE state."
-  (interactive "P")
-  (let ((old (sort (mapcar 'car gnus-newsgroup-data) '<))
-       (tracked-messages
-        (registry-search gnus-registry-db
-                         :regex `((gnorb-ids ".+"))
-                         :member `((group ,gnus-newsgroup-name)))))
-    (unless show-all
-      (setq tracked-messages
-           (cl-remove-if
-            (lambda (msg-id)
-              (let ((id (car-safe (gnus-registry-get-id-key
-                                   msg-id 'gnorb-ids))))
-                (or (null id)
-                    (save-window-excursion
-                      (org-id-goto id)
-                      (org-entry-is-done-p)))))
-            tracked-messages)))
-    (if tracked-messages
-       (progn
-         (setq tracked-messages
-               (delq nil
-                     (mapcar (lambda (id)
-                               (cdr (gnus-request-head id 
gnus-newsgroup-name)))
-                             tracked-messages)))
-         (gnus-summary-insert-articles tracked-messages)
-         (gnus-summary-limit (gnus-sorted-nunion tracked-messages old))
-         (gnus-summary-position-point))
-      (message "No tracked messages in this group"))))
-
-;;;###autoload
-(defun gnorb-gnus-search-messages (str persist &optional head-text ret)
-  "Initiate a search for gnus message links in an org subtree.
-The arg STR can be one of two things: an Org heading id value
-\(IDs should be prefixed with \"id+\"), in which case links will
-be collected from that heading, or a string corresponding to an
-Org tags search, in which case links will be collected from all
-matching headings.
-
-In either case, once a collection of links have been made, they
-will all be displayed in an ephemeral Gnus group.  In Emacs 27
-and below this requires the presence of an active \"nngnorb\"
-server to work.  In Emacs 28 and later, no setup is required.
-
-If PERSIST is non-nil, make a permanent group, and offer
-HEAD-TEXT, if present, as its name.  Otherwise create an
-ephemeral one, with RET as the value of its quit-config."
-  (interactive)
-  (unless (gnus-alive-p)
-    (gnus))
-  (if (featurep 'nnselect)
-      (gnorb-gnus-nnselect-search str persist head-text ret)
-    (gnorb-gnus-nnir-search str persist head-text ret)))
-
-(defun gnorb-gnus-nnselect-search (str persist &optional head-text ret)
-  "Display gnus messages using the nnselect backend."
-  (let ((specs `((nnselect-specs
-                 (nnselect-function . gnorb-run-search)
-                 (nnselect-args . ,str)))))
-    (if persist
-       (let ((name (gnus-read-group
-                    (format "Name for group (default %s): " head-text)
-                    head-text)))
-         (with-current-buffer gnus-group-buffer
-           (gnus-group-make-group
-            name (list 'nnselect "nnselect-gnorb")
-            nil specs)))
-      (gnus-group-read-ephemeral-group
-       (concat "nnselect-" (message-unique-id))
-       (list 'nnselect "nnselect-gnorb")
-       nil ret nil nil specs))))
-
-(defun gnorb-run-search (q)
-  (save-window-excursion
-    (let ((buf (get-buffer-create "gnorb search"))
-         msg-ids org-ids links vectors)
-      (with-current-buffer buf
-       (erase-buffer)
-       (setq gnorb-gnus-attachment-file-list nil))
-      (cond ((string-match "id\\+\\([[:alnum:]-]+\\)$" q)
-            (with-demoted-errors "Error: %S"
-              (org-id-goto (match-string 1 q))
-              (save-restriction
-                (org-narrow-to-subtree)
-                (append-to-buffer
-                 buf
-                 (point-min)
-                 (point-max))
-                (setq org-ids
-                      (append
-                       (gnorb-collect-ids)
-                       org-ids))
-                (when org-ids
-                  (with-current-buffer buf
-                    ;; The file list var is buffer local, so set it
-                    ;; (local to Gnorb's search buffer) to a full
-                    ;; list of all files in the subtree.
-                    (dolist (id org-ids)
-                      (setq gnorb-gnus-attachment-file-list
-                            (append (gnorb-org-attachment-list id)
-                                    gnorb-gnus-attachment-file-list))))))))
-           ((listp q)
-            ;; be a little careful: this could be a list of links, or
-            ;; it could be the full plist
-            (setq links (if (plist-member q :gnus)
-                            (plist-get q :gnus)
-                          q)))
-           (t (org-map-entries
-               (lambda ()
-                 (push (org-id-get) org-ids)
-                 (append-to-buffer
-                  buf
-                  (point)
-                  (save-excursion
-                    (outline-next-heading)
-                    (point))))
-               q
-               'agenda)))
-      (with-current-buffer buf
-       (goto-char (point-min))
-       (setq links (append
-                    (alist-get 'gnus (gnorb-scan-links (point-max) 'gnus))
-                    links))
-
-       (goto-char (point-min)))
-      ;; First add all links to messages (elements of messages should
-      ;; look like (group-name message-id)).
-      (dolist (l links)
-       (push (org-link-unescape
-              (nth 1 (split-string l "#")))
-             msg-ids))
-
-      (unless (gnus-alive-p)
-       (gnus))
-
-      ;; Then use the registry to turn list of org-ids into list of
-      ;; msg-ids.
-      (dolist (i (delq nil (delete-dups org-ids)))
-       (when-let ((rel-msg-id (gnorb-registry-org-id-search i)))
-         (setq msg-ids (append (delq nil rel-msg-id) msg-ids))))
-
-      ;; Then find the group and article number for each msg-id, and
-      ;; push that onto our return value "vectors".
-      (when msg-ids
-       (dolist (id (delete-dups msg-ids) (when vectors
-                                           (nreverse vectors)))
-         (pcase-let ((`(,group . ,artno) (gnorb-msg-id-request-head id)))
-           (when (and artno (integerp artno) (> artno 0))
-             (push (vector group artno 100) vectors))))))))
-
-(defvar gnorb-summary-minor-mode-map (make-sparse-keymap)
-  "Keymap for use in Gnorb's *Summary* minor mode.")
-
-(define-minor-mode gnorb-summary-minor-mode
-  "A minor mode for use in nnir *Summary* buffers created by Gnorb.
-These *Summary* buffers are usually created by calling
-`gnorb-org-view', or by otherwise initiating a search of
-Gnorb-tracked messages.
-
-While active, this mode provides some Gnorb-specific commands,
-and also advises Gnus' reply-related commands in order to
-continue to provide tracking of sent messages."
-  nil " Gnorb" gnorb-summary-minor-mode-map
-  (setq gnorb-gnus-attachment-file-list
-       ;; Copy the list of attached files from the nnir-tmp-buffer to
-       ;; this summary buffer.
-       (buffer-local-value
-        'gnorb-gnus-attachment-file-list
-         (get-buffer-create nnir-tmp-buffer))))
-
-(define-key gnorb-summary-minor-mode-map
-  [remap gnus-summary-exit]
-  'gnorb-summary-exit)
-
-(define-key gnorb-summary-minor-mode-map (kbd "C-c d")
-  'gnorb-summary-disassociate-message)
-
-;; All this is pretty horrible, but it's the only way to get sane
-;; behavior, there are no appropriate hooks, and I want to avoid
-;; advising functions.
-
-(define-key gnorb-summary-minor-mode-map
-  [remap gnus-summary-very-wide-reply-with-original]
-  'gnorb-summary-very-wide-reply-with-original)
-
-(define-key gnorb-summary-minor-mode-map
-  [remap gnus-summary-wide-reply-with-original]
-  'gnorb-summary-wide-reply-with-original)
-
-(define-key gnorb-summary-minor-mode-map
-  [remap gnus-summary-reply]
-  'gnorb-summary-reply)
-
-(define-key gnorb-summary-minor-mode-map
-  [remap gnus-summary-very-wide-reply]
-  'gnorb-summary-very-wide-reply)
-
-(define-key gnorb-summary-minor-mode-map
-  [remap gnus-summary-reply-with-original]
-  'gnorb-summary-reply-with-original)
-
-(define-key gnorb-summary-minor-mode-map
-  [remap gnus-summary-wide-reply]
-  'gnorb-summary-wide-reply)
-
-(define-key gnorb-summary-minor-mode-map
-  [remap gnus-summary-mail-forward]
-  'gnorb-summary-mail-forward)
-
-(defun gnorb-summary-wide-reply (&optional yank)
-  (interactive
-   (list (and current-prefix-arg
-             (gnus-summary-work-articles 1))))
-  (gnorb-summary-reply yank t))
-
-(defun gnorb-summary-reply-with-original (n &optional wide)
-  (interactive "P")
-  (gnorb-summary-reply (gnus-summary-work-articles n) wide))
-
-(defun gnorb-summary-very-wide-reply (&optional yank)
-  (interactive
-   (list (and current-prefix-arg
-             (gnus-summary-work-articles 1))))
-  (gnorb-summary-reply yank t (gnus-summary-work-articles yank)))
-
-(defun gnorb-summary-reply (&optional yank wide very-wide)
-  (interactive)
-  (gnus-summary-reply yank wide very-wide)
-  (gnorb-summary-reply-hook))
-
-(defun gnorb-summary-wide-reply-with-original (n)
-  (interactive "P")
-  (gnorb-summary-reply-with-original n t))
-
-(defun gnorb-summary-very-wide-reply-with-original (n)
-  (interactive "P")
-  (gnorb-summary-reply
-   (gnus-summary-work-articles n) t (gnus-summary-work-articles n)))
-
-(defun gnorb-summary-mail-forward (n)
-  (interactive "P")
-  (gnus-summary-mail-forward n t)
-  (gnorb-summary-reply-hook))
-
-(defun gnorb-summary-reply-hook (&rest _args)
-  "Function that runs after any command that creates a reply."
-  ;; Not actually a "hook"
-  (let* ((msg-id (if message-reply-headers
-                    (aref message-reply-headers 4)
-                  ;; When forwarding messages,
-                  ;; `message-reply-headers' is nil.
-                  (save-excursion
-                    (let ((case-fold-search t))
-                      (when (re-search-forward "message-id: +\\(.*\\)$" 
(point-max) t)
-                        (match-string 1))))))
-        (org-id (car-safe (gnus-registry-get-id-key msg-id 'gnorb-ids)))
-        (compose-marker (make-marker))
-        (attachments (buffer-local-value
-                      'gnorb-gnus-attachment-file-list
-                      (get-buffer "gnorb search"))))
-    (when org-id
-      (move-marker compose-marker (point))
-      (save-restriction
-       (widen)
-       (message-narrow-to-headers-or-head)
-       (goto-char (point-at-bol))
-       (open-line 1)
-       (message-insert-header
-        (intern gnorb-mail-header)
-        org-id)
-       ;; As with elsewhere, this should be redundant with
-       ;; `gnorb-gnus-check-outgoing-headers.'  Even if not, it
-       ;; should be switched to use `message-send-actions'
-       ;; (add-to-list 'message-exit-actions
-       ;; 'gnorb-org-restore-after-send t)
-       )
-      (goto-char compose-marker))
-    (when attachments
-      (map-y-or-n-p
-       (lambda (a) (format "Attach %s to outgoing message? "
-                          (file-name-nondirectory a)))
-       (lambda (a)
-        (mml-attach-file a (mm-default-file-encoding a)
-                         nil "attachment"))
-       attachments
-       '("file" "files" "attach")))))
-
-;; TODO: Can this be done using Gnus' quit-config?
-(defun gnorb-summary-exit ()
-  "Like `gnus-summary-exit', but restores the gnorb window conf."
-  (interactive)
-  (call-interactively 'gnus-summary-exit)
-  (gnorb-restore-layout))
-
-(defun gnorb-summary-disassociate-message ()
-  "Disassociate a message from its Org TODO.
-This is used in a Gnorb-created *Summary* buffer to remove the
-connection between the message and whichever Org TODO resulted in
-the message being included in this search."
-  (interactive)
-  (unless (get-buffer-window gnus-article-buffer t)
-    (gnus-summary-display-article
-     (gnus-summary-article-number)))
-  (let* ((msg-id (gnus-fetch-original-field "message-id"))
-        (org-ids (gnus-registry-get-id-key msg-id 'gnorb-ids))
-        chosen multiple-alist)
-    (if org-ids
-       (progn
-         (if (= (length org-ids) 1)
-             ;; Only one associated Org TODO.
-             (progn (gnus-registry-set-id-key msg-id 'gnorb-ids nil)
-                    (setq chosen (car org-ids)))
-           ;; Multiple associated TODOs, prompt to choose one.
-           (setq multiple-alist
-                 (mapcar
-                  (lambda (h)
-                    (cons (gnorb-pretty-outline h) h))
-                  org-ids))
-           (setq chosen
-                 (cdr
-                  (assoc
-                   (org-completing-read
-                    "Choose a TODO to disassociate from: "
-                    multiple-alist)
-                   multiple-alist)))
-           (gnus-registry-set-id-key msg-id 'gnorb-ids
-                                     (remove chosen org-ids)))
-         (message "Message disassociated from %s"
-                  (gnorb-pretty-outline chosen)))
-      (message "Message has no associations"))))
-
-(defun gnorb-gnus-summary-mode-hook ()
-  "Check if we've entered a Gnorb-generated group, and activate
-  `gnorb-summary-minor-mode', if so."
-  (let ((method (gnus-find-method-for-group gnus-newsgroup-name))
-       (case-fold-search t))
-    (when (string-match-p "gnorb" (cadr method))
-      (gnorb-summary-minor-mode))))
-
-;;; Automatic noticing of relevant messages
-
-;; likely hooks for the summary buffer include:
-;; `gnus-parse-headers-hook'
-
-;; BBDB puts its notice stuff in the `gnus-article-prepare-hook',
-;; which seems as good a spot as any.
-
-(defun gnorb-gnus-hint-relevant-message ()
-  "When opening an article buffer, check the message to see if it
-is relevant to any existing TODO headings. If so, flash a message
-to that effect. This function is added to the
-`gnus-article-prepare-hook'. It will only do anything if the
-option `gnorb-gnus-hint-relevant-article' is non-nil."
-  (when (and gnorb-gnus-hint-relevant-article
-            (eieio-object-p gnus-registry-db)
-            (not (memq (car (gnus-find-method-for-group
-                             gnus-newsgroup-name))
-                       '(nnvirtual nnir))))
-    (let* ((headers
-           (gnus-data-header
-            (gnus-data-find
-             (gnus-summary-article-number))))
-          (assoc-heading
-           (gnorb-registry-get-id-key
-            (gnus-fetch-original-field "message-id") 'gnorb-ids))
-          (tracked-headings (gnorb-find-tracked-headings headers)))
-      (cond (assoc-heading
-            (message "Message is associated with %s"
-                     (gnorb-pretty-outline (car assoc-heading) t)))
-           (tracked-headings
-            (message
-             (substitute-command-keys
-              "Possible relevant todo %s, trigger with 
\\[gnorb-gnus-incoming-do-todo]")
-             (gnorb-pretty-outline (car tracked-headings) t)))
-           (t nil)))))
-
-(defun gnorb-gnus-insert-format-letter-maybe (header)
-  (if (eieio-object-p gnus-registry-db)
-      (if (not (or (gnus-ephemeral-group-p gnus-newsgroup-name)
-                  (gnus-virtual-group-p gnus-newsgroup-name)))
-         (cond ((gnorb-registry-get-id-key
-                 (mail-header-message-id header) 'gnorb-ids)
-                gnorb-gnus-summary-tracked-mark)
-               ((gnorb-find-tracked-headings header)
-                gnorb-gnus-summary-mark)
-               (t " "))
-       " ")
-    ""))
-
-(defalias (intern (concat "gnus-user-format-function-"
-                         gnorb-gnus-summary-mark-format-letter))
-  (lambda (header)
-    (gnorb-gnus-insert-format-letter-maybe header)))
-
-(defun gnorb-gnus-insert-format-tags (header)
-  (if (eieio-object-p gnus-registry-db)
-      (let ((tags (gnorb-registry-get-id-key
-                  (mail-header-message-id header) 'org-tags)))
-       (if tags
-           (concat
-            ":" (mapconcat #'identity tags ":") ":")
-         ""))
-    ""))
-
-(defalias (intern (concat "gnus-user-format-function-"
-                         gnorb-gnus-summary-tags-format-letter))
-  (lambda (header)
-    (gnorb-gnus-insert-format-tags header)))
-
-;;;###autoload
-(defun gnorb-gnus-view ()
-  "Display the first relevant TODO heading for the message under point"
-  (interactive)
-  (let* ((headers (gnus-data-header
-                  (gnus-data-find
-                   (gnus-summary-article-number))))
-        (tracked-headings
-         (gnorb-find-tracked-headings headers)))
-    (when tracked-headings
-      (setq gnorb-window-conf (current-window-configuration))
-      (move-marker gnorb-return-marker (point))
-      (delete-other-windows)
-      (org-id-goto (car tracked-headings)))))
-
-(defun gnorb-gnus-startup ()
-  (add-hook 'gnus-select-article-hook #'gnorb-gnus-hint-relevant-message)
-  (add-hook 'gnus-summary-prepared-hook #'gnorb-gnus-summary-mode-hook))
-
-(add-hook 'gnus-started-hook #'gnorb-gnus-startup)
-
-(defun gnorb-gnus-shutdown ()
-  (remove-hook 'gnus-select-article-hook #'gnorb-gnus-hint-relevant-message)
-  (remove-hook 'gnus-summary-prepared-hook #'gnorb-gnus-summary-mode-hook))
-
-(gnus-add-shutdown #'gnorb-gnus-shutdown 'gnus)
-
-(provide 'gnorb-gnus)
-;;; gnorb-gnus.el ends here
diff --git a/packages/gnorb/gnorb-helm.el b/packages/gnorb/gnorb-helm.el
deleted file mode 100644
index f58f604..0000000
--- a/packages/gnorb/gnorb-helm.el
+++ /dev/null
@@ -1,109 +0,0 @@
-;;; gnorb-helm.el --- Interface between Helm and Gnorb  -*- lexical-binding: 
t; -*-
-
-;; Copyright (C) 2018-2020  Free Software Foundation, Inc.
-
-;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
-
-;; 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 3 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, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Convenience functions relying on the helm package.
-
-;;; Code:
-
-(require 'gnorb-gnus)
-(require 'nngnorb)
-(require 'gnorb-utils)
-
-(declare-function 'helm-make-source "ext:helm-source")
-(declare-function 'helm "ext:helm")
-(declare-function 'helm-marked-candidates "ext:helm")
-
-(defun gnorb-helm-gnus-registry-candidates ()
-  "Return a list of candidates from the Gnus registry."
-  (let ((check
-        (when (or gnus-ignored-from-addresses
-                  message-alternative-emails)
-          (cond ((functionp gnus-ignored-from-addresses)
-                 (lambda (adr) (funcall gnus-ignored-from-addresses adr)))
-                ((stringp gnus-ignored-from-addresses)
-                 (lambda (adr)
-                   (string-match-p
-                    gnus-ignored-from-addresses adr)))
-                ((functionp message-alternative-emails)
-                 (lambda (adr) (funcall message-alternative-emails adr)))
-                ((stringp message-alternative-emails)
-                 (lambda (adr)
-                   (string-match-p
-                    message-alternative-emails adr))))))
-       ret from recipient subject group)
-    (maphash
-     (lambda (msg-id data)
-       (when (setq group (car-safe (cdr (assoc 'group data)))
-                  from (car-safe (cdr (assoc 'sender data)))
-                  subject (car-safe (cdr (assoc 'subject data)))
-                  recipient (cdr (assoc 'recipient data)))
-        (push (cons (format
-                     "%s: %s" ; display
-                     (if (and check
-                              (funcall check from))
-                         (concat
-                          "To: " (mapconcat #'identity recipient " "))
-                       from)
-                     subject)
-                    (cons msg-id group)) ; real
-              ret)))
-     (slot-value gnus-registry-db 'data))
-    ret))
-
-;;;###autoload
-(defun gnorb-helm-search-registry ()
-  "Use helm and the Gnus registry to search messages."
-  (interactive)
-  (require 'helm)
-  (unless (gnus-alive-p)
-    (error "Gnus is not running"))
-  (unless gnus-registry-enabled
-    (error "The Gnus registry is not enabled"))
-  (let* ((msgs (helm :sources
-                    (helm-make-source "Gnus Registry" 'helm-source-sync
-                      :candidates #'gnorb-helm-gnus-registry-candidates
-                      :action (lambda (&rest _ignored) 
(helm-marked-candidates)))
-                    :buffer "*helm Gnus Registry*"))
-        (server (gnorb-gnus-find-gnorb-server))
-        (artlist
-         (mapcar
-          (lambda (msg)
-            (pcase-let ((`(,group . ,artno) (gnorb-msg-id-request-head
-                                             (car msg) (cdr msg))))
-              (when (and artno (integerp artno) (> artno 0))
-                (vector group artno 100))))
-          msgs))
-        (name (make-temp-name "registry messages"))
-        (spec (list
-               (cons 'nnir-specs (list (cons 'nnir-query-spec
-                                             `((query . "dummy")
-                                               (articles . ,artlist)))
-                                       (cons 'nnir-group-spec
-                                             `((,server ,(list name))))))
-               (cons 'nnir-artlist nil))))
-    (when msgs
-      (switch-to-buffer gnus-group-buffer)
-      (gnus-group-read-ephemeral-group
-       name `(nnir ,server) nil `(switch-to-buffer ,gnus-group-buffer)
-       nil nil spec))))
-
-(provide 'gnorb-helm)
-;;; gnorb-helm.el ends here
diff --git a/packages/gnorb/gnorb-org.el b/packages/gnorb/gnorb-org.el
deleted file mode 100644
index 77594d8..0000000
--- a/packages/gnorb/gnorb-org.el
+++ /dev/null
@@ -1,837 +0,0 @@
-;;; gnorb-org.el --- The Org-centric functions of gnorb -*- lexical-binding: t 
-*-
-
-;; Copyright (C) 2018-2020  Free Software Foundation, Inc.
-
-;; Author: Eric Abrahamsen  <eric@ericabrahamsen.net>
-
-;; 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 3 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, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;
-
-;;; Code:
-
-(require 'gnorb-utils)
-(eval-when-compile (require 'cl-lib))
-
-(defvar gnorb-bbdb-posting-styles)
-(defvar gnorb-bbdb-org-tag-field)
-(defvar bbdb-buffer-name)
-(defvar message-alternative-emails)
-(defvar bbdb-records)
-
-(autoload 'gnorb-bbdb-configure-posting-styles "gnorb-bbdb")
-(autoload 'gnorb-registry-org-id-search "gnorb-registry")
-(autoload 'bbdb-completing-read-record "bbdb-com")
-(autoload 'bbdb-record-name "bbdb")
-(autoload 'bbdb-message-search "bbdb-com")
-(autoload 'bbdb-mail-address "bbdb-com")
-(autoload 'bbdb-record-xfield "bbdb")
-(autoload 'bbdb-records "bbdb")
-(autoload 'bbdb-search "bbdb-com")
-(autoload 'bbdb-display-records "bbdb")
-
-(defgroup gnorb-org nil
-  "The Org bits of Gnorb."
-  :tag "Gnorb Org"
-  :group 'gnorb)
-
-(defcustom gnorb-org-after-message-setup-hook nil
-  "Hook run in a message buffer after setting up the message from
-  `gnorb-org-handle-mail' or `gnorb-org-email-subtree'."
-  :type 'hook)
-
-(defcustom gnorb-org-trigger-actions
-  '((?t "todo state" todo)
-    (?n "take note" note)
-    (?d "don't associate" no-associate)
-    (?o "only associate" associate)
-    (?c "capture to child" cap-child)
-    (?s "capture to sibling" cap-sib))
-  "List of potential actions that can be taken on headings.
-
-When triggering an Org heading after receiving or sending a
-message, this option lists the possible actions to take. Built-in
-actions include:
-
-todo state: Associate the message, and change TODO state.
-take note: Associate the message, and take a note.
-don't associate: Do nothing at all, don't connect the message and TODO.
-only associate: Associate the message with this heading, do nothing else.
-capture to child: Associate this message with a new child heading.
-capture to sibling: Associate this message with a new sibling heading.
-
-You can reorder this list or remove items as suits your workflow.
-The two \"capture\" options will use the value of
-`gnorb-gnus-new-todo-capture-key' to find the appropriate
-template.
-
-You can also add custom actions to the list. Actions should be a
-list of three elements: a character key, a string tag and a
-symbol indicating a custom function.  The custom function will be
-called on the heading in question, and passed a plist containing
-information about the message from which we're triggering."
-
-  :type 'list
-  :package-version '(gnorb . "1.1.3"))
-
-(defcustom gnorb-org-log-add-link t
-  "When non-nil, add a message link in a heading's LOGBOOK.
-When triggering an Org heading from a message, and adding a log
-note, the message id will be added to the text of the log note.
-When later viewing the messages, call `gnorb-org-view' with point
-on a particular logbook item to automatically go to the linked
-message."
-  :type 'boolean)
-
-(defcustom gnorb-org-msg-id-key "GNORB_MSG_ID"
-  "The name of the org property used to store the Message-IDs
-  from relevant messages. This is no longer used, and will be
-  removed soon."
-  :type 'string)
-
-(defcustom gnorb-org-mail-scan-scope 2
-  "Number of paragraphs to scan for mail-related links.
-
-Or set to 'all to scan the whole subtree.
-
-When handling a TODO heading with `gnorb-org-handle-mail', Gnorb
-will typically reply to the most recent message associated with
-this heading. If there are no such messages, or message tracking
-is disabled entirely, or `gnorb-org-handle-mail' has been called
-with a prefix arg, the heading and body text of the subtree under
-point will instead be scanned for gnus:, mailto:, and bbdb:
-links. This option controls how many paragraphs of body text to
-scan. Set to 0 to only look in the heading."
-  :type '(choice (const :tag "Whole subtree" all)
-                (integer :tag "Number of paragraphs")))
-
-(make-obsolete-variable
- 'gnorb-org-mail-scan-strategies
- "This variable has been superseded by `gnorb-org-trigger-actions'"
- "September 12, 2014" 'set)
-
-(make-obsolete-variable
- 'gnorb-org-mail-scan-state-changes
- "This variable has been superseded by `gnorb-org-trigger-actions'"
- "September 12, 2014" 'set)
-
-(make-obsolete-variable
- 'gnorb-org-mail-scan-function
- "This variable has been superseded by `gnorb-org-trigger-actions'"
- "September 12, 2014" 'set)
-
-(defcustom gnorb-org-find-candidates-match nil
-  "When scanning all org files for heading related to an incoming
-message, this option will limit which headings will be offered as
-target candidates. Specifically it will be used as the second
-argument to `org-map-entries', and syntax is the same as that
-used in an agenda tags view."
-  :type 'symbol)
-
-;;;###autoload
-(defun gnorb-org-contact-link (rec)
-  "Prompt for a BBDB record and insert a link to that record at
-point.
-
-There's really no reason to use this instead of regular old
-`org-insert-link' with BBDB completion. But there might be in the
-future!"
-  ;; this needs to handle an active region.
-  (interactive (list (bbdb-completing-read-record "Record: ")))
-  (let* ((name (bbdb-record-name rec))
-        (link (concat "bbdb:" (org-link-escape name))))
-    (org-store-link-props :type "bbdb" :name name
-                         :link link :description name)
-    (if (called-interactively-p 'any)
-       (insert (format "[[%s][%s]]" link name))
-      link)))
-
-(defun gnorb-org-restore-after-send ()
-  "After an email is sent, go through all the org ids that might
-have been in the outgoing message's headers and call
-`gnorb-trigger-todo-action' on each one, then put us back where
-we came from."
-  (delete-other-windows)
-  (dolist (id gnorb-message-org-ids)
-    (org-id-goto id)
-    (gnorb-trigger-todo-action nil id))
-  ;; this is a little unnecessary, but it may save grief
-  (setq gnorb-gnus-message-info nil)
-  (setq gnorb-message-org-ids nil)
-  (gnorb-restore-layout))
-
-(defun gnorb-org-extract-links (&optional _arg region)
-  "See if there are viable links in the subtree under point."
-  ;; We're not currently using the arg. What could we do with it?
-  (let (strings)
-    ;; If the region was active, only use the region
-    (if region
-       (push (buffer-substring (car region) (cdr region))
-             strings)
-      ;; Otherwise collect the heading text, and all the paragraph
-      ;; text.
-      (save-restriction
-       (org-narrow-to-subtree)
-       (let ((head (org-element-at-point))
-             (tree (org-element-parse-buffer)))
-         (push (org-element-property
-                :raw-value
-                head)
-               strings)
-         (org-element-map tree '(paragraph drawer)
-           (lambda (p)
-             (push (org-element-interpret-data p)
-                   strings))
-           nil nil 'drawer))))
-    (when strings
-      ;; Limit number of paragraphs based on
-      ;; `gnorb-org-mail-scan-scope'
-      (setq strings
-           (cond ((eq gnorb-org-mail-scan-scope 'all)
-                  strings)
-                 ((numberp gnorb-org-mail-scan-scope)
-                  (cl-subseq
-                   (reverse strings)
-                   0 (min
-                      (length strings)
-                      (1+ gnorb-org-mail-scan-scope))))
-                 ;; We could provide more options here. 'tree vs
-                 ;; 'subtree, for instance.
-                 (t
-                  strings)))
-      (with-temp-buffer
-       (dolist (s strings)
-         (insert s)
-         (insert "\n"))
-       (goto-char (point-min))
-       (gnorb-scan-links (point-max) 'gnus 'mailto 'bbdb 'ebdb)))))
-
-(defun gnorb-org-extract-mail-stuff (&optional arg region)
-  "Decide how to hande the Org heading under point as an email task.
-
-See the docstring of `gnorb-org-handle-mail' for details."
-  (if (or (not gnorb-tracking-enabled)
-         region)
-      (gnorb-org-extract-links arg region)
-    ;; Get all the messages associated with the IDS in this subtree.
-    (let ((assoc-msg-ids
-          (delete-dups
-           (cl-mapcan
-            (lambda (id)
-              (gnorb-registry-org-id-search id))
-            (gnorb-collect-ids)))))
-      (gnorb-org-extract-mail-tracking assoc-msg-ids arg region))))
-
-(defun gnorb-user-address-match-p (addr)
-  "Return t if ADDR seems to match the user's email address."
-  (cond
-   ((stringp message-alternative-emails)
-    (string-match-p message-alternative-emails
-                   addr))
-   ((functionp message-alternative-emails)
-    (funcall message-alternative-emails addr))
-   (user-mail-address
-    (string-match-p user-mail-address addr))))
-
-;; FIXME: Why did I break this off from
-;; `gnorb-org-extract-mail-stuff'?  It's only called from there, and
-;; it's confusing to have them separate.
-(defun gnorb-org-extract-mail-tracking (assoc-msg-ids &optional arg region)
-  "Return tracked mail links for the current Org subtree.
-ASSOC-MSG-IDS is a list of message-ids that have already been
-determined to be tracked by the subtree.  Return the most recent
-of these, as a candidate for composing a reply.  If there are no
-tracked messages, or if ARG (a prefix arg from earlier) is
-non-nil, ignore these tracked ids and instead scan the
-subtree (or REGION) for links, and use those instead."
-  (let* ((all-links (gnorb-org-extract-links nil region))
-        ;; The latest (by the creation-time registry key) of all the
-        ;; tracked messages that were not sent by our user.
-        (latest-msg-id
-         (when assoc-msg-ids
-           (car
-            (sort
-             (cl-remove-if-not
-              (lambda (m)
-                (let ((from (car (gnus-registry-get-id-key m 'sender))))
-                  (not (and from (gnorb-user-address-match-p from)))))
-              assoc-msg-ids)
-             (lambda (r l)
-               (time-less-p
-                (car (gnus-registry-get-id-key l 'creation-time))
-                (car (gnus-registry-get-id-key r 'creation-time))))))))
-        (msg-id-link
-         (when latest-msg-id
-           (gnorb-msg-id-to-link latest-msg-id))))
-    (cond
-     ;; If there are no tracked messages, or the user has specifically
-     ;; requested we ignore them with the prefix arg, just return the
-     ;; found links in the subtree.
-     ((or arg
-         (null msg-id-link))
-      all-links)
-     ;; Otherwise ignore the other links in the subtree, and return
-     ;; the latest message.
-     (msg-id-link
-      `((gnus ,msg-id-link))))))
-
-(defvar message-beginning-of-line)
-
-(defun gnorb-org-setup-message
-    (&optional messages mails from cc bcc attachments text ids noprompt)
-  "Common message setup routine for other gnorb-org commands.
-MESSAGES is a list of gnus links pointing to messages -- we
-currently only use the first of the list. MAILS is a list of
-email address strings suitable for inserting in the To header.
-ATTACHMENTS is a list of filenames to attach. TEXT is a string or
-buffer, which is inserted in the message body. IDS is one or more
-Org heading ids, associating the outgoing message with those
-headings."
-  (require 'gnorb-gnus)
-  (if (not messages)
-      ;; Either compose new message...
-      (compose-mail)
-    ;; ...or follow link and start reply.
-    (condition-case err
-       (gnorb-reply-to-gnus-link (car messages))
-      (error (gnorb-restore-layout)
-            (signal (car err) (cdr err)))))
-  ;; Add MAILS to message To header.
-  (when mails
-    (message-goto-to)
-    (when messages
-      (insert ", "))
-    (insert (mapconcat 'identity mails ", ")))
-  ;; Commenting this out because
-  ;; `gnorb-gnus-check-outgoing-headers' is set unconditionally in the
-  ;; `message-send-hook, so this should be redundant.  Also, we've
-  ;; switched to using message-send-actions.
-
-  ;; (add-to-list
-  ;; 'message-exit-actions 'gnorb-org-restore-after-send t) Set
-  ;; headers from MAIL_* properties (from, cc, and bcc).
-  (cl-flet ((sh (h)
-               (when (cdr h)
-                 (funcall (intern (format "message-goto-%s" (car h))))
-                 (let ((message-beginning-of-line t)
-                       (show-trailing-whitespace t))
-                   (message-beginning-of-header t)
-                   (insert (cdr h))))))
-    (dolist (h `((from . ,from) (cc . ,cc) (bcc . ,bcc)))
-      (sh h)))
-  ;; attach ATTACHMENTS
-  (if noprompt
-      (dolist (a attachments)
-       (mml-attach-file a (mm-default-file-encoding a)
-                      nil "attachment"))
-    (map-y-or-n-p
-     (lambda (a) (format "Attach %s to outgoing message? "
-                        (file-name-nondirectory a)))
-     (lambda (a)
-       (mml-attach-file a (mm-default-file-encoding a)
-                       nil "attachment"))
-     attachments
-     '("file" "files" "attach")))
-  ;; insert text, if any
-  (when text
-    (message-goto-body)
-    (if (bufferp text)
-       (insert-buffer-substring text)
-      (insert text)))
-  ;; insert org ids, if any
-  (when ids
-    (unless (listp ids)
-      (setq ids (list ids)))
-    (save-excursion
-      (save-restriction
-       (message-narrow-to-headers)
-       (dolist (i ids)
-         (goto-char (point-at-bol))
-         (open-line 1)
-         ;; this function hardly does anything
-         (message-insert-header
-          (intern gnorb-mail-header) i)))))
-  ;; put point somewhere reasonable
-  (if (or mails messages)
-      (if (not messages)
-         (message-goto-subject)
-       (message-goto-body))
-    (message-goto-to))
-  (run-hooks 'gnorb-org-after-message-setup-hook))
-
-(defun gnorb-org-attachment-list (&optional id)
-  "Get a list of files (absolute filenames) attached to the
-current heading, or the heading indicated by optional argument ID."
-  (when (featurep 'org-attach)
-    (let* ((attach-dir (save-excursion
-                        (when id
-                          (org-id-goto id))
-                        (org-attach-dir t)))
-          (files
-           (mapcar
-            (lambda (f)
-              (expand-file-name f attach-dir))
-            (org-attach-file-list attach-dir))))
-      files)))
-
-(defvar message-mode-hook)
-
-;;;###autoload
-(defun gnorb-org-handle-mail (arg &optional text file)
-  "Handle current headline as a mail TODO.
-How this function behaves depends on whether you're using Gnorb
-for email tracking, also on the prefix ARG, and on the active
-region.
-
-If tracking is enabled and there is no prefix arg, Gnorb will
-begin a reply to the newest associated message that wasn't sent
-by the user -- ie, the Sender header doesn't match
-`user-mail-address' or `message-alternative-emails'.
-
-If tracking is enabled and there is a prefix arg, ignore the
-tracked messages and instead scan the subtree for mail-related
-links. This means links prefixed with gnus:, mailto:, or bbdb:.
-See `gnorb-org-mail-scan-scope' to limit the scope of this scan.
-Do something appropriate with the resulting links.
-
-With a double prefix arg, ignore all tracked messages and all
-links, and compose a blank new message.
-
-If tracking is enabled and you want to reply to a
-specific (earlier) message in the tracking history, use
-`gnorb-org-view' to open an nnir *Summary* buffer containing all
-the messages, and reply to the one you want. Your reply will be
-automatically tracked, as well.
-
-If tracking is not enabled and you want to use a specific link in
-the subtree as a basis for the email action, then put the region
-around that link before you call this message.
-
-TEXT is text to insert into the body of the message being
-composed.  FILE is a file to attach to the message."
-  (interactive "P")
-  (setq gnorb-window-conf (current-window-configuration))
-  (move-marker gnorb-return-marker (point))
-  (when (eq major-mode 'org-agenda-mode)
-    ;; If this is all the different types, we could skip the check.
-    (org-agenda-check-type t 'agenda 'timeline 'todo 'tags 'search)
-    (org-agenda-check-no-diary)
-    (let* ((marker (or (org-get-at-bol 'org-hd-marker)
-                      (org-agenda-error)))
-          (buffer (marker-buffer marker))
-          (pos (marker-position marker)))
-      (switch-to-buffer buffer)
-      (widen)
-      (goto-char pos)))
-  (let ((region
-        (when (use-region-p)
-          (car (region-bounds)))))
-    (deactivate-mark)
-    (save-excursion
-      (unless (org-back-to-heading t)
-       (error "Not in an org item"))
-      (cl-flet ((mp (p) (org-entry-get (point) p t)))
-       ;; Double prefix means ignore everything and compose a blank
-       ;; mail.
-       (let* ((links (unless (equal arg '(16))
-                       (gnorb-org-extract-mail-stuff arg region)))
-              (attachments (gnorb-org-attachment-list))
-              (from (mp "MAIL_FROM"))
-              (cc (mp "MAIL_CC"))
-              (bcc (mp "MAIL_BCC"))
-              (org-id (org-id-get-create))
-              (b-recs (alist-get 'bbdb links))
-              (e-recs (alist-get 'ebdb links))
-              (message-mode-hook (copy-sequence message-mode-hook))
-              mails)
-         (when file
-           (setq attachments (cons file attachments)))
-         (when (fboundp 'ebdb-org-retrieve)
-           (dolist (e e-recs)
-             (dolist (r (ebdb-org-retrieve e))
-               (let ((m (ebdb-dwim-mail r)))
-                 (when m
-                   (push m mails))))))
-         (dolist (b b-recs)
-           (let ((m (bbdb-mail-address
-                     (car (bbdb-message-search
-                           (org-link-unescape b))))))
-             (when m
-               (push m mails))))
-         (when (and b-recs
-                    gnorb-bbdb-posting-styles)
-           (add-hook 'message-mode-hook
-                     (lambda ()
-                       (gnorb-bbdb-configure-posting-styles (cdr b-recs))
-                       (gnorb-bbdb-configure-posting-styles (list (car 
b-recs))))))
-         (gnorb-org-setup-message
-          (alist-get 'gnus links)
-          (append mails (alist-get 'mailto links))
-          from cc bcc
-          attachments text org-id))))))
-
-;;; Email subtree
-
-(defcustom gnorb-org-email-subtree-text-parameters nil
-  "A plist of export parameters corresponding to the EXT-PLIST
-  argument to the export functions, for use when exporting to
-  text."
-  :group 'gnorb-org
-  :type 'boolean)
-
-(defcustom gnorb-org-email-subtree-file-parameters nil
-  "A plist of export parameters corresponding to the EXT-PLIST
-  argument to the export functions, for use when exporting to a
-  file."
-  :group 'gnorb-org
-  :type 'boolean)
-
-(defcustom gnorb-org-email-subtree-text-options '(nil t nil t)
-  "A list of ts and nils corresponding to Org's export options,
-to be used when exporting to text. The options, in order, are
-async, subtreep, visible-only, and body-only."
-  :group 'gnorb-org
-  :type 'list)
-
-(defcustom gnorb-org-email-subtree-file-options '(nil t nil nil)
-  "A list of ts and nils corresponding to Org's export options,
-to be used when exporting to a file. The options, in order, are
-async, subtreep, visible-only, and body-only."
-  :group 'gnorb-org
-  :type 'list)
-
-(defcustom gnorb-org-export-extensions
-  '((latex ".tex")
-    (ascii ".txt")
-    (html ".html")
-    (org ".org")
-    (icalendar ".ics")
-    (man ".man")
-    (md ".md")
-    (odt ".odt") ; not really, though
-    (texinfo ".texi")
-    (beamer ".tex"))
-  "Correspondence between export backends and their
-respective (usual) file extensions. Ugly way to do it, but what
-the hey..."
-  :group 'gnorb-org
-  :type '(repeat
-         (list symbol string)))
-
-(defvar org-export-show-temporary-export-buffer)
-
-;;;###autoload
-(defun gnorb-org-email-subtree (&optional arg)
-  "Call on a subtree to export it either to a text string or a file,
-then compose a mail message either with the exported text
-inserted into the message body, or the exported file attached to
-the message.
-
-Export options default to the following: When exporting to a
-buffer: async = nil, subtreep = t, visible-only = nil, body-only
-= t. Options are the same for files, except body-only is set to
-nil. Customize `gnorb-org-email-subtree-text-options' and
-`gnorb-org-email-subtree-file-options', respectively.
-
-Customize `gnorb-org-email-subtree-parameters' to your preferred
-default set of parameters."
-  ;; I sure would have liked to use the built-in dispatch ui, but it's
-  ;; got too much hard-coded stuff.
-  (interactive "P")
-  (org-back-to-heading t)
-  (let* ((bkend-var
-         (if (boundp 'org-export--registered-backends)
-             org-export--registered-backends
-           org-export-registered-backends))
-        (backend-string
-         (org-completing-read
-          "Export backend: "
-          (mapcar (lambda (b)
-                    (symbol-name (org-export-backend-name b)))
-                  bkend-var)
-          nil t))
-        (backend-symbol (intern backend-string))
-        (f-or-t (org-completing-read "Export as file or text? "
-                                     '("file" "text") nil t))
-        (org-export-show-temporary-export-buffer nil)
-        (opts (if (equal f-or-t "text")
-                  gnorb-org-email-subtree-text-options
-                gnorb-org-email-subtree-file-options))
-        (result
-         (if (equal f-or-t "text")
-             (apply 'org-export-to-buffer
-                    `(,backend-symbol
-                      "*Gnorb Export*"
-                      ,@opts
-                      ,gnorb-org-email-subtree-text-parameters))
-           (if (eq backend-symbol 'odt)
-               ;; Need to special-case odt output, as it does too
-               ;; many clever things.  The only downside to this is
-               ;; it's impossible to put the exported file in the
-               ;; /tmp/ directory -- it will go wherever it would
-               ;; have gone with manual export.
-               (apply #'org-odt-export-to-odt
-                      (append (cl-subseq gnorb-org-email-subtree-file-options 
0 3)
-                              (list gnorb-org-email-subtree-file-parameters)))
-            (apply 'org-export-to-file
-                   `(,backend-symbol
-                     ,(org-export-output-file-name
-                       (cl-second (assoc backend-symbol 
gnorb-org-export-extensions))
-                       t gnorb-tmp-dir)
-                     ,@opts
-                     ,gnorb-org-email-subtree-file-parameters)))))
-        text file)
-    (if (bufferp result)
-       (setq text result)
-      (setq file result))
-    (gnorb-org-handle-mail arg text file)))
-
-(defcustom gnorb-org-capture-collect-link-p t
-  "Should the capture process store a link to the gnus message or
-  BBDB record under point, even if it's not part of the template?
-  You'll probably end up needing it, anyway."
-  :group 'gnorb-org
-  :type 'boolean)
-
-(defun gnorb-org-capture-function ()
-  "Do various things after starting the capture process.
-Currently includes:
-
-1. Offering to move all the attachments from the message we
-captured from onto the Org heading being captured.
-
-2. Possibly saving a link to wherever we came from (see
-`gnorb-org-capture-collect-link-p').
-
-3. Possibly saving the text of the message we captured from (see
-`gnorb-gnus-copy-message-text').
-
-4. Possibly ticking the message we captured from (see
-`gnorb-gnus-tick-all-tracked-messages')."
-  (when gnorb-org-capture-collect-link-p
-    (let ((buf (org-capture-get :original-buffer)))
-      (when buf
-       (with-current-buffer buf
-         (when (memq major-mode '(gnus-summary-mode
-                                  gnus-article-mode
-                                  bbdb-mode
-                                  ebdb-mode))
-           (call-interactively 'org-store-link))))))
-  (when (with-current-buffer
-           (org-capture-get :original-buffer)
-         (memq major-mode '(gnus-summary-mode gnus-article-mode)))
-    ;; This part needs to happen in the capture buffer.
-    (when (or gnorb-gnus-capture-always-attach
-             (org-capture-get :gnus-attachments))
-      (require 'org-attach)
-      (setq gnorb-gnus-capture-attachments nil)
-      (gnorb-gnus-collect-all-attachments t)
-      (map-y-or-n-p
-       (lambda (a)
-        (format "Attach %s to capture heading? "
-                (file-name-nondirectory a)))
-       (lambda (a) (org-attach-attach a nil 'mv))
-       gnorb-gnus-capture-attachments
-       '("file" "files" "attach"))
-      (setq gnorb-gnus-capture-attachments nil))
-
-    ;; This part happens in the original summary/article buffer.
-    (save-window-excursion
-      (set-buffer (org-capture-get :original-buffer))
-      (let ((art-no (gnus-summary-article-number)))
-
-       (when gnorb-gnus-copy-message-text
-         (gnus-with-article-buffer
-           (article-goto-body)
-           (if (numberp gnorb-gnus-copy-message-text)
-               (progn
-                 (copy-to-register
-                  gnorb-gnus-copy-message-text
-                  (point) (point-max))
-                 (message "Message text copied to register %c"
-                          gnorb-gnus-copy-message-text))
-             (kill-new (buffer-substring (point) (point-max)))
-             (message "Message text copied to kill ring"))))
-
-       (when gnorb-gnus-tick-all-tracked-messages
-         (gnus-summary-mark-article art-no gnus-ticked-mark))
-
-       (gnus-summary-update-article art-no)))))
-
-(add-hook 'org-capture-mode-hook 'gnorb-org-capture-function)
-
-(defvar org-note-abort)
-
-(defun gnorb-org-capture-abort-cleanup ()
-  (with-no-warnings ;; For `org-note-abort'
-    (when (and org-note-abort
-              (or (bound-and-true-p gnorb-gnus-capture-always-attach)
-                  (org-capture-get :gnus-attachments)))
-      (condition-case nil
-         (progn (org-attach-delete-all)
-                (setq abort-note 'clean)
-                ;; remove any gnorb-mail-header values here
-                )
-       (error
-        (setq abort-note 'dirty))))))
-
-(add-hook 'org-capture-prepare-finalize-hook
-         'gnorb-org-capture-abort-cleanup)
-
-;;; Agenda/BBDB popup stuff
-
-(defcustom gnorb-org-agenda-popup-bbdb nil
-  "Should Agenda tags search pop up a BBDB buffer with matching
-  records?
-
-Records are considered matching if they have an `org-tags' field
-matching the current Agenda search. The name of that field can be
-customized with `gnorb-bbdb-org-tag-field'."
-  :group 'gnorb-org
-  :type 'boolean)
-
-(defcustom gnorb-org-bbdb-popup-layout 'pop-up-multi-line
-  "Default BBDB buffer layout for automatic Org Agenda display."
-  :group 'gnorb-org
-  :type '(choice (const one-line)
-                (const multi-line)
-                (const full-multi-line)
-                (symbol)))
-
-(defun gnorb-org-munge-agenda-query-string (str)
-  "Remove all non-tag search terms from query string STR.
-Returns a lambda form used for matching a search string (ie, the
-`cdr' of `org-make-tags-matcher')."
-  ;; I was hoping to use `org-make-tags-matcher' directly, then snag
-  ;; the tagmatcher from the resulting value, but there doesn't seem
-  ;; to be a reliable way of only getting the tag-related returns. But
-  ;; I'd still like to use that function. So an ugly hack to first
-  ;; remove non-tag contents from the query string, and then make a
-  ;; new call to `org-make-tags-matcher'.
-  (let ((org--matcher-tags-todo-only nil)
-       (re 
"^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL\\([<=>]\\{1,2\\}\\)\\([0-9]+\\)\\|\\(\\(?:[[:alnum:]_]+\\(?:\\\\-\\)*\\)+\\)\\([<>=]\\{1,2\\}\\)\\({[^}]+}\\|\"[^\"]*\"\\|-?[.0-9]+\\(?:[eE][-+]?[0-9]+\\)?\\)\\|[[:alnum:]_@#%]+\\)")
-       (or-terms (org-split-string str "|"))
-       term rest out-or acc)
-    (while (setq term (pop or-terms))
-      (setq acc nil)
-      (while (string-match re term)
-       (setq rest (substring term (match-end 0)))
-       (let ((sub-term (match-string 0 term)))
-         ;; This isn't a tag, we don't want it.
-         (unless (string-match-p "\\([<>=]\\)" sub-term)
-           (push sub-term acc))
-         (setq term rest)))
-      (push (mapconcat 'identity (nreverse acc) "") out-or))
-    (setq str (mapconcat 'identity (nreverse out-or) "|"))
-    (cdr (org-make-tags-matcher str))))
-
-;;;###autoload
-(defun gnorb-org-popup-bbdb (&optional str)
-  "In an `org-tags-view' Agenda buffer, pop up a BBDB buffer
-showing records whose `org-tags' field matches the current tags
-search."
-  (interactive)
-  (require 'gnorb-bbdb)
-  (let (recs)
-    (cond ((and
-           (and (eq major-mode 'org-agenda-mode)
-                (eq org-agenda-type 'tags))
-           (or (called-interactively-p 'any)
-               gnorb-org-agenda-popup-bbdb))
-          (let ((tag-clause (gnorb-org-munge-agenda-query-string
-                             (or str org-agenda-query-string))))
-            (unless (equal str "")
-              (setq recs
-                    (cl-remove-if-not
-                     (lambda (r)
-                       (let ((rec-tags (bbdb-record-xfield
-                                        r gnorb-bbdb-org-tag-field)))
-                         (and rec-tags
-                              (let ((tags-list (if (stringp rec-tags)
-                                                   (org-split-string rec-tags 
":")
-                                                 rec-tags))
-                                    (case-fold-search t)
-                                    (org-trust-scanner-tags t))
-                                ;; This is bad, we're lexically bound, now.
-                                (funcall tag-clause t tags-list 1)))))
-                     (bbdb-records))))))
-         ((eq major-mode 'org-mode)
-          (save-excursion
-            (org-back-to-heading)
-            (let ((bound (org-element-property
-                          :end (org-element-at-point)))
-                  desc rec)
-              (while (re-search-forward org-link-any-re bound t)
-                (when (string-match-p "bbdb" (car (split-string
-                                                   (match-string 2) ":")))
-                  (setq desc (match-string 3)
-                        rec (bbdb-search (bbdb-records) desc desc desc)
-                        recs (append recs rec))))))))
-    (if recs
-       (bbdb-display-records
-        recs gnorb-org-bbdb-popup-layout)
-      (when (get-buffer-window bbdb-buffer-name)
-       (quit-window nil
-                    (get-buffer-window bbdb-buffer-name)))
-      (when (called-interactively-p 'any)
-       (message "No relevant BBDB records")))))
-
-(if (featurep 'gnorb-bbdb)
-    (add-hook 'org-agenda-finalize-hook 'gnorb-org-popup-bbdb))
-
-;;; Groups from the gnorb gnus server backend
-
-;;;###autoload
-(defun gnorb-org-view (arg)
-  "Search the subtree at point for links to gnus messages, and
-then show them in an ephemeral group, in Gnus.
-
-With a prefix arg, create a search group that will persist across
-Gnus sessions, and can be refreshed.
-
-This won't work unless you've added a \"nngnorb\" server to
-your gnus select methods."
-  ;; this should also work on the active region, if there is one.
-  (interactive "P")
-  (require 'gnorb-gnus)
-  (setq gnorb-window-conf (current-window-configuration))
-  (move-marker gnorb-return-marker (point))
-  (when (eq major-mode 'org-agenda-mode)
-    (org-agenda-check-type t 'agenda 'timeline 'todo 'tags)
-    (org-agenda-check-no-diary)
-    (let* ((marker (or (org-get-at-bol 'org-hd-marker)
-                      (org-agenda-error)))
-          (buffer (marker-buffer marker))
-          (pos (marker-position marker)))
-      (switch-to-buffer buffer)
-      (goto-char pos)
-      (org-reveal)))
-  (let (id)
-    (save-excursion
-      (org-back-to-heading)
-      (setq id (concat "id+" (org-id-get-create)))
-      (gnorb-gnus-search-messages
-       id arg
-       (replace-regexp-in-string
-       org-bracket-link-regexp "\\3"
-       (nth 4 (org-heading-components)))
-       `(when (and (window-configuration-p gnorb-window-conf)
-                  gnorb-return-marker)
-         (set-window-configuration gnorb-window-conf)
-         (goto-char gnorb-return-marker))))))
-
-(provide 'gnorb-org)
-;;; gnorb-org.el ends here
diff --git a/packages/gnorb/gnorb-registry.el b/packages/gnorb/gnorb-registry.el
deleted file mode 100644
index 3adc0cb..0000000
--- a/packages/gnorb/gnorb-registry.el
+++ /dev/null
@@ -1,343 +0,0 @@
-;;; gnorb-registry.el --- Registry implementation for Gnorb -*- 
lexical-binding: t -*-
-
-;; Copyright (C) 2018-2020  Free Software Foundation, Inc.
-
-;; Author: Eric Abrahamsen <eric@ericabrahamsen.net.>
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Early on, Gnorb's message/todo tracking was done by relying on the
-;; user to insert links to received messages into an Org heading, and
-;; by automatically storing the Message-Ids of sent messages in a
-;; property (`gnorb-org-msg-id-key', defaulting to GNORB_MSG_ID) on
-;; the same heading. The heading could find all relevant messages by
-;; combining the links (incoming) and the IDs of the Gnorb-specific
-;; property (outgoing).
-;;
-;; In the end, this proved to be fragile and messy. Enter the
-;; registry. The Gnus registry is a specialization of a general
-;; "registry" library -- it's possible to roll your own. If you want
-;; to track connections between messages and Org headings, it's an
-;; obvious choice: Each relevant message is stored in the registry,
-;; keyed on its Message-ID, and the org-ids of all relevant headings
-;; are stored in a custom property, in our case gnorb-ids. This allows
-;; us to keep all Gnorb-specific data in one place, without polluting
-;; Org files or Gnus messages, persistent on disk, and with the added
-;; bonus of providing a place to keep arbitrary additional metadata.
-;;
-;; The drawback is that the connections are no longer readily visible
-;; to the user (they need to query the registry to see them), and it
-;; becomes perhaps a bit more difficult (but only a bit) to keep
-;; registry data in sync with the current state of the user's Gnus and
-;; Org files. But a clear win, in the end.
-
-;;; Code:
-
-(require 'gnus-registry)
-(require 'gnorb-utils)
-(require 'cl-lib)
-(eval-when-compile (require 'subr-x))
-
-(defgroup gnorb-registry nil
-  "Gnorb's use of the Gnus registry."
-  :tag "Gnorb Registry"
-  :group 'gnorb)
-
-(defun gnorb-registry-make-entry (msg-id sender subject org-id group)
-  "Create a Gnus registry entry for a message, either received or
-sent. Save the relevant Org ids in the 'gnorb-ids key."
-  ;; This set-id-key stuff is actually horribly
-  ;; inefficient.
-  (when gnorb-tracking-enabled
-    (gnus-registry-get-or-make-entry msg-id)
-    (when sender
-      (gnus-registry-set-id-key msg-id 'sender (list sender)))
-    (when subject
-      (gnus-registry-set-id-key msg-id 'subject (list subject)))
-    (when org-id
-      (let ((ids (gnus-registry-get-id-key msg-id 'gnorb-ids)))
-       (unless (member org-id ids)
-        (gnus-registry-set-id-key msg-id 'gnorb-ids (if (stringp org-id)
-                                                        (cons org-id ids)
-                                                      (append org-id ids))))))
-    (when group
-      (gnus-registry-set-id-key msg-id 'group (list group)))
-    (gnus-registry-get-or-make-entry msg-id)))
-
-(defun gnorb-registry-get-id-key (id key)
-  "Get value of symbol KEY for ID's entry in the registry.
-Works just like `gnus-registry-get-id-key', but doesn't create an
-entry if it doesn't exist already."
-  (cdr-safe
-   (assq key (nth 1 (assoc id (registry-lookup
-                              gnus-registry-db (list id)))))))
-
-(defun gnorb-registry-capture ()
-  "When capturing from a Gnus message, add our new Org heading id
-to the message's registry entry, under the `gnorb-ids' key."
-  ;; We're called by org-capture.
-  (declare-function org-capture-get "org-capture" (prop &optional local))
-  (defvar org-capture-plist)
-  (let ((orig-buff (org-capture-get :original-buffer)))
-    (when (and (buffer-live-p orig-buff)
-              (with-current-buffer
-                  orig-buff
-                (memq major-mode '(gnus-summary-mode gnus-article-mode)))
-              (not org-note-abort))
-      (let* ((msg-id
-             (gnorb-bracket-message-id
-              (plist-get org-store-link-plist :message-id)))
-            (org-id (org-id-get-create)))
-       (plist-put org-capture-plist :gnorb-id org-id)
-       (gnorb-registry-make-entry msg-id nil nil org-id nil)))))
-
-(defun gnorb-find-visit-candidates (ids &optional include-zombies)
-  "For all message-ids in IDS (which should be a list of
-Message-ID strings, with angle brackets, or a single string of
-Message-IDs), produce a list of Org ids for headings that are
-relevant to that message.
-
-If optional argument INCLUDE_ZOMBIES is non-nil, return ID values
-even for headings that appear to no longer exist."
-  (let (ret-val sub-val)
-    (when (stringp ids)
-      (setq ids (gnus-extract-references ids)))
-    (when gnorb-tracking-enabled
-      (setq ids (delete-dups ids))
-      (progn
-       (dolist (id ids)
-         (when
-             (setq sub-val
-                   (gnorb-registry-get-id-key id 'gnorb-ids))
-           (setq ret-val (append sub-val ret-val))))))
-    ;; This lets us be reasonably confident that the
-    ;; headings still exist.
-    (unless include-zombies
-      (cl-remove-if-not
-       (lambda (org-id)
-        (org-id-find-id-file org-id))
-       ret-val))
-    (delete-dups ret-val)))
-
-(defun gnorb-delete-association (msg-id org-id)
-  "Disassociate a message and a headline.
-
-This removes an Org heading's ORG-ID from the `gnorb-ids' key of
-the MSG-ID."
-  (let ((org-ids (gnus-registry-get-id-key msg-id 'gnorb-ids)))
-    (when (member org-id org-ids)
-      (gnus-registry-set-id-key msg-id 'gnorb-ids
-                               (remove org-id org-ids)))))
-
-(defun gnorb-delete-all-associations (org-id)
-  "Delete all message associations for an Org heading.
-
-The heading is identified by ORG-ID. This is suitable for use
-after an Org heading is deleted, for instance."
-  (let ((assoc-msgs (gnorb-registry-org-id-search org-id))
-       (gnorb-id-tracker
-        (registry-lookup-secondary gnus-registry-db 'gnorb-ids)))
-    (mapc
-     (lambda (msg-id)
-       (let ((org-ids
-             (gnus-registry-get-id-key msg-id 'gnorb-ids)))
-        (gnus-registry-set-id-key
-         msg-id 'gnorb-ids (remove org-id org-ids))))
-     assoc-msgs)
-    (remhash org-id gnorb-id-tracker)))
-
-(defun gnorb-flush-dead-associations (&optional clean-archived)
-  "Clean the registry of associations with nonexistent headings.
-
-Gnus will not prune registry entries that appear to be associated
-with an Org heading.  If your registry is limited to a very small
-size, you may end up with a full registry.  Use this function to
-remove dead associations, and free up more entries for possible
-pruning.
-
-By default, associations are considered \"live\" if the Org
-heading exists in an Org file or in an Org archive file.  When
-optional CLEAN_ARCHIVED is non-nil, delete associations from
-archived headings as well."
-  (interactive "P")
-  (let ((gnorb-id-tracker
-        (registry-lookup-secondary gnus-registry-db 'gnorb-ids))
-       (deleted-count 0))
-    (require 'org-id)
-    (maphash
-     (lambda (k _)
-       (let ((file (org-id-find-id-file k)))
-        (when (or (not file)
-                  (and clean-archived
-                       (string-match-p "org_archive$" file)))
-          (gnorb-delete-all-associations k)
-          (cl-incf deleted-count))))
-     gnorb-id-tracker)
-    (message "Deleted %d invalid associations"
-            deleted-count)))
-
-(defun gnorb-registry-org-id-search (id)
-  "Find all messages that have the org ID in their `gnorb-ids'
-key."
-  (registry-search gnus-registry-db :member `((gnorb-ids ,id))))
-
-(defun gnorb-registry-org-tag-search (tag)
-  "Find all messages that have the org TAG in `org-tags'."
-  (registry-search gnus-registry-db :member `((org-tags ,tag))))
-
-(defun gnorb-registry-tracked-messages ()
-  "Return all message-ids that have non-empty `gnorb-ids' keys."
-  (registry-search gnus-registry-db :regex `((gnorb-ids ".+"))))
-
-(defun gnorb-registry-tagged-messages ()
-  "Return all messages with non-empty `org-tags' keys."
-  (registry-search gnus-registry-db :regex `((org-tags ".+"))))
-
-(defun gnorb-registry-tracked-headings ()
-  "Return all Org heading ids that are associated with messages."
-  (hash-table-keys
-   (registry-lookup-secondary gnus-registry-db 'gnorb-ids t)))
-
-(defun gnorb-registry-tracked-tags ()
-  "Return all tags that have been used on tracked messages."
-  (hash-table-keys
-   (registry-lookup-secondary gnus-registry-db 'org-tags t)))
-
-(defun gnorb-report-tracking-usage ()
-  "Pop up a temporary window reporting on Gnorb usage of the Gnus
-registry to track message/heading associations.  Reports the
-number of tracked messages, the number of tracked headings, any
-tagged messages, and how much of the registry is occupied."
-  (interactive)
-  (pop-to-buffer
-   (get-buffer-create "*Gnorb Usage*")
-   '(nil . ((window-height . 10))))
-  (gnorb-refresh-usage-status)
-  (special-mode)
-  (setq revert-buffer-function #'gnorb-refresh-usage-status)
-  (local-set-key (kbd "d") (lambda ()
-                            (interactive)
-                            (progn
-                              (gnorb-flush-dead-associations)
-                              (gnorb-refresh-usage-status))))
-  (local-set-key (kbd "D") (lambda ()
-                            (interactive)
-                            (progn
-                              (gnorb-flush-dead-associations t)
-                              (gnorb-refresh-usage-status)))))
-
-(defun gnorb-refresh-usage-status (&optional _ignore-auto _noconfirm)
-  "Clear and re-format the *Gnorb Usage* buffer."
-  (let* ((messages (gnorb-registry-tracked-messages))
-        (message-num (length messages))
-        (headings (gnorb-registry-tracked-headings))
-        (heading-num (length headings))
-        (tagged (gnorb-registry-tagged-messages))
-        (tags (gnorb-registry-tracked-tags))
-        (total-occupied (length (delete-dups (append messages tagged))))
-        (reg-size (registry-size gnus-registry-db))
-        (reg-max-size
-         (slot-value gnus-registry-db
-                      (if (slot-exists-p gnus-registry-db 'max-size)
-                          'max-size 'max-hard))))
-    (with-current-buffer "*Gnorb Usage*"
-      (let ((inhibit-read-only t))
-       (erase-buffer)
-       (insert
-        (format
-         "Tracking %d Gnus messages associated with %d Org headings."
-         message-num heading-num))
-       (when tagged
-         (insert (format "\n%d tagged messages, with %d tag%s:\n"
-                         (length tagged)
-                         (length tags)
-                         (if (= 1 (length tags)) "" "s")))
-         (dolist (tag tags)
-           (insert (format "%s\n" tag))))
-       (insert "\n\n")
-       (insert
-        (format
-         "Occupying %.2f%% (%d/%d) of the registry (max %d)."
-         (* 100 (/ (float total-occupied) reg-size))
-         total-occupied reg-size reg-max-size))
-       (insert "\n\n")
-       (insert "Press 'd' to delete associations for non-existent Org 
headings.\n")
-       (insert "Press 'D' to delete associations for both non-existent and 
archived Org headings.")))))
-
-(defun gnorb-registry-transition-from-props (arg)
-  "Helper function for transitioning the old tracking system to the new.
-
-The old system relied on storing sent message ids on relevant Org
-headings, in the `gnorb-org-msg-id-key' property. The new system
-uses the gnus registry to track relations between messages and
-Org headings. This function will go through your agenda files,
-find headings that have the `gnorb-org-msg-id-key' property set,
-and create new registry entries that reflect that connection.
-
-Call with a prefix arg to additionally delete the
-`gnorb-org-msg-id-key' altogether from your Org headings. As this
-function will not create duplicate registry entries, it's safe to
-run it once with no prefix arg, to keep the properties in place,
-and then once you're sure everything's working okay, run it again
-with a prefix arg, to clean the Gnorb-specific properties from
-your Org files."
-  (interactive "P")
-  (require 'gnorb-org)
-  (defvar gnorb-org-find-candidates-match)
-  (defvar gnorb-org-msg-id-key)
-  (let ((count 0))
-    (message "Collecting all relevant Org headings, this could take a 
while...")
-    (org-map-entries
-     (lambda ()
-       (let ((id (org-id-get))
-            (props (org-entry-get-multivalued-property
-                    (point) gnorb-org-msg-id-key)))
-        (when props
-          ;; If the property is set, we should probably assume that any
-          ;; Gnus links in the subtree are relevant, and should also be
-          ;; collected and associated.
-          (let ((links (gnorb-scan-links
-                        (org-element-property :end (org-element-at-point))
-                        'gnus)))
-            (dolist (l (alist-get 'gnus links))
-              (gnorb-registry-make-entry
-               (cl-second (split-string l "#")) nil nil
-               id (cl-first (split-string l "#")))))
-          (dolist (p props)
-            (gnorb-registry-make-entry p nil nil id nil)
-            ;; This function will try to find the group for the message
-            ;; and set that value on the registry entry if it can find
-            ;; it.
-            (unless (gnus-registry-get-id-key p 'group)
-              (gnorb-msg-id-request-head p))
-            (cl-incf count)))))
-     gnorb-org-find-candidates-match
-     'agenda 'archive 'comment)
-    (message "Collecting all relevant Org headings, this could take a while... 
done")
-    ;; Delete the properties if the user has asked us to do so.
-    (if (equal arg '(4))
-       (progn
-         (dolist (f (org-agenda-files))
-           (with-current-buffer (get-file-buffer f)
-             (org-delete-property-globally gnorb-org-msg-id-key)))
-         (message "%d entries created; all Gnorb-specific properties deleted."
-                  count))
-      (message "%d entries created." count))))
-
-(provide 'gnorb-registry)
-;;; gnorb-registry.el ends here
diff --git a/packages/gnorb/gnorb-utils.el b/packages/gnorb/gnorb-utils.el
deleted file mode 100644
index e34646a..0000000
--- a/packages/gnorb/gnorb-utils.el
+++ /dev/null
@@ -1,682 +0,0 @@
-;;; gnorb-utils.el --- Common utilities for all gnorb stuff -*- 
lexical-binding: t -*-
-
-;; Copyright (C) 2018-2020  Free Software Foundation, Inc.
-
-;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
-
-;; 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 3 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, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;
-
-;;; Code:
-
-(eval-when-compile
-  (require 'cl-lib)
-  (require 'nnheader))
-(require 'pcase)
-(require 'seq)
-(require 'org)
-(require 'org-agenda)
-(require 'org-element)
-
-(require 'mailcap)
-(mailcap-parse-mimetypes)
-
-(defvar bbdb-mode-map)
-
-(defgroup gnorb nil
-  "Glue code between Gnus, Org, and BBDB."
-  :tag "Gnorb"
-  :group 'mail)
-
-(make-obsolete-variable
- 'gnorb-trigger-todo-default
- "This variable has been superseded by
-`gnorb-org-trigger-actions'"
- "September 8, 2014" 'set)
-
-(defvar gnorb-tmp-dir (make-temp-file "emacs-gnorb-" t)
-  "Temporary directory where attachments etc are saved.")
-
-(defvar gnorb-message-org-ids nil
-  "List of Org heading IDs from the outgoing Gnus message, used
-  to mark mail TODOs as done once the message is sent."
-  ;; The send hook either populates this, or sets it to nil, depending
-  ;; on whether the message in question has an Org id header. Then
-  ;; `gnorb-org-restore-after-send' checks for it and acts
-  ;; appropriately, then sets it to nil.
-  )
-
-(defvar gnorb-window-conf nil
-  "Save window configurations here, for restoration after mails
-are sent, or Org headings triggered.")
-
-(defvar gnorb-return-marker (make-marker)
-  "Return point here after various actions, to be used together
-with `gnorb-window-conf'.")
-
-(defvar gnorb-trigger-capture-location nil
-  "Marker pointing at the location where we want to place capture
-  templates, for the capture-to-child and capture-to-sibling
-  trigger actions.")
-
-(defcustom gnorb-mail-header "X-Org-ID"
-  "Name of the mail header used to store the ID of a related Org
-  heading. Only used locally: always stripped when the mail is
-  sent."
-  :group 'gnorb
-  :type 'string)
-
-(defun gnorb-version ()
-  "Return the version of currently-installed Gnorb.
-Only works for Gnorb installed via the package manager."
-  (interactive)
-  (if (memq 'gnorb package-activated-list)
-      (let ((pkg (nth 1 (assq 'gnorb package-alist))))
-       (message (package-desc-full-name pkg)))
-    (message "Gnorb not installed via package manager."))
-  (pkg-info-package-version "gnorb"))
-
-
-;;; this is just ghastly, but the value of this var is single regexp
-;;; group containing various header names, and we want our value
-;;; inside that group.
-(eval-after-load 'message
-  `(let ((ign-headers-list
-         (split-string message-ignored-mail-headers
-                       "|"))
-        (our-val (concat gnorb-mail-header "\\")))
-     (unless (member our-val ign-headers-list)
-       (setq ign-headers-list
-            `(,@(butlast ign-headers-list 1) ,our-val
-              ,@(last ign-headers-list 1)))
-       (setq message-ignored-mail-headers
-            (mapconcat
-             'identity ign-headers-list "|")))))
-
-;;;###autoload
-(defun gnorb-restore-layout ()
-  "Restore window layout and value of point after a Gnorb command.
-
-Some Gnorb commands change the window layout (ie `gnorb-org-view'
-or incoming email triggering). This command restores the layout
-to what it was. Bind it to a global key, or to local keys in Org
-and Gnus and BBDB maps."
-  (interactive)
-  (when (window-configuration-p gnorb-window-conf)
-    (select-frame-set-input-focus
-     (window-configuration-frame gnorb-window-conf))
-    (set-window-configuration gnorb-window-conf)
-    (when (buffer-live-p (marker-buffer gnorb-return-marker))
-      (goto-char gnorb-return-marker))))
-
-(defun gnorb-bracket-message-id (id)
-  "Ensure message-id ID is bound by angle brackets."
-  ;; Always use a message-id with angle brackets around it.
-  ;; `gnus-summary-goto-article' can handle either, but
-  ;; `gnus-request-head' will fail without brackets IF you're
-  ;; requesting from an nntp group. Mysterious.
-  (unless (string-match "\\`<" id)
-    (setq id (concat "<" id)))
-  (unless (string-match ">\\'" id)
-    (setq id (concat id ">")))
-  id)
-
-(defun gnorb-unbracket-message-id (id)
-  "Ensure message-id ID is NOT bound by angle brackets."
-  ;; This shit is annoying, but Org wants an id with no brackets, and
-  ;; Gnus is safest with an id that has brackets. So here we are.
-  (replace-regexp-in-string "\\(\\`<\\|>\\'\\)" "" id))
-
-(defun gnorb-reply-to-gnus-link (link)
-  "Start a reply to the linked message."
-  (let* ((link (org-link-unescape link))
-        (group (car (org-split-string link "#")))
-        (id (gnorb-bracket-message-id
-             (second (org-split-string link "#"))))
-        (backend
-         (car (gnus-find-method-for-group group))))
-    (gnorb-follow-gnus-link group id)
-    (call-interactively
-     (if (eq backend 'nntp)
-        'gnus-summary-followup-with-original
-       'gnus-summary-wide-reply-with-original))))
-
-(defun gnorb-follow-gnus-link (group id)
-  "Be a little clever about following gnus links.
-The goal here is reuse frames and windows as much as possible, so
-we're not opening multiple windows on the *Group* buffer, for
-instance, and messing up people's layouts. There also seems to be
-an issue when opening a link to a message whose *Summary* buffer
-is already visible: somehow, after following the link, point ends
-up on the message _after_ the one we want, and things go haywire.
-
-So we try to be a little clever. The logical progression here is
-this:
-
-1. If the link's target group is already open in a *Summary*
-buffer, just switch to that buffer (if it's visible in any frame
-then raise it and switch focus, otherwise pull it into the
-current window) and go to the message with
-`gnus-summary-goto-article'.
-
-2. If the Gnus *Group* buffer is visible in any window or frame,
-raise that frame/window and give it focus before following the
-link.
-
-3. Otherwise just follow the link as usual, in the current
-window."
-  (unless (gnus-alive-p)
-    (gnus))
-  (let* ((sum-buffer (gnus-summary-buffer-name group))
-        (target-buffer
-         (cond
-          ((gnus-buffer-live-p sum-buffer)
-           sum-buffer)
-          ((gnus-buffer-live-p gnus-group-buffer)
-           gnus-group-buffer)
-          (t nil)))
-        (target-window (when target-buffer
-                         (get-buffer-window target-buffer t))))
-    (if target-window
-       ;; Our target buffer is displayed somewhere: just go there.
-       (progn
-         (select-frame-set-input-focus
-          (window-frame target-window))
-         (switch-to-buffer target-buffer))
-      ;; Our target buffer exists, but isn't displayed: pull it up.
-      (if target-buffer
-         (switch-to-buffer target-buffer)))
-    (message "Following link...")
-    (if (gnus-buffer-live-p sum-buffer)
-       (gnus-summary-goto-article id nil t)
-      (gnorb-open-gnus-link group id))))
-
-(defun gnorb-open-gnus-link (group id)
-  "Gnorb version of `org-gnus-follow-link'."
-  ;; We've probably already bracketed the id, but just in case this is
-  ;; called from elsewhere...
-  (let* ((id (gnorb-bracket-message-id id))
-        (arts (gnus-group-unread group))
-        (artno (cdr (gnus-request-head id group)))
-        success)
-    (gnus-activate-group group)
-    (setq success (gnus-group-read-group arts t group))
-    (if success
-       (gnus-summary-goto-article artno nil t)
-      (signal 'error (format "Group %s could not be opened." group)))))
-
-;; I'd like to suggest this as a general addition to Emacs.  *Very*
-;; tired of abusing `completing-read' for this purpose.
-(defconst gnorb-select-valid-chars
-  (append (number-sequence 97 122)
-         (number-sequence 65 90))
-  "A list of characters that are suitable for using as selection
-  keys.")
-
-(defvar gnorb-select-choice-buffer "*Selections*"
-  "The name of the buffer used to pop up selections.")
-
-(defun gnorb-select-from-list (prompt collection &optional key-func)
-  "Prompt the user to select something from COLLECTION.
-
-Selection can happen in a few different ways, depending on the
-nature of COLLECTION.  Its elements can be:
-
-1. A plain string.  Simply default to `completing-read'.
-
-2. (string object).  The function uses `completing-read' on the
-   strings, returning the selected object.
-
-3. (number object).  As above, but the user enters a number.
-
-4. (character string object).  As #3, but \"string\" is displayed
-   as a string label for object.
-
-5. (number string object).  As above, with numbers.
-
-COLLECTION can be passed in ready-made.  Alternately, KEY-FUNC
-can be provided.  The collection will be constructed by mapping
-this function over the list of objects, and then appending each
-object to the corresponding result.  In other words, KEY-FUNC
-should return one of the types above, minus the final \"object\"
-element.
-
-Alternately, KEY-FUNC can be the symbol 'char, in which case the
-elements of COLLECTION will automatically be keyed to ascending
-characters (52 or fewer), or 'number, which does the same with
-numbers (no upper bound)."
-  (interactive)
-  (let ((len (length collection)))
-    (cl-labels ((pop-up-selections
-                (collection &optional charp)
-                (pop-to-buffer gnorb-select-choice-buffer
-                               '(display-buffer-in-side-window ((side . 
bottom))) t)
-                (dolist (c collection)
-                  (insert (format "%s: %s\n"
-                                  (if charp
-                                      (char-to-string (car c))
-                                    (car c))
-                                  (nth 1 c))))))
-      (setq collection
-           (pcase key-func
-             ((pred null)
-              collection)
-             ('char
-              (if (> len 52)
-                  (error "Use the char option with fewer than 52 items")
-                ;; These distinctions between char/string
-                ;; and number/char are totally manufactured.
-                (seq-mapn #'list gnorb-select-valid-chars collection)))
-             ('number
-              (seq-mapn #'list (number-sequence 1 len) collection))
-             ((and func (pred functionp))
-              (seq-map (lambda (el)
-                         (let ((res (funcall func el)))
-                           (if (atom res)
-                               (list res el)
-                             (append res
-                                     (list el)))))
-                       collection))
-             (_ (error "Invalid key-func: %s" key-func))))
-      ;; We only test the car of collection to see what type it is.  If
-      ;; elements are mismatched, it's not our problem.
-      (unwind-protect
-         (pcase (car collection)
-           ((pred stringp)
-            (completing-read prompt collection nil t))
-           ((pred symbolp)
-            (intern-soft (completing-read prompt collection nil t)))
-           (`(,(pred stringp) ,_)
-            (nth 1 (assoc (completing-read prompt collection nil t)
-                          collection)))
-           ;; Looks like pcase might be the wrong tool for this job.
-           ((or `(,(and c (pred numberp) (guard (memq c 
gnorb-select-valid-chars))) ,_)
-                `(,(and c (pred numberp) (guard (memq c 
gnorb-select-valid-chars))) ,_ ,_))
-            (pop-up-selections collection t)
-            (car (last (assq (read-char
-                              (propertize prompt 'face 'minibuffer-prompt))
-                             collection))))
-           ((or `(,(pred numberp) ,_)
-                `(,(pred numberp) ,_ ,_))
-            (pop-up-selections collection)
-            (car (last (assq (read-number prompt)
-                             collection)))))
-       (when-let ((win (get-buffer-window gnorb-select-choice-buffer)))
-         (quit-window win))))))
-
-(defun gnorb-trigger-todo-action (_arg &optional id)
-  "Do the actual restore action. Two main things here. First: if
-we were in the agenda when this was called, then keep us in the
-agenda. Then let the user choose an action from the value of
-`gnorb-org-trigger-actions'."
-  (require 'gnorb-org)
-  (let* ((agenda-p (eq major-mode 'org-agenda-mode))
-        (root-marker
-         (cond (agenda-p
-                (copy-marker
-                 (org-get-at-bol 'org-hd-marker)))
-               ((derived-mode-p 'org-mode)
-                (save-excursion
-                  (org-back-to-heading)
-                  (point-marker)))
-               (id
-                (save-excursion
-                  (org-id-goto id)
-                  (org-back-to-heading)
-                  (point-marker)))))
-        (id (or id
-                (org-with-point-at root-marker
-                  (org-id-get-create))))
-        (action (gnorb-select-from-list
-                 (format
-                  "Trigger action on %s: "
-                  (gnorb-pretty-outline id))
-                 gnorb-org-trigger-actions))
-        (link (when gnorb-org-log-add-link
-                (format "[[gnus:%s][message]] "
-                        (gnorb-msg-id-to-link
-                         (plist-get gnorb-gnus-message-info :msg-id)
-                         (plist-get gnorb-gnus-message-info :group))))))
-    (unless agenda-p
-      (org-reveal))
-    (cl-labels
-       ((make-entry
-         (id)
-         (gnorb-registry-make-entry
-          (plist-get gnorb-gnus-message-info :msg-id)
-          (plist-get gnorb-gnus-message-info :from)
-          (plist-get gnorb-gnus-message-info :subject)
-          id
-          (plist-get gnorb-gnus-message-info :group))))
-      ;; Handle our action.
-      (if (fboundp action)
-         (org-with-point-at root-marker
-           (make-entry (org-id-get-create))
-           (funcall action gnorb-gnus-message-info))
-       (cl-case action
-         (note
-          (org-with-point-at root-marker
-            (make-entry (org-id-get-create))
-            (org-add-log-setup 'note nil nil nil (or link nil))))
-         (todo
-          (if agenda-p
-              (progn
-                (org-with-point-at root-marker
-                  (make-entry (org-id-get-create)))
-                (call-interactively 'org-agenda-todo))
-            (org-with-point-at root-marker
-              (make-entry (org-id-get-create))
-              (call-interactively 'org-todo)
-              (when link
-               (setq org-log-note-extra link)))))
-         (no-associate
-          nil)
-         (associate
-          (org-with-point-at root-marker
-            (make-entry (org-id-get-create))))
-         ;; We're going to capture a new heading
-         ((cap-child cap-sib)
-          (org-with-point-at root-marker
-            (setq gnorb-trigger-capture-location (point-marker)))
-          (let ((entry
-                 ;; Pick a template.
-                 (copy-sequence (org-capture-select-template))))
-            ;; Do surgery on that template so that it finds its
-            ;; location using our function.
-            (setf (nth 3 entry)
-                  `(function
-                    ,(if (eq action 'cap-child)
-                         #'gnorb-trigger-capture-child
-                       #'gnorb-trigger-capture-sibling)))
-            ;; This will likely fail horribly for capture templates
-            ;; that aren't entries or list items.
-            (let ((org-capture-entry entry))
-              ;; When org-capture-entry is let-bound, the capture
-              ;; process will use that template instead of
-              ;; prompting the user. Also, `gnorb-registry-capture'
-              ;; will take care of making the registry entry for us.
-              (call-interactively 'org-capture)))))))
-    ;; Lastly, query about attaching email attachments. No matter what
-    ;; happens, clear `gnorb-gnus-capture-attachments'.
-    (unwind-protect
-       (org-with-point-at
-           (if (memq action '(cap-child cap-sib))
-               (point)
-             root-marker)
-         (map-y-or-n-p
-          (lambda (a)
-            (format "Attach %s to heading? "
-                    (file-name-nondirectory a)))
-          (lambda (a)
-            (with-demoted-errors
-                (org-attach-attach a nil 'mv)))
-          gnorb-gnus-capture-attachments
-          '("file" "files" "attach")))
-      (setq gnorb-gnus-capture-attachments nil))))
-
-(defun gnorb-trigger-capture-child ()
-  ;; The capture process creates a child by default
-  (org-goto-marker-or-bmk gnorb-trigger-capture-location)
-  (org-back-to-heading))
-
-(defun gnorb-trigger-capture-sibling ()
-  ;; This only works if we're not trying to create a sibling for a
-  ;; top-level heading, there appears to be no way to do that.  But in
-  ;; that case this trigger action isn't really necessary, just
-  ;; handle it with a regular capture.
-  (org-goto-marker-or-bmk gnorb-trigger-capture-location)
-  (org-up-heading-safe))
-
-(defun gnorb-pretty-outline (id &optional kw)
-  "Return pretty outline path of the Org heading indicated by ID.
-
-If the KW argument is true, add the TODO keyword into the path."
-  (let ((pt (org-id-find id t)))
-    (if pt
-       (org-with-point-at pt
-         (let ((el (org-element-at-point)))
-           (concat
-            (if kw
-                (format "(%s): "
-                        (org-element-property :todo-keyword el))
-              "")
-            (org-format-outline-path
-             (append
-              (list
-               (file-name-nondirectory
-                (buffer-file-name
-                 (org-base-buffer (current-buffer)))))
-              (org-get-outline-path)
-              (list
-               (replace-regexp-in-string
-                org-bracket-link-regexp
-                "\\3" (org-element-property :raw-value el))))))))
-      "[none]")))
-
-(defun gnorb-scan-links (bound &rest types)
-  "Scan from point to BOUND looking for links of type in TYPES.
-TYPES is a list of symbols; we search for all links corresponding
-to those symbols."
-  ;; It may be excessive to examine *all* links, rather than just
-  ;; creating a specialized regexp for the links we want, but it's
-  ;; nice to be lazy and use `org-link-any-re', that seems safer.
-
-  ;; This function should also *not* be responsible for unescaping
-  ;; links -- we don't know what they're going to be used for, and
-  ;; unescaped is safer.
-  (unless (= (point) bound)
-    (let ((alist (mapcar #'list (copy-sequence types))))
-      (while (re-search-forward org-link-any-re bound t)
-       (let ((link (or
-                    ;; Bracket link.
-                    (match-string-no-properties 2)
-                    ;; "Bare" link.
-                    (match-string-no-properties 0)))
-             sym)
-         (when (string-match "\\([^:]+\\):\\(.+\\)" link)
-           (setq sym (intern-soft (match-string 1 link))
-                 link (match-string 2 link))
-           (when (and sym (memq sym types))
-             (push link (alist-get sym alist))))))
-      alist)))
-
-(defun gnorb-msg-id-to-link (msg-id &optional server-group)
-  "Create a full Org link to the message MSG-ID.
-If SERVER-GROUP isn't given, try to figure it out."
-  (let ((server-group (or server-group
-                         (car (gnorb-msg-id-request-head msg-id)))))
-    (when server-group
-      (org-link-escape
-       (concat server-group "#"
-              (gnorb-unbracket-message-id msg-id))))))
-
-(defun gnorb-msg-id-request-head (msg-id &optional group)
-  "Given a message id, try to find its group and article number.
-If GROUP is given, assume that group and just try to find the
-article number.
-
-So far we're checking the registry, then the groups in
-`gnorb-gnus-sent-groups'. Use search engines? Other clever
-methods?"
-  (let (candidates server-group check)
-    (setq msg-id (gnorb-bracket-message-id msg-id))
-    (catch 'found
-      (when gnorb-tracking-enabled
-       (setq candidates (if group
-                            (list group)
-                          (append (gnus-registry-get-id-key msg-id 'group)
-                                  gnorb-gnus-sent-groups)))
-       (while (setq server-group (pop candidates))
-         (when (and (stringp server-group)
-                    ;; I don't remember the reason for this check,
-                    ;; which is totally fragile and fails on groups
-                    ;; belonging to `gnus-select-method': another
-                    ;; reason why this select method stuff is a mess.
-
-                    ;;(string-match-p "+" server-group)
-                    (not
-                     (string-match-p
-                      "\\(nnir\\|nnvirtual\\|UNKNOWN\\)"
-                      server-group))
-                    (gnus-activate-group server-group)
-                    (setq check
-                          (ignore-errors
-                            (gnus-request-head msg-id server-group))))
-
-           (gnus-registry-set-id-key msg-id 'group (list server-group))
-           (throw 'found (cons server-group (cdr check))))))
-      nil)))
-
-(defun gnorb-collect-ids (&optional id)
-  "Collect all Org IDs for a subtree.
-Starting with the heading under point (or the heading indicated
-by the ID argument), collect its ID property, and the IDs of all
-child headings."
-  (save-excursion
-    (save-restriction
-      (when id
-       (org-id-goto id))
-      (org-narrow-to-subtree)
-      (org-element-map (org-element-parse-buffer)
-         'headline
-       (lambda (hl)
-         (org-element-property :ID hl))))))
-
-;; Common functions for extracting references and relevant headings
-;; from the message under point. For use in gnorb-gnus.el functions.
-
-(defun gnorb-get-real-group-name (group art-no)
-  "Find the original group name of a message in a virtual or nnir
-group."
-  (cl-case (car (gnus-find-method-for-group group))
-    (nnvirtual
-     (setq group (car (nnvirtual-map-article art-no))))
-    (nnir
-     (setq group (nnir-article-group art-no)))
-    (nnselect
-     (setq group (nnselect-article-group art-no))))
-  group)
-
-(defun gnorb-find-tracked-headings (headers &optional include-zombies)
-  "Check HEADERS for message references and return relevant heading IDs.
-HEADERS is a message's data header, as produced by
-\(gnus-interactive \"H\"), or, equivalently:
-
-\(gnus-data-header (gnus-data-find (gnus-summary-article-number)))"
-  (let ((references (mail-header-references headers))
-       (msg-id (mail-header-message-id headers)))
-    (when gnorb-tracking-enabled
-      (gnorb-find-visit-candidates
-       (concat msg-id " " references) include-zombies))))
-
-(defun gnorb-choose-trigger-heading (&optional id)
-  "Given an Org heading ID, ask the user if they want to trigger it.
-If not, prompt for another target heading. Either way, return the
-target heading id."
-  (let ((id (if (stringp id)
-               id
-             (car-safe id)))
-       refile-result)
-    (if (and id
-            (y-or-n-p (message
-                       "Attach part to %s"
-                       (gnorb-pretty-outline id))))
-       id
-      (setq refile-result
-           (org-refile-get-location "Attach part to" nil t))
-      (save-window-excursion
-       (find-file (nth 1 refile-result))
-       (goto-char (nth 3 refile-result))
-       (org-id-get-create)))))
-
-;; Loading the registry
-
-(defvar gnorb-tracking-enabled nil
-  "Internal flag indicating whether Gnorb is successfully plugged
-  into the registry or not.")
-
-;;;###autoload
-(defun gnorb-tracking-initialize ()
-  "Start using the Gnus registry to track correspondences between
-Gnus messages and Org headings. This requires that the Gnus
-registry be in use, and should be called after the call to
-`gnus-registry-initialize'."
-  (require 'gnorb-registry)
-  (with-eval-after-load 'gnus-registry
-    (add-to-list 'gnus-registry-extra-entries-precious 'gnorb-ids)
-    (add-to-list 'gnus-registry-track-extra 'gnorb-ids))
-  (add-hook
-   'gnus-started-hook
-   (lambda ()
-     ;; The require may be necessary in order to get
-     ;; `gnus-user-format-function-g' defined before it's used.  That
-     ;; function is likely the first hit on gnorb-gnus, and there's no
-     ;; way to autoload it, as it is dynamically defined.
-     (require 'gnorb-gnus)
-     (unless (gnus-registry-install-p)
-       (user-error "Gnorb tracking requires that the Gnus registry be 
installed."))
-     (add-hook 'org-capture-prepare-finalize-hook #'gnorb-registry-capture)
-     (setq gnorb-tracking-enabled t))))
-
-;;;###autoload
-(defun gnorb-install-defaults ()
-  "Set up sane Gnorb customizations and keybindings."
-  (interactive)
-  (global-set-key (kbd "C-c A") 'gnorb-restore-layout)
-  (eval-after-load "gnorb-bbdb"
-    '(progn
-       (define-key bbdb-mode-map (kbd "C-c S") #'gnorb-bbdb-mail-search)
-       (define-key bbdb-mode-map (kbd "C-c l") #'gnorb-bbdb-open-link)
-       (define-key bbdb-mode-map [remap bbdb-mail] #'gnorb-bbdb-mail)
-       (eval-after-load "gnorb-org"
-        '(org-defkey org-mode-map (kbd "C-c C") #'gnorb-org-contact-link))))
-  (eval-after-load "gnorb-org"
-    '(progn
-       (org-defkey org-mode-map (kbd "C-c t") #'gnorb-org-handle-mail)
-       (org-defkey org-mode-map (kbd "C-c v") #'gnorb-org-view)
-       (org-defkey org-mode-map (kbd "C-c E") #'gnorb-org-email-subtree)
-       (setq gnorb-org-agenda-popup-bbdb t)
-       (eval-after-load "org-agenda"
-         '(progn (org-defkey org-agenda-mode-map (kbd "C-c t") 
#'gnorb-org-handle-mail)
-                 (org-defkey org-agenda-mode-map (kbd "C-c v") 
#'gnorb-org-view)))))
-  (eval-after-load "gnorb-gnus"
-    '(progn
-       (define-key gnus-summary-mime-map "a" #'gnorb-gnus-article-org-attach)
-       (define-key gnus-summary-mode-map (kbd "C-c t") 
#'gnorb-gnus-incoming-do-todo)
-       (define-key gnus-summary-mode-map (kbd "C-c v") #'gnorb-gnus-view)
-       (define-key gnus-summary-mode-map (kbd "C-c C-t") 
#'gnorb-gnus-tag-message)
-       (define-key gnus-summary-limit-map (kbd "g") 
#'gnorb-gnus-insert-tagged-messages)
-       (define-key gnus-summary-limit-map (kbd "G") 
#'gnorb-gnus-insert-tracked-messages)
-       (setq gnorb-gnus-capture-always-attach t)
-       (push '("attach to org heading" . gnorb-gnus-mime-org-attach)
-             gnus-mime-action-alist)
-       ;; The only way to add mime button command keys is by redefining
-       ;; gnus-mime-button-map, possibly not ideal. Ideal would be a
-       ;; setter function in gnus itself.
-       (push '(gnorb-gnus-mime-org-attach "a" "Attach to Org heading")
-             gnus-mime-button-commands)
-       (setq gnus-mime-button-map
-             (let ((map (make-sparse-keymap)))
-               (dolist (c gnus-mime-button-commands)
-                 (define-key map (cadr c) (car c)))
-               map))))
-  (eval-after-load "message"
-    '(progn
-       (define-key message-mode-map (kbd "C-c t") 
#'gnorb-gnus-outgoing-do-todo))))
-
-(provide 'gnorb-utils)
-;;; gnorb-utils.el ends here
diff --git a/packages/gnorb/gnorb.el b/packages/gnorb/gnorb.el
deleted file mode 100644
index 90a046f..0000000
--- a/packages/gnorb/gnorb.el
+++ /dev/null
@@ -1,41 +0,0 @@
-;;; gnorb.el --- Glue code between Gnus, Org, and BBDB -*- lexical-binding: t 
-*-
-
-;; Copyright (C) 2018-2020  Free Software Foundation, Inc.
-
-;; Version: 1.6.9
-;; Package-Requires: ((cl-lib "0.5"))
-
-;; Maintainer: Eric Abrahamsen <eric@ericabrahamsen.net>
-
-;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
-;; Keywords: mail org gnus bbdb todo task
-
-;; 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 3 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, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Load this file to load everything.
-
-;;; Code:
-
-(with-eval-after-load 'gnus
-  (require 'gnorb-gnus)
-  (require 'gnorb-registry))
-(with-eval-after-load 'bbdb
-  (require 'gnorb-bbdb))
-(with-eval-after-load 'org
-  (require 'gnorb-org))
-
-(provide 'gnorb)
-;;; gnorb.el ends here
diff --git a/packages/gnorb/gnorb.info b/packages/gnorb/gnorb.info
deleted file mode 100644
index 8677397..0000000
--- a/packages/gnorb/gnorb.info
+++ /dev/null
@@ -1,858 +0,0 @@
-This is gnorb.info, produced by makeinfo version 6.7 from gnorb.texi.
-
-INFO-DIR-SECTION Emacs
-START-INFO-DIR-ENTRY
-* Gnorb: (gnorb).       Glue code for Gnus, Org, and BBDB.
-END-INFO-DIR-ENTRY
-
-
-File: gnorb.info,  Node: Top,  Next: Introduction,  Up: (dir)
-
-Gnorb Manual
-************
-
-* Menu:
-
-* Introduction::
-* Installation::
-* Setup::
-* Email Tracking::
-* Restoring Window Layout::
-* Recent Mails From BBDB Contacts::
-* Tagging Messages and Contacts::
-* BBDB posting styles::
-* Misc BBDB::
-* Misc Org::
-* Misc Gnus::
-* Default Keybindings::
-
-— The Detailed Node Listing —
-
-Email Tracking
-
-* Likely Workflow::
-* Tracking Setup::
-* Beginning and Continuing the Tracking Process::
-* Trigger Actions::
-* Viewing Things::
-* Hinting in Gnus::
-* Message Attachments::
-* Registry Usage::
-
-Misc BBDB
-
-* Searching for messages from BBDB contacts::
-* Citing BBDB contacts::
-* User Options::
-
-Misc Org
-
-* Inserting BBDB links::
-* User Options: User Options (1).
-
-Misc Gnus
-
-* Searching With the Registry::
-* User Options: User Options (2).
-
-
-
-File: gnorb.info,  Node: Introduction,  Next: Installation,  Prev: Top,  Up: 
Top
-
-1 Introduction
-**************
-
-Gnorb provides glue code between the Gnus, Org, and BBDB packages.  It’s
-aimed at supporting email-based project management, and generally making
-it easier to keep track of email communication.
-
-   Much of the code consists of single-use convenience functions, but
-tracking email conversations with Org requires is more complicated, and
-requires a bit of setup.
-
-   Gnorb can be used in a modular fashion, by selectively loading the
-files “gnorb-org”, “gnorb-gnus” or “gnorb-bbdb” instead of plain old
-“gnorb”.  The package as a whole is rather Org-centric, though, and it
-won’t do much of interest without “gnorb-org”.
-
-   If you’ve installed from the package manager, of course, you don’t
-need ‘require’ statements at all.  In that case, simply using the
-(autoloaded) functions that are of interest to you will be sufficient.
-
-   This means that Gnorb doesn’t have hard requirements to any of the
-three base libraries.  For the libraries you are using, however, you’ll
-get best results from using the most recent stable version (yes, that
-means BBDB 3).  Some of the features in Gnorb only work with development
-versions of these libraries (those cases are noted below).
-
-
-File: gnorb.info,  Node: Installation,  Next: Setup,  Prev: Introduction,  Up: 
Top
-
-2 Installation
-**************
-
-Gnorb is installable via the Elpa package manager – look for it in
-‘list-packages’.
-
-   An earlier version of the code is available at
-<https://github.com/girzel/gnorb>, but this is now out of date.  Issues
-opened there will still be addressed, however.
-
-
-File: gnorb.info,  Node: Setup,  Next: Email Tracking,  Prev: Installation,  
Up: Top
-
-3 Setup
-*******
-
-Loading “gnorb” will make the basic functions available.  Using Gnorb
-for email tracking takes a bit more setup, however – see below.
-
-   Gnorb doesn’t bind any keys by default, but you can call
-‘gnorb-install-defaults’ to do a basic installation.  The rest of this
-manual assumes those *note default keybindings: Default Keybindings.
-
-
-File: gnorb.info,  Node: Email Tracking,  Next: Restoring Window Layout,  
Prev: Setup,  Up: Top
-
-4 Email Tracking
-****************
-
-The most interesting thing Gnorb does is using Org headings to track
-email conversations.
-
-   A “tracked conversation” is essentially a message thread, with
-benefits.  An Org heading (and subheadings) collect messages relevant to
-the heading.  You can view all the messages at once, reply to the
-most-recently-received message, collect all message attachments on the
-heading (using org-attach), and be reminded that newly-received messages
-might be relevant to the conversation.  The state of the Org heading
-tracks the state of your participation in the conversation: the TODO
-keyword might switch between REPLY and WAIT, for instance, or you might
-take notes on how everything’s progressing.
-
-   In general, the goal is to keep track of whole conversations, reduce
-friction when moving between Gnus and Org, and keep you in the Org
-agenda rather than in Gnus.
-
-* Menu:
-
-* Likely Workflow::
-* Tracking Setup::
-* Beginning and Continuing the Tracking Process::
-* Trigger Actions::
-* Viewing Things::
-* Hinting in Gnus::
-* Message Attachments::
-* Registry Usage::
-
-
-File: gnorb.info,  Node: Likely Workflow,  Next: Tracking Setup,  Up: Email 
Tracking
-
-4.1 Likely Workflow
-===================
-
-First of all, here’s a hypothetical workflow to show you how tracking
-works.
-
-   Say you receive an email from Jimmy, who wants to rent a room in your
-house.  “I’ll respond to this later,” you think.
-
-   You capture an Org TODO from the email, writing a headline “Jimmy
-renting a room”, and give it a REPLY keyword.  Gnorb quietly records the
-correspondence between the email and the TODO, using the Gnus registry.
-
-   The next day, looking at your Agenda, you see the TODO and decide to
-respond to the email.  You hit “C-c t” on the heading, and Gnorb finds
-Jimmy’s email and starts a reply to it.
-
-   You tell Jimmy the room’s available in March, and send the message.
-Gnorb takes you back to the heading, and asks you to trigger an action
-on it.  You choose “todo state”, and change the heading keyword to WAIT.
-
-   Two days later, Jimmy replies to your message, saying that March is
-perfect.  When you open his response, Gnorb politely reminds you that
-the message is relevant to an existing TODO.  You hit “C-c t” on the
-message, and are again taken to the TODO and asked to trigger an action.
-Again you choose “todo state”, and change the heading keyword back to
-REPLY.
-
-   You get another email, from Samantha, warning you not to rent the
-room to Jimmy.  She even attaches a picture of a room in her house, as
-it looked after Jimmy had stayed there for six months.  It’s bad.  You
-hit “C-c t” on her message, and pick the “Jimmy renting a room” heading.
-This time, you choose “take note” as the trigger action, and make a
-brief note about how bad that room looked.  Gnorb asks if you’d like to
-attach the picture to the Org heading.  You decide you will.
-
-   Now it’s time to write to Jimmy and say something noncommittal.
-Hitting “C-c t” on the heading would respond to Samantha’s email, the
-most recent of the associated messages, which isn’t what you want.
-Instead you hit “C-c v” on the heading, which opens up a Gnus *Summary*
-buffer containing all four messages: Jimmy’s first, your response, his
-response to that, and Samantha’s message.  You pick Jimmy’s second
-email, and reply to it normally.  Gnorb asks if you’d like to send the
-picture of the room as an attachment.  You would not.  When you send the
-reply Gnorb tracks that as well, and does the “trigger an action” trick
-again.
-
-   In this way Gnorb helps you manage an entire conversation, possibly
-with multiple threads and multiple participants.  Mostly all you need to
-do is hit “C-c t” on newly-received messages, and “C-c t” on the heading
-when it’s time to compose a new reply.
-
-
-File: gnorb.info,  Node: Tracking Setup,  Next: Beginning and Continuing the 
Tracking Process,  Prev: Likely Workflow,  Up: Email Tracking
-
-4.2 Tracking Setup
-==================
-
-Email tracking requires the following steps:
-
-  1. Tracking is done via the Gnus registry, so that must be activated
-     with ’gnus-registry-initialize’.
-  2. It also depends on the org-id package, with ‘org-id-track-globally’
-     set to t (that’s the default value, so simply loading the package
-     should be enough).
-  3. Add a nngnorb entry to your ‘gnus-secondary-select-methods’
-     variable.  It will look like (nngnorb “Server name”).  This does
-     nothing but provide a place to hang nnir searches.  If you are
-     using the Gnus that comes with Emacs 28 or later (or check
-     ‘(featurep 'nnselect)’ to be sure), this step is unnecessary.
-  4. Then put a call to ‘gnorb-tracking-initialize’ in your init files.
-  5. If you’re not using a local archive method for saving your sent
-     messages (ie you’re using IMAP), you’ll also need to tell Gnorb
-     where to find your sent messages.  Set the variable
-     ‘gnorb-gnus-sent-groups’ to a list of strings; each string should
-     indicate a fully-qualified group name, eg “nnimap+SERVER:GROUP”.
-  6. Set ‘gnorb-gnus-new-todo-capture-key’ to the key of a capture
-     template you want to use for creating TODOs from sent messages.
-
-
-File: gnorb.info,  Node: Beginning and Continuing the Tracking Process,  Next: 
Trigger Actions,  Prev: Tracking Setup,  Up: Email Tracking
-
-4.3 Beginning and Continuing the Tracking Process
-=================================================
-
-Email tracking starts in one of three ways:
-
-  1. With an Org heading that represents an email TODO.  Call
-     ‘gnorb-org-handle-mail’ (see below) on the heading to compose a new
-     message, and start the tracking process.
-  2. By calling org-capture on a received message.  Capturing from a
-     Gnus Summary buffer automatically initiates tracking.
-  3. By calling ‘gnorb-gnus-outgoing-do-todo’ while composing a message.
-     This will create a new TODO heading after the message is sent.
-
-   After tracking begins, it is continued by using Gnorb-specific
-commands when sending and receiving email:
-
-  1. When you receive an email in Gnus that should be part of a tracked
-     conversation, use ‘gnorb-gnus-incoming-to-todo’ on it to associate
-     it with the relevant Org heading.
-  2. When it’s time to reply to that email, use ‘gnorb-org-handle-mail’
-     on the Org heading to start a reply to the thread.
-
-   The default setup binds all these functions to “C-c t” in their
-respective modes, so just use that keybinding everywhere to keep the
-conversation going.
-
-   Some more detail on the various functions:
-
-  1. ‘gnorb-org-handle-mail’ (“C-c t” in org-mode) is called on an Org
-     heading to compose a new message.  By default, this will begin a
-     reply to the most recent message in the conversation.  If there are
-     no associated messages to reply to (or you call the function with a
-     single prefix arg), Gnorb will look for mailto: or bbdb: links in
-     the heading, and compose a new message to them.
-
-     Calling the function with a double prefix arg will ignore all
-     associated messages and links, and compose a blank message.
-
-     Once sent, the message will be associated with the Org heading, and
-     you’ll be brought back to the heading and asked to trigger an
-     action on it.  See *note Trigger Actions:: for more information.
-
-     ‘gnorb-email-subtree’ is an alternative to ‘gnorb-org-handle-mail’.
-     It does the same thing as the latter, but first exports the body of
-     the subtree as either text or a file, then inserts the text into
-     the message body, or attaches the file to the message,
-     respectively.
-  2. ‘gnorb-gnus-incoming-do-todo’ (“C-c t” in gnus-summary-mode and
-     gnus-article-mode) is called on a message in a Gnus *Summary*
-     buffer.  You’ll be prompted for an Org heading, taken to that
-     heading, and asked to trigger an action on it.
-  3. ‘gnorb-gnus-outgoing-do-todo’ (“C-c t” in message-mode) is called
-     in message mode, while composing a new message.  Usually this is
-     only necessary when starting a new tracked conversation.
-
-     If called without a prefix arg, a new Org heading will be created
-     after the message is sent, and the sent message associated with it.
-     The new heading will be created as a capture heading, using the
-     template specified by the ‘gnorb-gnus-new-todo-capture-key’ option.
-
-     If you call this function with a single prefix arg, you’ll be
-     prompted to choose an existing Org heading instead.  After the
-     message is sent, you’ll be taken to that heading and prompted to
-     trigger an action on it.
-
-     If you’ve called this function, and then realize you’ve associated
-     the message with the wrong TODO, call it again with a double prefix
-     to clear all associations.
-
-     It’s also possible to call this function *after* a message is sent,
-     in case you forgot.  Gnorb saves information about the most
-     recently sent message for this purpose.
-
-   An additional convenience command is available for use in Gnus
-summary buffers: ‘gnorb-gnus-quick-reply’.  If you don’t want to go
-through the whole round trip of triggering an action and then starting a
-new reply, call this command on an incoming message to associate it with
-a heading, start a reply, and associate your reply with the same
-heading.
-
-
-File: gnorb.info,  Node: Trigger Actions,  Next: Viewing Things,  Prev: 
Beginning and Continuing the Tracking Process,  Up: Email Tracking
-
-4.4 Trigger Actions
-===================
-
-After receiving or sending a message in a tracked conversation, you’ll
-be taken to the relevant Org heading and asked to “trigger an action” on
-it.  The main purpose of triggering is to associate the message with the
-Org heading, but the action also gives you a chance to do something
-useful like changing the TODO keyword, or leaving a note.
-
-   At the moment there are six different possibilities:
-
-  1. Change the heading’s TODO state.
-  2. Take a note on the heading.
-  3. Associate the message, but do nothing else.
-  4. Capture a new Org heading as a sibling to the tracked heading
-  5. Capture a new Org heading as a child to the tracked heading
-  6. Do nothing – do not associate the message.
-
-   More actions may be added in the future; it’s also possible to
-rearrange or delete existing actions, and add your own: see the
-docstring of ‘gnorb-org-trigger-actions’.
-
-
-File: gnorb.info,  Node: Viewing Things,  Next: Hinting in Gnus,  Prev: 
Trigger Actions,  Up: Email Tracking
-
-4.5 Viewing Things
-==================
-
-Keeping track of a conversation is one thing, but it’s very useful to be
-able to see an overview of history and current state.  For this purpose
-Gnorb provides “view” commands, which by default are bound to “C-c v” in
-all contexts.
-
-   Calling ‘gnorb-org-view’ (“C-c v”) on an Org heading will open an
-nnir summary buffer showing all the messages associated with that
-heading and child headings (this requires you to have added an nngnorb
-server to your Gnus backends).  A minor mode is in effect, ensuring that
-any replies you send to messages in this buffer will automatically be
-associated with the original Org heading.  You can also invoke
-‘gnorb-summary-disassociate-message’ (“C-c d”) to disassociate the
-message with the Org heading.
-
-   If you call ‘gnorb-org-view’ with a prefix argument, the search group
-will be made persistent across Gnus sessions.  You can re-run the search
-and update the group contents by hitting “M-g” on the group in the Gnus
-*Group* buffer.
-
-   Calling ‘gnorb-gnus-view’ (“C-c v”) on a tracked message will take
-you to the tracked Org heading.
-
-   From a Gnus *Summary* buffer, you can insert all tracked messages in
-the current group into the buffer with
-‘gnorb-gnus-insert-tracked-messages’, bound to “/ G” in the default
-keybindings.  By default this will only insert messages associated with
-headings that are not in a DONE state; call with a prefix arg to insert
-all messages.
-
-   As a bonus, it’s possible to go into Gnus’ *Server* buffer, find the
-line specifying your nngnorb server, and hit “G” (aka
-‘gnus-group-make-nnir-group’).  At the query prompt, enter an Org-style
-tags-todo Agenda query string (eg “+work-computer”, or what have you).
-Gnorb will find all headings matching this query, scan their subtrees
-for gnus links, and then give you a Summary buffer containing all the
-linked messages.  This is dog-slow at the moment; it will get faster.
-
-
-File: gnorb.info,  Node: Hinting in Gnus,  Next: Message Attachments,  Prev: 
Viewing Things,  Up: Email Tracking
-
-4.6 Hinting in Gnus
-===================
-
-When you receive new mails that might be relevant to existing Org TODOs,
-Gnorb can alert you to that fact.  When
-‘gnorb-gnus-hint-relevant-article’ is t (the default), Gnorb will
-display a message in the minibuffer when opening potentially relevant
-messages.  You can then use ‘gnorb-gnus-incoming-to-todo’ to trigger an
-action on the relevant TODO.
-
-   This hinting can happen in the Gnus summary buffer as well.  If you
-use the escape indicated by ‘gnorb-gnus-summary-mark-format-letter’ as
-part of your ‘gnus-summary-line-format’, articles that may be relevant
-to TODOs will be marked with a special character in the Summary buffer,
-as determined by ‘gnorb-gnus-summary-mark’.  By default, the format
-letter is “g” (meaning it is used as “%ug” in the format line), and the
-mark is “&” for messages that are already tracked, and “¡” for messages
-that may be relevant.
-
-
-File: gnorb.info,  Node: Message Attachments,  Next: Registry Usage,  Prev: 
Hinting in Gnus,  Up: Email Tracking
-
-4.7 Message Attachments
-=======================
-
-Gnorb simplifies the handling of attachments that you receive in emails.
-When you call ‘gnorb-gnus-incoming-do-todo’ on a message, you’ll be
-prompted to re-attach the email’s attachments onto the Org heading,
-using the org-attach library.
-
-   You can also do this as part of the capture process.  Set the new
-:gnus-attachments key to “t” in a capture template that you use on mail
-messages, and you’ll be queried to re-attach the message’s attachments
-onto the newly-captured heading.
-
-   Or set ‘gnorb-gnus-capture-always-attach’ to “t” to have Gnorb do
-this for all capture templates.
-
-   You can also do this using the regular system of MIME commands,
-without invoking the email tracking process.  Using the default
-bindings, pressing “a” on a MIME line will prompt you to move the
-attachment to an Org heading.
-
-   The same process works in reverse: when you send a message from an
-Org heading using ‘gnorb-org-handle-mail’, Gnorb will ask if you want to
-attach the files in the heading’s org-attach directory to the outgoing
-message.
-
-
-File: gnorb.info,  Node: Registry Usage,  Prev: Message Attachments,  Up: 
Email Tracking
-
-4.8 Registry Usage
-==================
-
-You can see how many associations you’ve got stored in the registry by
-calling ‘gnorb-report-tracking-usage’.  This will pop up a buffer
-showing how much of the registry you’re using, and offering keybindings
-for ‘gnorb-flush-dead-associations’, to help Gnorb clean up after
-itself.
-
-
-File: gnorb.info,  Node: Restoring Window Layout,  Next: Recent Mails From 
BBDB Contacts,  Prev: Email Tracking,  Up: Top
-
-5 Restoring Window Layout
-*************************
-
-Many Gnorb functions alter the window layout and value of point.  In
-most of these cases, you can restore the previous layout using the
-interactive function ‘gnorb-restore-layout’, by default bound to “C-c
-A”.
-
-
-File: gnorb.info,  Node: Recent Mails From BBDB Contacts,  Next: Tagging 
Messages and Contacts,  Prev: Restoring Window Layout,  Up: Top
-
-6 Recent Mails From BBDB Contacts
-*********************************
-
-If you’re using a recent git version of BBDB (circa mid-May 2014 or
-later), you can give your BBDB contacts a special field which will
-collect links to recent emails from that contact.  The default name of
-the field is “messages”, but you can customize that name using the
-‘gnorb-bbdb-messages-field’ option.
-
-   Gnorb will not collect links by default: you need to call
-‘gnorb-bbdb-open-link’ on a contact once to start the process.
-Thereafter, opening mails from that contact will store a link to the
-message.
-
-   Once some links are stored, ‘gnorb-bbdb-open-link’ will open them:
-Use a prefix arg to the function call to select particular messages to
-open.  There are several options controlling how all this works; see the
-gnorb-bbdb user options section below for details.
-
-
-File: gnorb.info,  Node: Tagging Messages and Contacts,  Next: BBDB posting 
styles,  Prev: Recent Mails From BBDB Contacts,  Up: Top
-
-7 Tagging Messages and Contacts
-*******************************
-
-It’s possible to use your defined Org tags to tag BBDB contacts and Gnus
-messages.
-
-   For BBDB contacts, tags are stored in an xfield named org-tags, by
-default (you can customize the name of this field using the
-‘gnorb-bbdb-org-tag-field’ option).  Once contacts are tagged, you can
-search for tags normally in the *BBDB* buffer.  You can also pop up a
-*BBDB* buffer alongside an Org Agenda tags search, with contacts
-matching the search terms.  You can have this happen automatically, by
-setting ‘gnorb-org-agenda-popup-bbdb’ to a non-nil value, or do it
-manually by calling ‘gnorb-org-popup-bbdb’.
-
-   Gnus messages can be tagged from a *Summary* buffer using the command
-‘gnorb-gnus-tag-message’ (bound to “C-c C-t” when using the default
-keybindings).  You can also search for tagged messages in a group using
-‘gnorb-gnus-insert-tagged-messages’ (bound to “/ g” when using the
-default keybindings).  The search string can be given as a more complex
-tags expression a la Org Agenda searches, ie “cat|bird-dog”.
-
-   If the option ‘gnorb-gnus-auto-tag-messages’ is non-nil, any time you
-trigger an Org heading from a Gnus message, the message will “inherit”
-the tags of the Org heading.
-
-   You can view Org tags on Gnus messages by adding the “%uG” spec code
-to your ‘gnus-group-line-format’ value.  That spec code can be
-customized using the ‘gnorb-gnus-summary-tags-format-letter’ option.
-
-
-File: gnorb.info,  Node: BBDB posting styles,  Next: Misc BBDB,  Prev: Tagging 
Messages and Contacts,  Up: Top
-
-8 BBDB posting styles
-*********************
-
-Gnorb comes with a BBDB posting-style system, inspired by (copied from)
-gnus-posting-styles.  You can specify how messages are composed to
-specific contacts, by matching on contact field values (the same way
-gnus-posting-styles matches on group names).  See the docstring of
-‘gnorb-bbdb-posting-styles’ for details.
-
-   In order not to be too intrusive, Gnorb doesn’t alter the behavior of
-‘bbdb-mail’, the usual mail-composition function.  Instead it provides
-an alternate ‘gnorb-bbdb-mail’, which does exactly the same thing, but
-first processes the new mail according to ‘gnorb-bbdb-posting-styles’.
-If you want to use this feature regularly, you can remap ‘bbdb-mail’ to
-‘gnorb-bbdb-mail’ in the ‘bbdb-mode-map’.
-
-
-File: gnorb.info,  Node: Misc BBDB,  Next: Misc Org,  Prev: BBDB posting 
styles,  Up: Top
-
-9 Misc BBDB
-***********
-
-* Menu:
-
-* Searching for messages from BBDB contacts::
-* Citing BBDB contacts::
-* User Options::
-
-
-File: gnorb.info,  Node: Searching for messages from BBDB contacts,  Next: 
Citing BBDB contacts,  Up: Misc BBDB
-
-9.1 Searching for messages from BBDB contacts
-=============================================
-
-Call ‘gnorb-bbdb-mail-search’ to search for all mail messages from the
-record(s) displayed.  Currently supports the notmuch, mairix, and namazu
-search backends; set ‘gnorb-gnus-mail-search-backend’ to one of those
-symbol values.
-
-
-File: gnorb.info,  Node: Citing BBDB contacts,  Next: User Options,  Prev: 
Searching for messages from BBDB contacts,  Up: Misc BBDB
-
-9.2 Citing BBDB contacts
-========================
-
-Calling ‘gnorb-bbdb-cite-contact’ will prompt for a BBDB record and
-insert a string of the type “Bob Smith <bob@smith.com>”.
-
-
-File: gnorb.info,  Node: User Options,  Prev: Citing BBDB contacts,  Up: Misc 
BBDB
-
-9.3 User Options
-================
-
-‘gnorb-bbdb-org-tag-field
-     The name of the BBDB xfield, as a symbol, that holds Org-related
-     tags.  Specified as a string with the “:” separator between tags,
-     same as for Org headings.  Defaults to org-tag.
-‘gnorb-bbdb-messages-field’
-     The name of the BBDB xfield that holds links to recently-received
-     messages from this contact.  Defaults to ’messages.
-‘gnorb-bbdb-collect-N-messages’
-     Collect at most this many links to messages from this contact.
-     Defaults to 5.
-‘gnorb-bbdb-define-recent’
-     What does “recently-received” mean?  Possible values are the
-     symbols seen and received.  When set to seen, the most
-     recently-opened messages are collected.  When set to received, the
-     most recently-received (by Date header) messages are collected.
-     Defaults to seen.
-‘gnorb-bbdb-message-link-format-multi’
-     How is a single message’s link formatted in the multi-line BBDB
-     layout format?  Defaults to “%:count.  %D: %:subject” (see the
-     docstring for details).
-‘ gnorb-bbdb-message-link-format-one’
-     How is a single message’s link formatted in the one-line BBDB
-     layout format?  Defaults to nil (see the docstring for details).
-‘gnorb-bbdb-posting-styles’
-     Styles to use for influencing the format of mails composed to the
-     BBDB record(s) under point (see the docstring for details).
-
-
-File: gnorb.info,  Node: Misc Org,  Next: Misc Gnus,  Prev: Misc BBDB,  Up: Top
-
-10 Misc Org
-***********
-
-* Menu:
-
-* Inserting BBDB links::
-* User Options: User Options (1).
-
-
-File: gnorb.info,  Node: Inserting BBDB links,  Next: User Options (1),  Up: 
Misc Org
-
-10.1 Inserting BBDB links
-=========================
-
-Calling ‘gnorb-org-contact-link’ will prompt for a BBDB record and
-insert an Org link to that record at point.
-
-
-File: gnorb.info,  Node: User Options (1),  Prev: Inserting BBDB links,  Up: 
Misc Org
-
-10.2 User Options
-=================
-
-‘gnorb-org-after-message-setup-hook’
-     Hook run in a message buffer after setting up the message, from
-     ‘gnorb-org-handle-mail’ or ‘gnorb-org-email-subtree’.
-‘gnorb-org-trigger-actions’
-     List of potential actions that can be taken on headings after a
-     message is sent.  See docstring for details.
-‘gnorb-org-mail-scan-scope’
-     The number of paragraphs to scan for mail-related links.  This
-     comes into play when calling ‘gnorb-org-handle-mail’ on a heading
-     with no associated messages, or when ‘gnorb-org-handle-mail’ is
-     called with a prefix arg.
-‘gnorb-org-find-candidates-match’
-     When searching all Org files for headings to collect messages from,
-     this option can limit which headings are searched.  It is used as
-     the second argument to a call to ‘org-map-entries’, and has the
-     same syntax as that used in an agenda tags view.
-‘gnorb-org-email-subtree-text-parameters’
-     A plist of export parameters corresponding to the EXT-PLIST
-     argument to the export functions, for use when exporting to text.
-‘gnorb-org-email-subtree-file-parameters’
-     A plist of export parameters corresponding to the EXT-PLIST
-     argument to the export functions, for use when exporting to a file.
-‘gnorb-org-email-subtree-text-options’
-     A list of ts and nils corresponding to Org’s export options, to be
-     used when exporting to text.  The options, in order, are async,
-     subtreep, visible-only, and body-only.
-‘gnorb-org-email-subtree-file-options’
-     A list of ts and nils corresponding to Org’s export options, to be
-     used when exporting to a file.  The options, in order, are async,
-     subtreep, visible-only, and body-only.
-‘gnorb-org-export-extensions’
-     Correspondence between export backends and their respective (usual)
-     file extensions.
-‘gnorb-org-capture-collect-link-p’
-     When this is set to t, the capture process will always store a link
-     to the Gnus message or BBDB record under point, even when the link
-     isn’t part of the capture template.  It can then be added to the
-     captured heading with org-insert-link, as usual.
-‘gnorb-org-log-add-link’
-     When non-nil, any time a todo trigger action results in adding a
-     note, a link to the triggering message will be added to the log
-     note text.
-‘gnorb-org-agenda-popup-bbdb’
-     Set to “t” to automatically pop up the BBDB buffer displaying
-     records corresponding to the Org Agenda tags search underway.  If
-     this is nil you can always do it manually with the command of the
-     same name.
-‘gnorb-org-bbdb-popup-layout’
-     Controls the layout of the Agenda-related BBDB popup, takes the
-     same values as bbdb-pop-up-layout.
-
-
-File: gnorb.info,  Node: Misc Gnus,  Next: Default Keybindings,  Prev: Misc 
Org,  Up: Top
-
-11 Misc Gnus
-************
-
-* Menu:
-
-* Searching With the Registry::
-* User Options: User Options (2).
-
-
-File: gnorb.info,  Node: Searching With the Registry,  Next: User Options (2), 
 Up: Misc Gnus
-
-11.1 Searching With the Registry
-================================
-
-Gnorb can use the Gnus registry as a sort of limited search index: the
-registry tracks information about sender, recipient, subject, and a few
-other things, and while this isn’t as powerful as a full-text search
-index, it’s often sufficient.  It’s also very fast, as it doesn’t rely
-on external program, and doesn’t require the user to mark a particular
-set of groups beforehand.
-
-‘gnorb-gnus-search-registry’
-     Prompt the user for a search string, and match it against messages
-     tracked in the registry.  Search strings are given as a series of
-     “key:value” terms, with double quotes around multi-word values.
-     See docstring for available keys.
-‘gnorb-helm-search-registry’
-     Helm users can use this function to conduct a more visual search of
-     the registry.  Only sender/recipient and subject lines are matched
-     against.
-
-   These functions are not bound by default; you might consider:
-
-     (with-eval-after-load "gnus-group"
-       (define-key gnus-group-group-map (kbd "/") #'gnorb-gnus-search-registry)
-       (define-key gnus-group-group-map (kbd "?") 
#'gnorb-helm-search-registry))
-
-
-File: gnorb.info,  Node: User Options (2),  Prev: Searching With the Registry, 
 Up: Misc Gnus
-
-11.2 User Options
-=================
-
-‘gnorb-gnus-mail-search-backend’
-     Specifies the search backend that you use for searching mails.
-     Currently supports notmuch, mairix, and namazu: set this option to
-     one of those symbols.
-‘gnorb-gnus-capture-always-attach’
-     Treat all capture templates as if they had the :gnus-attachments
-     key set to “t”.  This only has any effect if you’re capturing from
-     a Gnus summary or article buffer.
-‘gnorb-gnus-tick-all-tracked-messages’
-     When non-nil, always add the tick mark to messages when they are
-     first associated with an Org heading.  The mark can be safely
-     deleted afterwards.
-‘gnorb-trigger-todo-default’
-     Set to either ’note or ’todo to tell ‘gnorb-gnus-incoming-do-todo’
-     what to do by default.  You can reach the non-default behavior by
-     calling that function with a prefix argument.  Alternately, set to
-     ’prompt to always prompt for the appropriate action.
-‘gnorb-gnus-trigger-refile-targets’
-     If you use ‘gnorb-gnus-incoming-do-todo’ on an incoming message,
-     Gnorb will try to locate a TODO heading that’s relevant to that
-     message.  If it can’t, it will prompt you for one, using the refile
-     interface.  This option will be used as the value of
-     ‘org-refile-targets’ during that process: see the docstring of
-     ‘org-refile-targets’ for the appropriate syntax.
-‘gnorb-gnus-refile-use-outline-path’
-     Similar to the previous option, this option will be used as the
-     value of ‘org-refile-use-outline-path’ when selecting a heading:
-     see the its docstring for the meaning of its potential values.
-‘gnorb-gnus-new-todo-capture-key’
-     Set this to a single-character string pointing at an Org capture
-     template to use when creating TODOs from outgoing messages.  The
-     template is a regular capture template, with a few exceptions.  If
-     Gnus helps you archive outgoing messages (ie you have
-     ‘gnus-message-archive-group’ set to something, and your outgoing
-     messages have a “Fcc” header), a link to that message will be made,
-     and you’ll be able to use all the escapes related to gnus messages.
-     If you don’t archive outgoing messages, you’ll still be able to use
-     the %:subject, %:to, %:toname, %:toaddress, and %:date escapes in
-     the capture template.
-‘gnorb-gnus-hint-relevant-article’
-     Set to “t” (the default) to have Gnorb give you a hint in the
-     minibuffer when opening messages that might be relevant to existing
-     Org TODOs.
-‘gnorb-gnus-summary-mark-format-letter’
-     The formatting letter to use as part of your
-     ‘gnus-summary-line-format’, to indicate messages which might be
-     relevant to Org TODOs.  Defaults to “g”, meaning it should be used
-     as “%ug” in the format line.
-‘gnorb-gnus-summary-mark’
-     The mark used to indicate potentially relevant messages in the
-     Summary buffer, when ‘gnorb-gnus-summary-mark-format-letter’ is
-     present in the format line.  Defaults to “¡”.
-‘gnorb-gnus-summary-tracked-mark’
-     The mark used to indicate already-tracked messages in the Summary
-     buffer, when ‘gnorb-gnus-summary-mark-format-letter’ is present in
-     the format line.  Defaults to “&”.
-
-
-File: gnorb.info,  Node: Default Keybindings,  Prev: Misc Gnus,  Up: Top
-
-12 Default Keybindings
-**********************
-
-Using the bundled function ‘gnorb-install-defaults’ runs the code below.
-If you don’t like these defaults, you can always do your own setup.
-     (global-set-key (kbd "C-c A") 'gnorb-restore-layout)
-     (eval-after-load "gnorb-bbdb"
-       '(progn
-          (define-key bbdb-mode-map (kbd "C-c S") #'gnorb-bbdb-mail-search)
-          (define-key bbdb-mode-map (kbd "C-c l") #'gnorb-bbdb-open-link)
-          (define-key bbdb-mode-map [remap bbdb-mail] #'gnorb-bbdb-mail)
-          (eval-after-load "gnorb-org"
-            (org-defkey org-mode-map (kbd "C-c C") #'gnorb-org-contact-link))))
-     (eval-after-load "gnorb-org"
-       '(progn
-          (org-defkey org-mode-map (kbd "C-c t") #'gnorb-org-handle-mail)
-          (org-defkey org-mode-map (kbd "C-c v") #'gnorb-org-view)
-          (org-defkey org-mode-map (kbd "C-c E") #'gnorb-org-email-subtree)
-          (setq gnorb-org-agenda-popup-bbdb t)
-          (eval-after-load "org-agenda"
-            '(progn (org-defkey org-agenda-mode-map (kbd "C-c t") 
#'gnorb-org-handle-mail)
-                    (org-defkey org-agenda-mode-map (kbd "C-c v") 
#'gnorb-org-view)))))
-     (eval-after-load "gnorb-gnus"
-       '(progn
-          (define-key gnus-summary-mime-map "a" 
#'gnorb-gnus-article-org-attach)
-          (define-key gnus-summary-mode-map (kbd "C-c t") 
#'gnorb-gnus-incoming-do-todo)
-          (define-key gnus-summary-mode-map (kbd "C-c v") #'gnorb-gnus-view)
-          (define-key gnus-summary-mode-map (kbd "C-c C-t") 
#'gnorb-gnus-tag-message)
-          (define-key gnus-summary-limit-map (kbd "g") 
#'gnorb-gnus-insert-tagged-messages)
-          (define-key gnus-summary-limit-map (kbd "G") 
#'gnorb-gnus-insert-tracked-messages)
-          (setq gnorb-gnus-capture-always-attach t)
-          (push '("attach to org heading" . gnorb-gnus-mime-org-attach)
-                gnus-mime-action-alist)
-          (push '(gnorb-gnus-mime-org-attach "a" "Attach to Org heading")
-                gnus-mime-button-commands)
-          (setq gnus-mime-button-map
-                (let ((map (make-sparse-keymap)))
-                  (dolist (c gnus-mime-button-commands)
-                    (define-key map (cadr c) (car c)))
-                  map))))
-     (eval-after-load "message"
-       '(progn
-          (define-key message-mode-map (kbd "C-c t") 
#'gnorb-gnus-outgoing-do-todo)))
-
-
-
-Tag Table:
-Node: Top194
-Node: Introduction1038
-Node: Installation2363
-Node: Setup2741
-Node: Email Tracking3194
-Node: Likely Workflow4398
-Node: Tracking Setup7169
-Node: Beginning and Continuing the Tracking Process8596
-Node: Trigger Actions12789
-Node: Viewing Things13863
-Node: Hinting in Gnus15979
-Node: Message Attachments17044
-Node: Registry Usage18283
-Node: Restoring Window Layout18710
-Node: Recent Mails From BBDB Contacts19107
-Node: Tagging Messages and Contacts20113
-Node: BBDB posting styles21764
-Node: Misc BBDB22671
-Node: Searching for messages from BBDB contacts22887
-Node: Citing BBDB contacts23333
-Node: User Options23654
-Node: Misc Org25177
-Node: Inserting BBDB links25354
-Node: User Options (1)25612
-Node: Misc Gnus28512
-Node: Searching With the Registry28708
-Node: User Options (2)30012
-Node: Default Keybindings33444
-
-End Tag Table
-
-
-Local Variables:
-coding: utf-8
-End:
diff --git a/packages/gnorb/gnorb.org b/packages/gnorb/gnorb.org
deleted file mode 100644
index 2c0a449..0000000
--- a/packages/gnorb/gnorb.org
+++ /dev/null
@@ -1,609 +0,0 @@
-#+TEXINFO_CLASS: info
-#+TEXINFO_HEADER: @syncodeindex pg cp
-#+TITLE: Gnorb Manual
-#+SUBTITLE: for version 1, updated 13 March, 2017
-#+TEXINFO_DIR_CATEGORY: Emacs
-#+TEXINFO_DIR_TITLE: Gnorb: (gnorb)
-#+TEXINFO_DIR_DESC: Glue code for Gnus, Org, and BBDB
-#+OPTIONS: *:nil num:t toc:nil
-* Introduction
-
-Gnorb provides glue code between the Gnus, Org, and BBDB packages.
-It's aimed at supporting email-based project management, and generally
-making it easier to keep track of email communication.
-
-Much of the code consists of single-use convenience functions, but
-tracking email conversations with Org requires is more complicated,
-and requires a bit of setup.
-
-Gnorb can be used in a modular fashion, by selectively loading the
-files "gnorb-org", "gnorb-gnus" or "gnorb-bbdb" instead of plain old
-"gnorb". The package as a whole is rather Org-centric, though, and it
-won't do much of interest without "gnorb-org".
-
-If you've installed from the package manager, of course, you don't
-need `require' statements at all. In that case, simply using the
-(autoloaded) functions that are of interest to you will be sufficient.
-
-This means that Gnorb doesn't have hard requirements to any of the
-three base libraries. For the libraries you are using, however, you'll
-get best results from using the most recent stable version (yes, that
-means BBDB 3). Some of the features in Gnorb only work with
-development versions of these libraries (those cases are noted below).
-* Installation
-Gnorb is installable via the Elpa package manager -- look for it in
-`list-packages'.
-
-An earlier version of the code is available at
-https://github.com/girzel/gnorb, but this is now out of date. Issues
-opened there will still be addressed, however.
-* Setup
-:PROPERTIES:
-:ID:       9da59609-bb3c-4970-88f6-bddca18d2ad4
-:END:
-Loading "gnorb" will make the basic functions available. Using Gnorb
-for email tracking takes a bit more setup, however -- see below.
-
-Gnorb doesn't bind any keys by default, but you can call
-`gnorb-install-defaults' to do a basic installation. The rest of this
-manual assumes those [[id:de1b2579-86c2-4bb1-b77e-3467a3d2b3c7][default 
keybindings]].
-* Email Tracking
-The most interesting thing Gnorb does is using Org headings to track
-email conversations.
-
-A "tracked conversation" is essentially a message thread, with
-benefits. An Org heading (and subheadings) collect messages relevant
-to the heading. You can view all the messages at once, reply to the
-most-recently-received message, collect all message attachments on the
-heading (using org-attach), and be reminded that newly-received
-messages might be relevant to the conversation. The state of the Org
-heading tracks the state of your participation in the conversation:
-the TODO keyword might switch between REPLY and WAIT, for instance, or
-you might take notes on how everything's progressing.
-
-In general, the goal is to keep track of whole conversations, reduce
-friction when moving between Gnus and Org, and keep you in the Org
-agenda rather than in Gnus.
-** Likely Workflow
-First of all, here's a hypothetical workflow to show you how tracking
-works.
-
-Say you receive an email from Jimmy, who wants to rent a room in your
-house. "I'll respond to this later," you think.
-
-You capture an Org TODO from the email, writing a headline "Jimmy
-renting a room", and give it a REPLY keyword. Gnorb quietly records
-the correspondence between the email and the TODO, using the Gnus
-registry.
-
-The next day, looking at your Agenda, you see the TODO and decide to
-respond to the email. You hit "C-c t" on the heading, and Gnorb finds
-Jimmy's email and starts a reply to it.
-
-You tell Jimmy the room's available in March, and send the message.
-Gnorb takes you back to the heading, and asks you to trigger an action
-on it. You choose "todo state", and change the heading keyword to
-WAIT.
-
-Two days later, Jimmy replies to your message, saying that March is
-perfect. When you open his response, Gnorb politely reminds you that
-the message is relevant to an existing TODO. You hit "C-c t" on the
-message, and are again taken to the TODO and asked to trigger an
-action. Again you choose "todo state", and change the heading keyword
-back to REPLY.
-
-You get another email, from Samantha, warning you not to rent the room
-to Jimmy. She even attaches a picture of a room in her house, as it
-looked after Jimmy had stayed there for six months. It's bad. You hit
-"C-c t" on her message, and pick the "Jimmy renting a room" heading.
-This time, you choose "take note" as the trigger action, and make a
-brief note about how bad that room looked. Gnorb asks if you'd like to
-attach the picture to the Org heading. You decide you will.
-
-Now it's time to write to Jimmy and say something noncommittal.
-Hitting "C-c t" on the heading would respond to Samantha's email, the
-most recent of the associated messages, which isn't what you want.
-Instead you hit "C-c v" on the heading, which opens up a Gnus
-*Summary* buffer containing all four messages: Jimmy's first, your
-response, his response to that, and Samantha's message. You pick
-Jimmy's second email, and reply to it normally. Gnorb asks if you'd
-like to send the picture of the room as an attachment. You would not.
-When you send the reply Gnorb tracks that as well, and does the
-"trigger an action" trick again.
-
-In this way Gnorb helps you manage an entire conversation, possibly
-with multiple threads and multiple participants. Mostly all you need
-to do is hit "C-c t" on newly-received messages, and "C-c t" on the
-heading when it's time to compose a new reply.
-** Tracking Setup
-
-Email tracking requires the following steps:
-
-1. Tracking is done via the Gnus registry, so that must be activated
-   with 'gnus-registry-initialize'.
-2. It also depends on the org-id package, with `org-id-track-globally'
-   set to t (that's the default value, so simply loading the package
-   should be enough).
-3. Add a nngnorb entry to your `gnus-secondary-select-methods'
-   variable. It will look like (nngnorb "Server name"). This does
-   nothing but provide a place to hang nnir searches. If you are using
-   the Gnus that comes with Emacs 28 or later (or check ~(featurep
-   'nnselect)~ to be sure), this step is unnecessary.
-4. Then put a call to `gnorb-tracking-initialize' in your init files.
-5. If you're not using a local archive method for saving your sent
-   messages (ie you're using IMAP), you'll also need to tell Gnorb
-   where to find your sent messages. Set the variable
-   `gnorb-gnus-sent-groups' to a list of strings; each string should
-   indicate a fully-qualified group name, eg "nnimap+SERVER:GROUP".
-6. Set `gnorb-gnus-new-todo-capture-key' to the key of a capture
-   template you want to use for creating TODOs from sent messages.
-
-** Beginning and Continuing the Tracking Process
-Email tracking starts in one of three ways:
-
-1. With an Org heading that represents an email TODO. Call
-   `gnorb-org-handle-mail' (see below) on the heading to compose a new
-   message, and start the tracking process.
-2. By calling org-capture on a received message. Capturing from a Gnus
-   Summary buffer automatically initiates tracking.
-3. By calling `gnorb-gnus-outgoing-do-todo' while composing a message.
-   This will create a new TODO heading after the message is sent.
-
-After tracking begins, it is continued by using Gnorb-specific
-commands when sending and receiving email:
-
-1. When you receive an email in Gnus that should be part of a tracked
-   conversation, use `gnorb-gnus-incoming-to-todo' on it to associate
-   it with the relevant Org heading.
-2. When it's time to reply to that email, use `gnorb-org-handle-mail'
-   on the Org heading to start a reply to the thread.
-
-The default setup binds all these functions to "C-c t" in their
-respective modes, so just use that keybinding everywhere to keep the
-conversation going.
-
-Some more detail on the various functions:
-
-1. `gnorb-org-handle-mail' ("C-c t" in org-mode) is called on an Org
-   heading to compose a new message. By default, this will begin a
-   reply to the most recent message in the conversation. If there are
-   no associated messages to reply to (or you call the function with a
-   single prefix arg), Gnorb will look for mailto: or bbdb: links in
-   the heading, and compose a new message to them.
-
-   Calling the function with a double prefix arg will ignore all
-   associated messages and links, and compose a blank message.
-
-   Once sent, the message will be associated with the Org heading, and
-   you'll be brought back to the heading and asked to trigger an
-   action on it. See [[id:6bc4a833-e16a-4538-a675-b8ff21c9345d][Trigger 
Actions]] for more information.
-
-   `gnorb-email-subtree' is an alternative to `gnorb-org-handle-mail'.
-   It does the same thing as the latter, but first exports the body of
-   the subtree as either text or a file, then inserts the text into
-   the message body, or attaches the file to the message,
-   respectively.
-2. `gnorb-gnus-incoming-do-todo' ("C-c t" in gnus-summary-mode and
-   gnus-article-mode) is called on a message in a Gnus *Summary*
-   buffer. You'll be prompted for an Org heading, taken to that
-   heading, and asked to trigger an action on it.
-3. `gnorb-gnus-outgoing-do-todo' ("C-c t" in message-mode) is called
-   in message mode, while composing a new message. Usually this is
-   only necessary when starting a new tracked conversation.
-
-   If called without a prefix arg, a new Org heading will be created
-   after the message is sent, and the sent message associated with it.
-   The new heading will be created as a capture heading, using the
-   template specified by the `gnorb-gnus-new-todo-capture-key' option.
-
-   If you call this function with a single prefix arg, you'll be
-   prompted to choose an existing Org heading instead. After the
-   message is sent, you'll be taken to that heading and prompted to
-   trigger an action on it.
-
-   If you've called this function, and then realize you've associated
-   the message with the wrong TODO, call it again with a double prefix
-   to clear all associations.
-
-   It's also possible to call this function *after* a message is sent,
-   in case you forgot. Gnorb saves information about the most recently
-   sent message for this purpose.
-
-An additional convenience command is available for use in Gnus summary
-buffers: `gnorb-gnus-quick-reply'. If you don't want to go through the
-whole round trip of triggering an action and then starting a new
-reply, call this command on an incoming message to associate it with a
-heading, start a reply, and associate your reply with the same
-heading.
-** Trigger Actions
-:PROPERTIES:
-:ID:       6bc4a833-e16a-4538-a675-b8ff21c9345d
-:END:
-After receiving or sending a message in a tracked conversation, you'll
-be taken to the relevant Org heading and asked to "trigger an action"
-on it. The main purpose of triggering is to associate the message with
-the Org heading, but the action also gives you a chance to do
-something useful like changing the TODO keyword, or leaving a note.
-
-At the moment there are six different possibilities:
-
-1. Change the heading's TODO state.
-2. Take a note on the heading.
-3. Associate the message, but do nothing else.
-4. Capture a new Org heading as a sibling to the tracked heading
-5. Capture a new Org heading as a child to the tracked heading
-6. Do nothing -- do not associate the message.
-
-More actions may be added in the future; it's also possible to
-rearrange or delete existing actions, and add your own: see the
-docstring of `gnorb-org-trigger-actions'.
-** Viewing Things
-:PROPERTIES:
-:END:
-
-Keeping track of a conversation is one thing, but it's very useful to
-be able to see an overview of history and current state. For this
-purpose Gnorb provides "view" commands, which by default are bound to
-"C-c v" in all contexts.
-
-Calling `gnorb-org-view' ("C-c v") on an Org heading will open an nnir
-summary buffer showing all the messages associated with that heading
-and child headings (this requires you to have added an nngnorb server
-to your Gnus backends). A minor mode is in effect, ensuring that any
-replies you send to messages in this buffer will automatically be
-associated with the original Org heading. You can also invoke
-`gnorb-summary-disassociate-message' ("C-c d") to disassociate the
-message with the Org heading.
-
-If you call `gnorb-org-view' with a prefix argument, the search group
-will be made persistent across Gnus sessions. You can re-run the
-search and update the group contents by hitting "M-g" on the group in
-the Gnus *Group* buffer.
-
-Calling `gnorb-gnus-view' ("C-c v") on a tracked message will take you
-to the tracked Org heading.
-
-From a Gnus *Summary* buffer, you can insert all tracked messages in
-the current group into the buffer with
-`gnorb-gnus-insert-tracked-messages', bound to "/ G" in the default
-keybindings. By default this will only insert messages associated with
-headings that are not in a DONE state; call with a prefix arg to
-insert all messages.
-
-As a bonus, it's possible to go into Gnus' *Server* buffer, find the
-line specifying your nngnorb server, and hit "G" (aka
-`gnus-group-make-nnir-group'). At the query prompt, enter an Org-style
-tags-todo Agenda query string (eg "+work-computer", or what have you).
-Gnorb will find all headings matching this query, scan their subtrees
-for gnus links, and then give you a Summary buffer containing all the
-linked messages. This is dog-slow at the moment; it will get faster.
-
-** Hinting in Gnus
-:PROPERTIES:
-:END:
-When you receive new mails that might be relevant to existing Org
-TODOs, Gnorb can alert you to that fact. When
-`gnorb-gnus-hint-relevant-article' is t (the default), Gnorb will
-display a message in the minibuffer when opening potentially relevant
-messages. You can then use `gnorb-gnus-incoming-to-todo' to trigger an
-action on the relevant TODO.
-
-This hinting can happen in the Gnus summary buffer as well. If you use
-the escape indicated by `gnorb-gnus-summary-mark-format-letter' as
-part of your `gnus-summary-line-format', articles that may be relevant
-to TODOs will be marked with a special character in the Summary
-buffer, as determined by `gnorb-gnus-summary-mark'. By default, the
-format letter is "g" (meaning it is used as "%ug" in the format line),
-and the mark is "&" for messages that are already tracked, and "¡" for
-messages that may be relevant.
-** Message Attachments
-:PROPERTIES:
-:END:
-Gnorb simplifies the handling of attachments that you receive in
-emails. When you call `gnorb-gnus-incoming-do-todo' on a message,
-you'll be prompted to re-attach the email's attachments onto the Org
-heading, using the org-attach library.
-
-You can also do this as part of the capture process. Set the
-new :gnus-attachments key to "t" in a capture template that you use on
-mail messages, and you'll be queried to re-attach the message's
-attachments onto the newly-captured heading.
-
-Or set `gnorb-gnus-capture-always-attach' to "t" to have Gnorb do this
-for all capture templates.
-
-You can also do this using the regular system of MIME commands,
-without invoking the email tracking process. Using the default
-bindings, pressing "a" on a MIME line will prompt you to move the
-attachment to an Org heading.
-
-The same process works in reverse: when you send a message from an Org
-heading using `gnorb-org-handle-mail', Gnorb will ask if you want to
-attach the files in the heading's org-attach directory to the outgoing
-message.
-** Registry Usage
-You can see how many associations you've got stored in the registry by
-calling `gnorb-report-tracking-usage'. This will pop up a buffer
-showing how much of the registry you're using, and offering
-keybindings for `gnorb-flush-dead-associations', to help Gnorb clean
-up after itself.
-* Restoring Window Layout
-Many Gnorb functions alter the window layout and value of point. In
-most of these cases, you can restore the previous layout using the
-interactive function `gnorb-restore-layout', by default bound to "C-c
-A".
-
-* Recent Mails From BBDB Contacts
-:PROPERTIES:
-:END:
-If you're using a recent git version of BBDB (circa mid-May 2014 or
-later), you can give your BBDB contacts a special field which will
-collect links to recent emails from that contact. The default name of
-the field is "messages", but you can customize that name using the
-`gnorb-bbdb-messages-field' option.
-
-Gnorb will not collect links by default: you need to call
-`gnorb-bbdb-open-link' on a contact once to start the process.
-Thereafter, opening mails from that contact will store a link to the
-message.
-
-Once some links are stored, `gnorb-bbdb-open-link' will open them: Use
-a prefix arg to the function call to select particular messages to
-open. There are several options controlling how all this works; see
-the gnorb-bbdb user options section below for details.
-* Tagging Messages and Contacts
-It's possible to use your defined Org tags to tag BBDB contacts and
-Gnus messages.
-
-For BBDB contacts, tags are stored in an xfield named org-tags, by
-default (you can customize the name of this field using the
-`gnorb-bbdb-org-tag-field' option). Once contacts are tagged, you can
-search for tags normally in the *BBDB* buffer. You can also pop up a
-*BBDB* buffer alongside an Org Agenda tags search, with contacts
-matching the search terms. You can have this happen automatically, by
-setting `gnorb-org-agenda-popup-bbdb' to a non-nil value, or do it
-manually by calling `gnorb-org-popup-bbdb'.
-
-Gnus messages can be tagged from a *Summary* buffer using the command
-`gnorb-gnus-tag-message' (bound to "C-c C-t" when using the default
-keybindings). You can also search for tagged messages in a group using
-`gnorb-gnus-insert-tagged-messages' (bound to "/ g" when using the
-default keybindings). The search string can be given as a more complex
-tags expression a la Org Agenda searches, ie "cat|bird-dog".
-
-If the option `gnorb-gnus-auto-tag-messages' is non-nil, any time you
-trigger an Org heading from a Gnus message, the message will "inherit"
-the tags of the Org heading.
-
-You can view Org tags on Gnus messages by adding the "%uG" spec code
-to your `gnus-group-line-format' value. That spec code can be
-customized using the `gnorb-gnus-summary-tags-format-letter' option.
-* BBDB posting styles
-:PROPERTIES:
-:END:
-Gnorb comes with a BBDB posting-style system, inspired by (copied
-from) gnus-posting-styles. You can specify how messages are composed
-to specific contacts, by matching on contact field values (the same
-way gnus-posting-styles matches on group names). See the docstring of
-`gnorb-bbdb-posting-styles' for details.
-
-In order not to be too intrusive, Gnorb doesn't alter the behavior of
-`bbdb-mail', the usual mail-composition function. Instead it provides
-an alternate `gnorb-bbdb-mail', which does exactly the same thing, but
-first processes the new mail according to `gnorb-bbdb-posting-styles'.
-If you want to use this feature regularly, you can remap `bbdb-mail'
-to `gnorb-bbdb-mail' in the `bbdb-mode-map'.
-* Misc BBDB
-** Searching for messages from BBDB contacts
-:PROPERTIES:
-:END:
-Call `gnorb-bbdb-mail-search' to search for all mail messages from the
-record(s) displayed. Currently supports the notmuch, mairix, and
-namazu search backends; set `gnorb-gnus-mail-search-backend' to one of
-those symbol values.
-** Citing BBDB contacts
-:PROPERTIES:
-:END:
-Calling `gnorb-bbdb-cite-contact' will prompt for a BBDB record and
-insert a string of the type "Bob Smith <bob@smith.com>".
-** User Options
-- `gnorb-bbdb-org-tag-field :: The name of the BBDB xfield, as a
-     symbol, that holds Org-related tags. Specified as a string with
-     the ":" separator between tags, same as for Org headings.
-     Defaults to org-tag.
-- `gnorb-bbdb-messages-field' :: The name of the BBDB xfield that
-     holds links to recently-received messages from this contact.
-     Defaults to 'messages.
-- `gnorb-bbdb-collect-N-messages' :: Collect at most this many links
-     to messages from this contact. Defaults to 5.
-- `gnorb-bbdb-define-recent' :: What does "recently-received" mean?
-     Possible values are the symbols seen and received. When set to
-     seen, the most recently-opened messages are collected. When set
-     to received, the most recently-received (by Date header) messages
-     are collected. Defaults to seen.
-- `gnorb-bbdb-message-link-format-multi' :: How is a single message's
-     link formatted in the multi-line BBDB layout format? Defaults to
-     "%:count. %D: %:subject" (see the docstring for details).
-- ` gnorb-bbdb-message-link-format-one' :: How is a single message's
-     link formatted in the one-line BBDB layout format? Defaults to
-     nil (see the docstring for details).
-- `gnorb-bbdb-posting-styles' :: Styles to use for influencing the
-     format of mails composed to the BBDB record(s) under point (see
-     the docstring for details).
-* Misc Org
-** Inserting BBDB links
-:PROPERTIES:
-:END:
-Calling `gnorb-org-contact-link' will prompt for a BBDB record and
-insert an Org link to that record at point.
-** User Options
-- `gnorb-org-after-message-setup-hook' :: Hook run in a message buffer
-     after setting up the message, from `gnorb-org-handle-mail' or
-     `gnorb-org-email-subtree'.
-- `gnorb-org-trigger-actions' :: List of potential actions that can be
-     taken on headings after a message is sent. See docstring for
-     details.
-- `gnorb-org-mail-scan-scope' :: The number of paragraphs to scan for
-     mail-related links. This comes into play when calling
-     `gnorb-org-handle-mail' on a heading with no associated messages,
-     or when `gnorb-org-handle-mail' is called with a prefix arg.
-- `gnorb-org-find-candidates-match' :: When searching all Org files
-     for headings to collect messages from, this option can limit
-     which headings are searched. It is used as the second argument to
-     a call to `org-map-entries', and has the same syntax as that used
-     in an agenda tags view.
-- `gnorb-org-email-subtree-text-parameters' :: A plist of export
-     parameters corresponding to the EXT-PLIST argument to the export
-     functions, for use when exporting to text.
-- `gnorb-org-email-subtree-file-parameters' :: A plist of export
-     parameters corresponding to the EXT-PLIST argument to the export
-     functions, for use when exporting to a file.
-- `gnorb-org-email-subtree-text-options' :: A list of ts and nils
-     corresponding to Org's export options, to be used when exporting
-     to text. The options, in order, are async, subtreep,
-     visible-only, and body-only.
-- `gnorb-org-email-subtree-file-options' :: A list of ts and nils
-     corresponding to Org's export options, to be used when exporting
-     to a file. The options, in order, are async, subtreep,
-     visible-only, and body-only.
-- `gnorb-org-export-extensions' :: Correspondence between export
-     backends and their respective (usual) file extensions.
-- `gnorb-org-capture-collect-link-p' :: When this is set to t, the
-     capture process will always store a link to the Gnus message or
-     BBDB record under point, even when the link isn't part of the
-     capture template. It can then be added to the captured heading
-     with org-insert-link, as usual.
-- `gnorb-org-log-add-link' :: When non-nil, any time a todo trigger
-     action results in adding a note, a link to the triggering message
-     will be added to the log note text.
-- `gnorb-org-agenda-popup-bbdb' :: Set to "t" to automatically pop up
-     the BBDB buffer displaying records corresponding to the Org
-     Agenda tags search underway. If this is nil you can always do it
-     manually with the command of the same name.
-- `gnorb-org-bbdb-popup-layout' :: Controls the layout of the
-     Agenda-related BBDB popup, takes the same values as
-     bbdb-pop-up-layout.
-* Misc Gnus
-** Searching With the Registry
-Gnorb can use the Gnus registry as a sort of limited search index: the
-registry tracks information about sender, recipient, subject, and a
-few other things, and while this isn't as powerful as a full-text
-search index, it's often sufficient. It's also very fast, as it
-doesn't rely on external program, and doesn't require the user to mark
-a particular set of groups beforehand.
-
-- `gnorb-gnus-search-registry' :: Prompt the user for a search string,
-     and match it against messages tracked in the registry. Search
-     strings are given as a series of "key:value" terms, with double
-     quotes around multi-word values. See docstring for available
-     keys.
-- `gnorb-helm-search-registry' :: Helm users can use this function to
-     conduct a more visual search of the registry. Only
-     sender/recipient and subject lines are matched against.
-
-These functions are not bound by default; you might consider:
-
-#+BEGIN_SRC elisp
-  (with-eval-after-load "gnus-group"
-    (define-key gnus-group-group-map (kbd "/") #'gnorb-gnus-search-registry)
-    (define-key gnus-group-group-map (kbd "?") #'gnorb-helm-search-registry))
-#+END_SRC
-** User Options
-- `gnorb-gnus-mail-search-backend' :: Specifies the search backend
-     that you use for searching mails. Currently supports notmuch,
-     mairix, and namazu: set this option to one of those symbols.
-- `gnorb-gnus-capture-always-attach' :: Treat all capture templates as
-     if they had the :gnus-attachments key set to "t". This only has
-     any effect if you're capturing from a Gnus summary or article
-     buffer.
-- `gnorb-gnus-tick-all-tracked-messages' :: When non-nil, always add
-     the tick mark to messages when they are first associated with an
-     Org heading. The mark can be safely deleted afterwards.
-- `gnorb-trigger-todo-default' :: Set to either 'note or 'todo to tell
-     `gnorb-gnus-incoming-do-todo' what to do by default. You can
-     reach the non-default behavior by calling that function with a
-     prefix argument. Alternately, set to 'prompt to always prompt for
-     the appropriate action.
-- `gnorb-gnus-trigger-refile-targets' :: If you use
-     `gnorb-gnus-incoming-do-todo' on an incoming message, Gnorb will
-     try to locate a TODO heading that's relevant to that message. If
-     it can't, it will prompt you for one, using the refile interface.
-     This option will be used as the value of `org-refile-targets'
-     during that process: see the docstring of `org-refile-targets'
-     for the appropriate syntax.
-- `gnorb-gnus-refile-use-outline-path' :: Similar to the previous
-     option, this option will be used as the value of
-     `org-refile-use-outline-path' when selecting a heading: see the
-     its docstring for the meaning of its potential values.
-- `gnorb-gnus-new-todo-capture-key' :: Set this to a single-character
-     string pointing at an Org capture template to use when creating
-     TODOs from outgoing messages. The template is a regular capture
-     template, with a few exceptions. If Gnus helps you archive
-     outgoing messages (ie you have `gnus-message-archive-group' set
-     to something, and your outgoing messages have a "Fcc" header), a
-     link to that message will be made, and you'll be able to use all
-     the escapes related to gnus messages. If you don't archive
-     outgoing messages, you'll still be able to use the %:subject,
-     %:to, %:toname, %:toaddress, and %:date escapes in the capture
-     template.
-- `gnorb-gnus-hint-relevant-article' :: Set to "t" (the default) to
-     have Gnorb give you a hint in the minibuffer when opening
-     messages that might be relevant to existing Org TODOs.
-- `gnorb-gnus-summary-mark-format-letter' :: The formatting letter to
-     use as part of your `gnus-summary-line-format', to indicate
-     messages which might be relevant to Org TODOs. Defaults to "g",
-     meaning it should be used as "%ug" in the format line.
-- `gnorb-gnus-summary-mark' :: The mark used to indicate potentially
-     relevant messages in the Summary buffer, when
-     `gnorb-gnus-summary-mark-format-letter' is present in the format
-     line. Defaults to "¡".
-- `gnorb-gnus-summary-tracked-mark' :: The mark used to indicate
-     already-tracked messages in the Summary buffer, when
-     `gnorb-gnus-summary-mark-format-letter' is present in the format
-     line. Defaults to "&".
-* Default Keybindings
-:PROPERTIES:
-:ID:       de1b2579-86c2-4bb1-b77e-3467a3d2b3c7
-:END:
-Using the bundled function `gnorb-install-defaults' runs the code
-below. If you don't like these defaults, you can always do your own setup.
-#+BEGIN_SRC emacs-lisp
-  (global-set-key (kbd "C-c A") 'gnorb-restore-layout)
-  (eval-after-load "gnorb-bbdb"
-    '(progn
-       (define-key bbdb-mode-map (kbd "C-c S") #'gnorb-bbdb-mail-search)
-       (define-key bbdb-mode-map (kbd "C-c l") #'gnorb-bbdb-open-link)
-       (define-key bbdb-mode-map [remap bbdb-mail] #'gnorb-bbdb-mail)
-       (eval-after-load "gnorb-org"
-        (org-defkey org-mode-map (kbd "C-c C") #'gnorb-org-contact-link))))
-  (eval-after-load "gnorb-org"
-    '(progn
-       (org-defkey org-mode-map (kbd "C-c t") #'gnorb-org-handle-mail)
-       (org-defkey org-mode-map (kbd "C-c v") #'gnorb-org-view)
-       (org-defkey org-mode-map (kbd "C-c E") #'gnorb-org-email-subtree)
-       (setq gnorb-org-agenda-popup-bbdb t)
-       (eval-after-load "org-agenda"
-        '(progn (org-defkey org-agenda-mode-map (kbd "C-c t") 
#'gnorb-org-handle-mail)
-                (org-defkey org-agenda-mode-map (kbd "C-c v") 
#'gnorb-org-view)))))
-  (eval-after-load "gnorb-gnus"
-    '(progn
-       (define-key gnus-summary-mime-map "a" #'gnorb-gnus-article-org-attach)
-       (define-key gnus-summary-mode-map (kbd "C-c t") 
#'gnorb-gnus-incoming-do-todo)
-       (define-key gnus-summary-mode-map (kbd "C-c v") #'gnorb-gnus-view)
-       (define-key gnus-summary-mode-map (kbd "C-c C-t") 
#'gnorb-gnus-tag-message)
-       (define-key gnus-summary-limit-map (kbd "g") 
#'gnorb-gnus-insert-tagged-messages)
-       (define-key gnus-summary-limit-map (kbd "G") 
#'gnorb-gnus-insert-tracked-messages)
-       (setq gnorb-gnus-capture-always-attach t)
-       (push '("attach to org heading" . gnorb-gnus-mime-org-attach)
-             gnus-mime-action-alist)
-       (push '(gnorb-gnus-mime-org-attach "a" "Attach to Org heading")
-             gnus-mime-button-commands)
-       (setq gnus-mime-button-map
-             (let ((map (make-sparse-keymap)))
-               (dolist (c gnus-mime-button-commands)
-                (define-key map (cadr c) (car c)))
-               map))))
-  (eval-after-load "message"
-    '(progn
-       (define-key message-mode-map (kbd "C-c t") 
#'gnorb-gnus-outgoing-do-todo)))
-#+END_SRC
diff --git a/packages/gnorb/gnorb.texi b/packages/gnorb/gnorb.texi
deleted file mode 100644
index 2ad74c4..0000000
--- a/packages/gnorb/gnorb.texi
+++ /dev/null
@@ -1,819 +0,0 @@
-\input texinfo    @c -*- texinfo -*-
-@c %**start of header
-@setfilename gnorb.info
-@settitle Gnorb Manual
-@documentencoding UTF-8
-@documentlanguage en
-@syncodeindex pg cp
-@c %**end of header
-
-@dircategory Emacs
-@direntry
-* Gnorb: (gnorb).       Glue code for Gnus, Org, and BBDB.
-@end direntry
-
-@finalout
-@titlepage
-@title Gnorb Manual
-@subtitle for version 1, updated 13 March, 2017
-@end titlepage
-
-@ifnottex
-@node Top
-@top Gnorb Manual
-@end ifnottex
-
-@menu
-* Introduction::
-* Installation::
-* Setup::
-* Email Tracking::
-* Restoring Window Layout::
-* Recent Mails From BBDB Contacts::
-* Tagging Messages and Contacts::
-* BBDB posting styles::
-* Misc BBDB::
-* Misc Org::
-* Misc Gnus::
-* Default Keybindings::
-
-@detailmenu
---- The Detailed Node Listing ---
-
-Email Tracking
-
-* Likely Workflow::
-* Tracking Setup::
-* Beginning and Continuing the Tracking Process::
-* Trigger Actions::
-* Viewing Things::
-* Hinting in Gnus::
-* Message Attachments::
-* Registry Usage::
-
-Misc BBDB
-
-* Searching for messages from BBDB contacts::
-* Citing BBDB contacts::
-* User Options::
-
-Misc Org
-
-* Inserting BBDB links::
-* User Options: User Options (1).
-
-Misc Gnus
-
-* Searching With the Registry::
-* User Options: User Options (2).
-
-@end detailmenu
-@end menu
-
-@node Introduction
-@chapter Introduction
-
-Gnorb provides glue code between the Gnus, Org, and BBDB packages.
-It's aimed at supporting email-based project management, and generally
-making it easier to keep track of email communication.
-
-Much of the code consists of single-use convenience functions, but
-tracking email conversations with Org requires is more complicated,
-and requires a bit of setup.
-
-Gnorb can be used in a modular fashion, by selectively loading the
-files ``gnorb-org'', ``gnorb-gnus'' or ``gnorb-bbdb'' instead of plain old
-``gnorb''. The package as a whole is rather Org-centric, though, and it
-won't do much of interest without ``gnorb-org''.
-
-If you've installed from the package manager, of course, you don't
-need `require' statements at all. In that case, simply using the
-(autoloaded) functions that are of interest to you will be sufficient.
-
-This means that Gnorb doesn't have hard requirements to any of the
-three base libraries. For the libraries you are using, however, you'll
-get best results from using the most recent stable version (yes, that
-means BBDB 3). Some of the features in Gnorb only work with
-development versions of these libraries (those cases are noted below).
-
-@node Installation
-@chapter Installation
-
-Gnorb is installable via the Elpa package manager -- look for it in
-`list-packages'.
-
-An earlier version of the code is available at
-@uref{https://github.com/girzel/gnorb}, but this is now out of date. Issues
-opened there will still be addressed, however.
-
-@node Setup
-@chapter Setup
-
-Loading ``gnorb'' will make the basic functions available. Using Gnorb
-for email tracking takes a bit more setup, however -- see below.
-
-Gnorb doesn't bind any keys by default, but you can call
-`gnorb-install-defaults' to do a basic installation. The rest of this
-manual assumes those @ref{Default Keybindings, , default keybindings}.
-
-@node Email Tracking
-@chapter Email Tracking
-
-The most interesting thing Gnorb does is using Org headings to track
-email conversations.
-
-A ``tracked conversation'' is essentially a message thread, with
-benefits. An Org heading (and subheadings) collect messages relevant
-to the heading. You can view all the messages at once, reply to the
-most-recently-received message, collect all message attachments on the
-heading (using org-attach), and be reminded that newly-received
-messages might be relevant to the conversation. The state of the Org
-heading tracks the state of your participation in the conversation:
-the TODO keyword might switch between REPLY and WAIT, for instance, or
-you might take notes on how everything's progressing.
-
-In general, the goal is to keep track of whole conversations, reduce
-friction when moving between Gnus and Org, and keep you in the Org
-agenda rather than in Gnus.
-
-@menu
-* Likely Workflow::
-* Tracking Setup::
-* Beginning and Continuing the Tracking Process::
-* Trigger Actions::
-* Viewing Things::
-* Hinting in Gnus::
-* Message Attachments::
-* Registry Usage::
-@end menu
-
-@node Likely Workflow
-@section Likely Workflow
-
-First of all, here's a hypothetical workflow to show you how tracking
-works.
-
-Say you receive an email from Jimmy, who wants to rent a room in your
-house. ``I'll respond to this later,'' you think.
-
-You capture an Org TODO from the email, writing a headline ``Jimmy
-renting a room'', and give it a REPLY keyword. Gnorb quietly records
-the correspondence between the email and the TODO, using the Gnus
-registry.
-
-The next day, looking at your Agenda, you see the TODO and decide to
-respond to the email. You hit ``C-c t'' on the heading, and Gnorb finds
-Jimmy's email and starts a reply to it.
-
-You tell Jimmy the room's available in March, and send the message.
-Gnorb takes you back to the heading, and asks you to trigger an action
-on it. You choose ``todo state'', and change the heading keyword to
-WAIT@.
-
-Two days later, Jimmy replies to your message, saying that March is
-perfect. When you open his response, Gnorb politely reminds you that
-the message is relevant to an existing TODO@. You hit ``C-c t'' on the
-message, and are again taken to the TODO and asked to trigger an
-action. Again you choose ``todo state'', and change the heading keyword
-back to REPLY@.
-
-You get another email, from Samantha, warning you not to rent the room
-to Jimmy. She even attaches a picture of a room in her house, as it
-looked after Jimmy had stayed there for six months. It's bad. You hit
-``C-c t'' on her message, and pick the ``Jimmy renting a room'' heading.
-This time, you choose ``take note'' as the trigger action, and make a
-brief note about how bad that room looked. Gnorb asks if you'd like to
-attach the picture to the Org heading. You decide you will.
-
-Now it's time to write to Jimmy and say something noncommittal.
-Hitting ``C-c t'' on the heading would respond to Samantha's email, the
-most recent of the associated messages, which isn't what you want.
-Instead you hit ``C-c v'' on the heading, which opens up a Gnus
-*Summary* buffer containing all four messages: Jimmy's first, your
-response, his response to that, and Samantha's message. You pick
-Jimmy's second email, and reply to it normally. Gnorb asks if you'd
-like to send the picture of the room as an attachment. You would not.
-When you send the reply Gnorb tracks that as well, and does the
-``trigger an action'' trick again.
-
-In this way Gnorb helps you manage an entire conversation, possibly
-with multiple threads and multiple participants. Mostly all you need
-to do is hit ``C-c t'' on newly-received messages, and ``C-c t'' on the
-heading when it's time to compose a new reply.
-
-@node Tracking Setup
-@section Tracking Setup
-
-Email tracking requires the following steps:
-
-@enumerate
-@item
-Tracking is done via the Gnus registry, so that must be activated
-with 'gnus-registry-initialize'.
-@item
-It also depends on the org-id package, with `org-id-track-globally'
-set to t (that's the default value, so simply loading the package
-should be enough).
-@item
-Add a nngnorb entry to your `gnus-secondary-select-methods'
-variable. It will look like (nngnorb ``Server name''). This does
-nothing but provide a place to hang nnir searches. If you are using
-the Gnus that comes with Emacs 28 or later (or check @code{(featurep
-   'nnselect)} to be sure), this step is unnecessary.
-@item
-Then put a call to `gnorb-tracking-initialize' in your init files.
-@item
-If you're not using a local archive method for saving your sent
-messages (ie you're using IMAP), you'll also need to tell Gnorb
-where to find your sent messages. Set the variable
-`gnorb-gnus-sent-groups' to a list of strings; each string should
-indicate a fully-qualified group name, eg ``nnimap+SERVER:GROUP''.
-@item
-Set `gnorb-gnus-new-todo-capture-key' to the key of a capture
-template you want to use for creating TODOs from sent messages.
-@end enumerate
-
-@node Beginning and Continuing the Tracking Process
-@section Beginning and Continuing the Tracking Process
-
-Email tracking starts in one of three ways:
-
-@enumerate
-@item
-With an Org heading that represents an email TODO@. Call
-`gnorb-org-handle-mail' (see below) on the heading to compose a new
-message, and start the tracking process.
-@item
-By calling org-capture on a received message. Capturing from a Gnus
-Summary buffer automatically initiates tracking.
-@item
-By calling `gnorb-gnus-outgoing-do-todo' while composing a message.
-This will create a new TODO heading after the message is sent.
-@end enumerate
-
-After tracking begins, it is continued by using Gnorb-specific
-commands when sending and receiving email:
-
-@enumerate
-@item
-When you receive an email in Gnus that should be part of a tracked
-conversation, use `gnorb-gnus-incoming-to-todo' on it to associate
-it with the relevant Org heading.
-@item
-When it's time to reply to that email, use `gnorb-org-handle-mail'
-on the Org heading to start a reply to the thread.
-@end enumerate
-
-The default setup binds all these functions to ``C-c t'' in their
-respective modes, so just use that keybinding everywhere to keep the
-conversation going.
-
-Some more detail on the various functions:
-
-@enumerate
-@item
-`gnorb-org-handle-mail' (``C-c t'' in org-mode) is called on an Org
-heading to compose a new message. By default, this will begin a
-reply to the most recent message in the conversation. If there are
-no associated messages to reply to (or you call the function with a
-single prefix arg), Gnorb will look for mailto: or bbdb: links in
-the heading, and compose a new message to them.
-
-Calling the function with a double prefix arg will ignore all
-associated messages and links, and compose a blank message.
-
-Once sent, the message will be associated with the Org heading, and
-you'll be brought back to the heading and asked to trigger an
-action on it. See @ref{Trigger Actions} for more information.
-
-`gnorb-email-subtree' is an alternative to `gnorb-org-handle-mail'.
-It does the same thing as the latter, but first exports the body of
-the subtree as either text or a file, then inserts the text into
-the message body, or attaches the file to the message,
-respectively.
-@item
-`gnorb-gnus-incoming-do-todo' (``C-c t'' in gnus-summary-mode and
-gnus-article-mode) is called on a message in a Gnus *Summary*
-buffer. You'll be prompted for an Org heading, taken to that
-heading, and asked to trigger an action on it.
-@item
-`gnorb-gnus-outgoing-do-todo' (``C-c t'' in message-mode) is called
-in message mode, while composing a new message. Usually this is
-only necessary when starting a new tracked conversation.
-
-If called without a prefix arg, a new Org heading will be created
-after the message is sent, and the sent message associated with it.
-The new heading will be created as a capture heading, using the
-template specified by the `gnorb-gnus-new-todo-capture-key' option.
-
-If you call this function with a single prefix arg, you'll be
-prompted to choose an existing Org heading instead. After the
-message is sent, you'll be taken to that heading and prompted to
-trigger an action on it.
-
-If you've called this function, and then realize you've associated
-the message with the wrong TODO, call it again with a double prefix
-to clear all associations.
-
-It's also possible to call this function *after* a message is sent,
-in case you forgot. Gnorb saves information about the most recently
-sent message for this purpose.
-@end enumerate
-
-An additional convenience command is available for use in Gnus summary
-buffers: `gnorb-gnus-quick-reply'. If you don't want to go through the
-whole round trip of triggering an action and then starting a new
-reply, call this command on an incoming message to associate it with a
-heading, start a reply, and associate your reply with the same
-heading.
-
-@node Trigger Actions
-@section Trigger Actions
-
-After receiving or sending a message in a tracked conversation, you'll
-be taken to the relevant Org heading and asked to ``trigger an action''
-on it. The main purpose of triggering is to associate the message with
-the Org heading, but the action also gives you a chance to do
-something useful like changing the TODO keyword, or leaving a note.
-
-At the moment there are six different possibilities:
-
-@enumerate
-@item
-Change the heading's TODO state.
-@item
-Take a note on the heading.
-@item
-Associate the message, but do nothing else.
-@item
-Capture a new Org heading as a sibling to the tracked heading
-@item
-Capture a new Org heading as a child to the tracked heading
-@item
-Do nothing -- do not associate the message.
-@end enumerate
-
-More actions may be added in the future; it's also possible to
-rearrange or delete existing actions, and add your own: see the
-docstring of `gnorb-org-trigger-actions'.
-
-@node Viewing Things
-@section Viewing Things
-
-Keeping track of a conversation is one thing, but it's very useful to
-be able to see an overview of history and current state. For this
-purpose Gnorb provides ``view'' commands, which by default are bound to
-``C-c v'' in all contexts.
-
-Calling `gnorb-org-view' (``C-c v'') on an Org heading will open an nnir
-summary buffer showing all the messages associated with that heading
-and child headings (this requires you to have added an nngnorb server
-to your Gnus backends). A minor mode is in effect, ensuring that any
-replies you send to messages in this buffer will automatically be
-associated with the original Org heading. You can also invoke
-`gnorb-summary-disassociate-message' (``C-c d'') to disassociate the
-message with the Org heading.
-
-If you call `gnorb-org-view' with a prefix argument, the search group
-will be made persistent across Gnus sessions. You can re-run the
-search and update the group contents by hitting ``M-g'' on the group in
-the Gnus *Group* buffer.
-
-Calling `gnorb-gnus-view' (``C-c v'') on a tracked message will take you
-to the tracked Org heading.
-
-From a Gnus *Summary* buffer, you can insert all tracked messages in
-the current group into the buffer with
-`gnorb-gnus-insert-tracked-messages', bound to ``/ G'' in the default
-keybindings. By default this will only insert messages associated with
-headings that are not in a DONE state; call with a prefix arg to
-insert all messages.
-
-As a bonus, it's possible to go into Gnus' *Server* buffer, find the
-line specifying your nngnorb server, and hit ``G'' (aka
-`gnus-group-make-nnir-group'). At the query prompt, enter an Org-style
-tags-todo Agenda query string (eg ``+work-computer'', or what have you).
-Gnorb will find all headings matching this query, scan their subtrees
-for gnus links, and then give you a Summary buffer containing all the
-linked messages. This is dog-slow at the moment; it will get faster.
-
-@node Hinting in Gnus
-@section Hinting in Gnus
-
-When you receive new mails that might be relevant to existing Org
-TODOs, Gnorb can alert you to that fact. When
-`gnorb-gnus-hint-relevant-article' is t (the default), Gnorb will
-display a message in the minibuffer when opening potentially relevant
-messages. You can then use `gnorb-gnus-incoming-to-todo' to trigger an
-action on the relevant TODO@.
-
-This hinting can happen in the Gnus summary buffer as well. If you use
-the escape indicated by `gnorb-gnus-summary-mark-format-letter' as
-part of your `gnus-summary-line-format', articles that may be relevant
-to TODOs will be marked with a special character in the Summary
-buffer, as determined by `gnorb-gnus-summary-mark'. By default, the
-format letter is ``g'' (meaning it is used as ``%ug'' in the format line),
-and the mark is ``&'' for messages that are already tracked, and ``¡'' for
-messages that may be relevant.
-
-@node Message Attachments
-@section Message Attachments
-
-Gnorb simplifies the handling of attachments that you receive in
-emails. When you call `gnorb-gnus-incoming-do-todo' on a message,
-you'll be prompted to re-attach the email's attachments onto the Org
-heading, using the org-attach library.
-
-You can also do this as part of the capture process. Set the
-new :gnus-attachments key to ``t'' in a capture template that you use on
-mail messages, and you'll be queried to re-attach the message's
-attachments onto the newly-captured heading.
-
-Or set `gnorb-gnus-capture-always-attach' to ``t'' to have Gnorb do this
-for all capture templates.
-
-You can also do this using the regular system of MIME commands,
-without invoking the email tracking process. Using the default
-bindings, pressing ``a'' on a MIME line will prompt you to move the
-attachment to an Org heading.
-
-The same process works in reverse: when you send a message from an Org
-heading using `gnorb-org-handle-mail', Gnorb will ask if you want to
-attach the files in the heading's org-attach directory to the outgoing
-message.
-
-@node Registry Usage
-@section Registry Usage
-
-You can see how many associations you've got stored in the registry by
-calling `gnorb-report-tracking-usage'. This will pop up a buffer
-showing how much of the registry you're using, and offering
-keybindings for `gnorb-flush-dead-associations', to help Gnorb clean
-up after itself.
-
-@node Restoring Window Layout
-@chapter Restoring Window Layout
-
-Many Gnorb functions alter the window layout and value of point. In
-most of these cases, you can restore the previous layout using the
-interactive function `gnorb-restore-layout', by default bound to ``C-c
-A''.
-
-@node Recent Mails From BBDB Contacts
-@chapter Recent Mails From BBDB Contacts
-
-If you're using a recent git version of BBDB (circa mid-May 2014 or
-later), you can give your BBDB contacts a special field which will
-collect links to recent emails from that contact. The default name of
-the field is ``messages'', but you can customize that name using the
-`gnorb-bbdb-messages-field' option.
-
-Gnorb will not collect links by default: you need to call
-`gnorb-bbdb-open-link' on a contact once to start the process.
-Thereafter, opening mails from that contact will store a link to the
-message.
-
-Once some links are stored, `gnorb-bbdb-open-link' will open them: Use
-a prefix arg to the function call to select particular messages to
-open. There are several options controlling how all this works; see
-the gnorb-bbdb user options section below for details.
-
-@node Tagging Messages and Contacts
-@chapter Tagging Messages and Contacts
-
-It's possible to use your defined Org tags to tag BBDB contacts and
-Gnus messages.
-
-For BBDB contacts, tags are stored in an xfield named org-tags, by
-default (you can customize the name of this field using the
-`gnorb-bbdb-org-tag-field' option). Once contacts are tagged, you can
-search for tags normally in the *BBDB* buffer. You can also pop up a
-*BBDB* buffer alongside an Org Agenda tags search, with contacts
-matching the search terms. You can have this happen automatically, by
-setting `gnorb-org-agenda-popup-bbdb' to a non-nil value, or do it
-manually by calling `gnorb-org-popup-bbdb'.
-
-Gnus messages can be tagged from a *Summary* buffer using the command
-`gnorb-gnus-tag-message' (bound to ``C-c C-t'' when using the default
-keybindings). You can also search for tagged messages in a group using
-`gnorb-gnus-insert-tagged-messages' (bound to ``/ g'' when using the
-default keybindings). The search string can be given as a more complex
-tags expression a la Org Agenda searches, ie ``cat|bird-dog''.
-
-If the option `gnorb-gnus-auto-tag-messages' is non-nil, any time you
-trigger an Org heading from a Gnus message, the message will ``inherit''
-the tags of the Org heading.
-
-You can view Org tags on Gnus messages by adding the ``%uG'' spec code
-to your `gnus-group-line-format' value. That spec code can be
-customized using the `gnorb-gnus-summary-tags-format-letter' option.
-
-@node BBDB posting styles
-@chapter BBDB posting styles
-
-Gnorb comes with a BBDB posting-style system, inspired by (copied
-from) gnus-posting-styles. You can specify how messages are composed
-to specific contacts, by matching on contact field values (the same
-way gnus-posting-styles matches on group names). See the docstring of
-`gnorb-bbdb-posting-styles' for details.
-
-In order not to be too intrusive, Gnorb doesn't alter the behavior of
-`bbdb-mail', the usual mail-composition function. Instead it provides
-an alternate `gnorb-bbdb-mail', which does exactly the same thing, but
-first processes the new mail according to `gnorb-bbdb-posting-styles'.
-If you want to use this feature regularly, you can remap `bbdb-mail'
-to `gnorb-bbdb-mail' in the `bbdb-mode-map'.
-
-@node Misc BBDB
-@chapter Misc BBDB
-
-@menu
-* Searching for messages from BBDB contacts::
-* Citing BBDB contacts::
-* User Options::
-@end menu
-
-@node Searching for messages from BBDB contacts
-@section Searching for messages from BBDB contacts
-
-Call `gnorb-bbdb-mail-search' to search for all mail messages from the
-record(s) displayed. Currently supports the notmuch, mairix, and
-namazu search backends; set `gnorb-gnus-mail-search-backend' to one of
-those symbol values.
-
-@node Citing BBDB contacts
-@section Citing BBDB contacts
-
-Calling `gnorb-bbdb-cite-contact' will prompt for a BBDB record and
-insert a string of the type ``Bob Smith <bob@@smith.com>''.
-
-@node User Options
-@section User Options
-
-@table @asis
-@item `gnorb-bbdb-org-tag-field
-The name of the BBDB xfield, as a
-symbol, that holds Org-related tags. Specified as a string with
-the ``:'' separator between tags, same as for Org headings.
-Defaults to org-tag.
-@item `gnorb-bbdb-messages-field'
-The name of the BBDB xfield that
-holds links to recently-received messages from this contact.
-Defaults to 'messages.
-@item `gnorb-bbdb-collect-N-messages'
-Collect at most this many links
-to messages from this contact. Defaults to 5.
-@item `gnorb-bbdb-define-recent'
-What does ``recently-received'' mean?
-Possible values are the symbols seen and received. When set to
-seen, the most recently-opened messages are collected. When set
-to received, the most recently-received (by Date header) messages
-are collected. Defaults to seen.
-@item `gnorb-bbdb-message-link-format-multi'
-How is a single message's
-link formatted in the multi-line BBDB layout format? Defaults to
-``%:count. %D: %:subject'' (see the docstring for details).
-@item ` gnorb-bbdb-message-link-format-one'
-How is a single message's
-link formatted in the one-line BBDB layout format? Defaults to
-nil (see the docstring for details).
-@item `gnorb-bbdb-posting-styles'
-Styles to use for influencing the
-format of mails composed to the BBDB record(s) under point (see
-the docstring for details).
-@end table
-
-@node Misc Org
-@chapter Misc Org
-
-@menu
-* Inserting BBDB links::
-* User Options: User Options (1).
-@end menu
-
-@node Inserting BBDB links
-@section Inserting BBDB links
-
-Calling `gnorb-org-contact-link' will prompt for a BBDB record and
-insert an Org link to that record at point.
-
-@node User Options (1)
-@section User Options
-
-@table @asis
-@item `gnorb-org-after-message-setup-hook'
-Hook run in a message buffer
-after setting up the message, from `gnorb-org-handle-mail' or
-`gnorb-org-email-subtree'.
-@item `gnorb-org-trigger-actions'
-List of potential actions that can be
-taken on headings after a message is sent. See docstring for
-details.
-@item `gnorb-org-mail-scan-scope'
-The number of paragraphs to scan for
-mail-related links. This comes into play when calling
-`gnorb-org-handle-mail' on a heading with no associated messages,
-or when `gnorb-org-handle-mail' is called with a prefix arg.
-@item `gnorb-org-find-candidates-match'
-When searching all Org files
-for headings to collect messages from, this option can limit
-which headings are searched. It is used as the second argument to
-a call to `org-map-entries', and has the same syntax as that used
-in an agenda tags view.
-@item `gnorb-org-email-subtree-text-parameters'
-A plist of export
-parameters corresponding to the EXT-PLIST argument to the export
-functions, for use when exporting to text.
-@item `gnorb-org-email-subtree-file-parameters'
-A plist of export
-parameters corresponding to the EXT-PLIST argument to the export
-functions, for use when exporting to a file.
-@item `gnorb-org-email-subtree-text-options'
-A list of ts and nils
-corresponding to Org's export options, to be used when exporting
-to text. The options, in order, are async, subtreep,
-visible-only, and body-only.
-@item `gnorb-org-email-subtree-file-options'
-A list of ts and nils
-corresponding to Org's export options, to be used when exporting
-to a file. The options, in order, are async, subtreep,
-visible-only, and body-only.
-@item `gnorb-org-export-extensions'
-Correspondence between export
-backends and their respective (usual) file extensions.
-@item `gnorb-org-capture-collect-link-p'
-When this is set to t, the
-capture process will always store a link to the Gnus message or
-BBDB record under point, even when the link isn't part of the
-capture template. It can then be added to the captured heading
-with org-insert-link, as usual.
-@item `gnorb-org-log-add-link'
-When non-nil, any time a todo trigger
-action results in adding a note, a link to the triggering message
-will be added to the log note text.
-@item `gnorb-org-agenda-popup-bbdb'
-Set to ``t'' to automatically pop up
-the BBDB buffer displaying records corresponding to the Org
-Agenda tags search underway. If this is nil you can always do it
-manually with the command of the same name.
-@item `gnorb-org-bbdb-popup-layout'
-Controls the layout of the
-Agenda-related BBDB popup, takes the same values as
-bbdb-pop-up-layout.
-@end table
-
-@node Misc Gnus
-@chapter Misc Gnus
-
-@menu
-* Searching With the Registry::
-* User Options: User Options (2).
-@end menu
-
-@node Searching With the Registry
-@section Searching With the Registry
-
-Gnorb can use the Gnus registry as a sort of limited search index: the
-registry tracks information about sender, recipient, subject, and a
-few other things, and while this isn't as powerful as a full-text
-search index, it's often sufficient. It's also very fast, as it
-doesn't rely on external program, and doesn't require the user to mark
-a particular set of groups beforehand.
-
-@table @asis
-@item `gnorb-gnus-search-registry'
-Prompt the user for a search string,
-and match it against messages tracked in the registry. Search
-strings are given as a series of ``key:value'' terms, with double
-quotes around multi-word values. See docstring for available
-keys.
-@item `gnorb-helm-search-registry'
-Helm users can use this function to
-conduct a more visual search of the registry. Only
-sender/recipient and subject lines are matched against.
-@end table
-
-These functions are not bound by default; you might consider:
-
-@lisp
-(with-eval-after-load "gnus-group"
-  (define-key gnus-group-group-map (kbd "/") #'gnorb-gnus-search-registry)
-  (define-key gnus-group-group-map (kbd "?") #'gnorb-helm-search-registry))
-@end lisp
-
-@node User Options (2)
-@section User Options
-
-@table @asis
-@item `gnorb-gnus-mail-search-backend'
-Specifies the search backend
-that you use for searching mails. Currently supports notmuch,
-mairix, and namazu: set this option to one of those symbols.
-@item `gnorb-gnus-capture-always-attach'
-Treat all capture templates as
-if they had the :gnus-attachments key set to ``t''. This only has
-any effect if you're capturing from a Gnus summary or article
-buffer.
-@item `gnorb-gnus-tick-all-tracked-messages'
-When non-nil, always add
-the tick mark to messages when they are first associated with an
-Org heading. The mark can be safely deleted afterwards.
-@item `gnorb-trigger-todo-default'
-Set to either 'note or 'todo to tell
-`gnorb-gnus-incoming-do-todo' what to do by default. You can
-reach the non-default behavior by calling that function with a
-prefix argument. Alternately, set to 'prompt to always prompt for
-the appropriate action.
-@item `gnorb-gnus-trigger-refile-targets'
-If you use
-`gnorb-gnus-incoming-do-todo' on an incoming message, Gnorb will
-try to locate a TODO heading that's relevant to that message. If
-it can't, it will prompt you for one, using the refile interface.
-This option will be used as the value of `org-refile-targets'
-during that process: see the docstring of `org-refile-targets'
-for the appropriate syntax.
-@item `gnorb-gnus-refile-use-outline-path'
-Similar to the previous
-option, this option will be used as the value of
-`org-refile-use-outline-path' when selecting a heading: see the
-its docstring for the meaning of its potential values.
-@item `gnorb-gnus-new-todo-capture-key'
-Set this to a single-character
-string pointing at an Org capture template to use when creating
-TODOs from outgoing messages. The template is a regular capture
-template, with a few exceptions. If Gnus helps you archive
-outgoing messages (ie you have `gnus-message-archive-group' set
-to something, and your outgoing messages have a ``Fcc'' header), a
-link to that message will be made, and you'll be able to use all
-the escapes related to gnus messages. If you don't archive
-outgoing messages, you'll still be able to use the %:subject,
-%:to, %:toname, %:toaddress, and %:date escapes in the capture
-template.
-@item `gnorb-gnus-hint-relevant-article'
-Set to ``t'' (the default) to
-have Gnorb give you a hint in the minibuffer when opening
-messages that might be relevant to existing Org TODOs.
-@item `gnorb-gnus-summary-mark-format-letter'
-The formatting letter to
-use as part of your `gnus-summary-line-format', to indicate
-messages which might be relevant to Org TODOs. Defaults to ``g'',
-meaning it should be used as ``%ug'' in the format line.
-@item `gnorb-gnus-summary-mark'
-The mark used to indicate potentially
-relevant messages in the Summary buffer, when
-`gnorb-gnus-summary-mark-format-letter' is present in the format
-line. Defaults to ``¡''.
-@item `gnorb-gnus-summary-tracked-mark'
-The mark used to indicate
-already-tracked messages in the Summary buffer, when
-`gnorb-gnus-summary-mark-format-letter' is present in the format
-line. Defaults to ``&''.
-@end table
-
-@node Default Keybindings
-@chapter Default Keybindings
-
-Using the bundled function `gnorb-install-defaults' runs the code
-below. If you don't like these defaults, you can always do your own setup.
-@lisp
-(global-set-key (kbd "C-c A") 'gnorb-restore-layout)
-(eval-after-load "gnorb-bbdb"
-  '(progn
-     (define-key bbdb-mode-map (kbd "C-c S") #'gnorb-bbdb-mail-search)
-     (define-key bbdb-mode-map (kbd "C-c l") #'gnorb-bbdb-open-link)
-     (define-key bbdb-mode-map [remap bbdb-mail] #'gnorb-bbdb-mail)
-     (eval-after-load "gnorb-org"
-       (org-defkey org-mode-map (kbd "C-c C") #'gnorb-org-contact-link))))
-(eval-after-load "gnorb-org"
-  '(progn
-     (org-defkey org-mode-map (kbd "C-c t") #'gnorb-org-handle-mail)
-     (org-defkey org-mode-map (kbd "C-c v") #'gnorb-org-view)
-     (org-defkey org-mode-map (kbd "C-c E") #'gnorb-org-email-subtree)
-     (setq gnorb-org-agenda-popup-bbdb t)
-     (eval-after-load "org-agenda"
-       '(progn (org-defkey org-agenda-mode-map (kbd "C-c t") 
#'gnorb-org-handle-mail)
-               (org-defkey org-agenda-mode-map (kbd "C-c v") 
#'gnorb-org-view)))))
-(eval-after-load "gnorb-gnus"
-  '(progn
-     (define-key gnus-summary-mime-map "a" #'gnorb-gnus-article-org-attach)
-     (define-key gnus-summary-mode-map (kbd "C-c t") 
#'gnorb-gnus-incoming-do-todo)
-     (define-key gnus-summary-mode-map (kbd "C-c v") #'gnorb-gnus-view)
-     (define-key gnus-summary-mode-map (kbd "C-c C-t") 
#'gnorb-gnus-tag-message)
-     (define-key gnus-summary-limit-map (kbd "g") 
#'gnorb-gnus-insert-tagged-messages)
-     (define-key gnus-summary-limit-map (kbd "G") 
#'gnorb-gnus-insert-tracked-messages)
-     (setq gnorb-gnus-capture-always-attach t)
-     (push '("attach to org heading" . gnorb-gnus-mime-org-attach)
-           gnus-mime-action-alist)
-     (push '(gnorb-gnus-mime-org-attach "a" "Attach to Org heading")
-           gnus-mime-button-commands)
-     (setq gnus-mime-button-map
-           (let ((map (make-sparse-keymap)))
-             (dolist (c gnus-mime-button-commands)
-               (define-key map (cadr c) (car c)))
-             map))))
-(eval-after-load "message"
-  '(progn
-     (define-key message-mode-map (kbd "C-c t") 
#'gnorb-gnus-outgoing-do-todo)))
-@end lisp
-
-@bye
\ No newline at end of file
diff --git a/packages/gnorb/nngnorb.el b/packages/gnorb/nngnorb.el
deleted file mode 100644
index f36423f..0000000
--- a/packages/gnorb/nngnorb.el
+++ /dev/null
@@ -1,194 +0,0 @@
-;;; nngnorb.el --- Gnorb backend for Gnus -*- lexical-binding: t -*-
-
-;; Copyright (C) 2018-2020  Free Software Foundation, Inc.
-
-;; Author: Eric Abrahamsen <eric@ericabrahamsen.net.>
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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 3 of the License, or
-;; (at your option) any later version.
-
-;; GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This is a backend for supporting Gnorb-related stuff.  In Emacs 28
-;; this file is not needed, and won't be loaded.
-
-;; In Emacs 27 and below, Gnus searches are governed by nnir.el.
-;; Because of the way nnir is set up, the actual function to call the
-;; search is hardcoded to the server-type found in the nnir address.
-
-;; The upshot is that, if you want to return arbitrary lists of
-;; messages, possibly from multiple groups/servers, you can't simply
-;; feed your own search function to nnir.  You have to create a whole
-;; new Gnus server, and then associate your search function with that
-;; server in `nnir-engines'.  Thus this library, which creates an
-;; entire fake Gnus backend and requires users to add it to their Gnus
-;; config, just so we can call our function.
-
-;; It works by creating an nnir group with a gnorb address.  nnir then
-;; looks up the gnorb address and sees that it should use
-;; `nnir-run-gnorb' for the search, it calls that function, which ends
-;; up calling back to `gnorb-run-search', which is the function that
-;; does the real work.
-
-;; In Emacs 28 and above, Gnorb searches are displayed using the
-;; nnselect backend, which allows us to specify our own arbitrary
-;; function -- `gnorb-run-search' -- for retrieving search results,
-;; making the whole thing much simpler.
-
-;;; Code:
-
-(require 'gnus)
-(eval-and-compile
-  (require 'gnus-group)
-  (require 'nnheader)
-  (require 'nnir))
-
-(declare-function gnorb-run-search "gnorb-gnus")
-
-(defvar nngnorb-status-string "")
-
-(gnus-declare-backend "nngnorb" 'post-mail 'virtual)
-
-(add-to-list 'nnir-method-default-engines '(nngnorb . gnorb))
-
-(add-to-list 'nnir-engines
-            '(gnorb nnir-run-gnorb))
-
-(defun nnir-run-gnorb (query _server &optional _group)
-  "Run the actual search for messages to display. See nnir.el for
-some details of how this gets called.
-
-As things stand, the query string can be given as one of two
-different things. First is the ID string of an Org heading,
-prefixed with \"id+\". This was probably a bad choice as it could
-conceivably look like an org tags search string. Fix that later.
-If it's an ID, then the entire subtree text of that heading is
-scanned for gnus links, and the messages relevant to the subtree
-are collected from the registry, and all the resulting messages
-are displayed in an ephemeral group.
-
-Otherwise, the query string can be a tags match string, a la the
-Org agenda tags search. All headings matched by this string will
-be scanned for gnus messages, and those messages displayed."
-  (if (cdr-safe (assq 'articles query))
-      ;; The work has already been done elsewhere.
-      (cdr (assq 'articles query))
-    (let ((q (cdr (assq 'query query))))
-      (when (and (equal "5.13" gnus-version-number) (version< emacs-version 
"24.4"))
-       (setq q (car q)))
-      (gnorb-run-search q))))
-
-(defun gnorb-gnus-nnir-search (str persist head-text ret)
-  "Create an nnir group that is set up to run a Gnorb search."
-  (let* ((nnir-address (gnorb-find-gnorb-server))
-        (name (if persist
-                  (read-string
-                   (format "Name for group (default %s): " head-text)
-                   nil nil head-text)
-                (concat "gnorb-" str)))
-        (method (list 'nnir nnir-address))
-        (spec (list
-               (cons 'nnir-specs (list (cons 'nnir-query-spec
-                                             `((query . ,str)))
-                                       (cons 'nnir-group-spec
-                                             `((,nnir-address ,(list name))))))
-               (cons 'nnir-artlist nil))))
-    (if persist
-       (progn
-         (switch-to-buffer gnus-group-buffer)
-         (gnus-group-make-group name method nil spec)
-         (gnus-group-select-group))
-      (gnus-group-read-ephemeral-group name method nil ret nil nil spec))))
-
-(defun gnorb-gnus-nnir-registry-search (articles)
-  (let ((server (gnorb-find-gnorb-server)))
-    (gnus-group-read-ephemeral-group
-     "registry messages" `(nnir ,server)
-     nil `(switch-to-buffer ,gnus-group-buffer)
-     nil nil `((nnir-specs ((nnir-query-spec
-                            ((query . "dummy")
-                             (articles . ,articles)))
-                           (nnir-group-spec
-                            ((,server ("registry messages"))))))
-              (nnir-artlist)))))
-
-(defun gnorb-find-gnorb-server (&optional no-error)
-  "Try very hard to find a local nngnorb server.
-If NO-ERROR is non-nil, return nil on failure, otherwise an
-error."
-  (or (catch 'found
-       ;; Try very hard to find the server.
-       (when (assoc 'nngnorb gnus-secondary-select-methods)
-         (throw 'found
-                (format
-                 "nngnorb:%s"
-                 (nth 1 (assoc 'nngnorb
-                               gnus-secondary-select-methods)))))
-       (dolist (s (append gnus-server-alist gnus-server-method-cache))
-         (when (eq 'nngnorb (cadr s))
-           (throw 'found (car s)))))
-      (unless no-error
-       (user-error
-        "Please add a \"nngnorb\" backend to your gnus installation."))))
-
-
-
-(defun nngnorb-retrieve-headers (_articles &optional _group _server _fetch-old)
-  (with-current-buffer nntp-server-buffer
-    (erase-buffer))
-  'nov)
-
-(defun nngnorb-open-server (_server &optional _definitions)
-  t)
-
-(defun nngnorb-close-server (&optional _server)
-  t)
-
-(defun nngnorb-request-close ()
-  t)
-
-(defun nngnorb-server-opened (&optional _server)
-  t)
-
-(defun nngnorb-status-message (&optional _server)
-  nngnorb-status-string)
-
-(defun nngnorb-request-article (_article &optional _group _server _to-buffer)
-  (setq nngnorb-status-string "No such group")
-  nil)
-
-(defun nngnorb-request-group (_group &optional _server _fast _info)
-  (let (deactivate-mark)
-    (with-current-buffer nntp-server-buffer
-      (erase-buffer)
-      (insert "411 no such news group\n")))
-  (setq nngnorb-status-string "No such group")
-  nil)
-
-(defun nngnorb-close-group (_group &optional _server)
-  t)
-
-(defun nngnorb-request-list (&optional _server)
-  (with-current-buffer nntp-server-buffer
-    (erase-buffer))
-  t)
-
-(defun nngnorb-request-post (&optional _server)
-  (setq nngnorb-status-string "Read-only server")
-  nil)
-
-(provide 'nngnorb)
-
-;;; nnnil.el ends here
diff --git a/packages/muse/README b/packages/muse/README
deleted file mode 100644
index 5f6e20e..0000000
--- a/packages/muse/README
+++ /dev/null
@@ -1,7 +0,0 @@
-Muse is a tool for easily authoring and publishing documents.  It
-allows for rapid prototyping of hyperlinked text, which may then be
-exported to multiple output formats, such as HTML, LaTeX, and Texinfo.
-
-The markup rules used by Muse are intended to be very friendly to
-people familiar with Emacs.  See the included manual for more
-information.
diff --git a/packages/muse/cgi.el b/packages/muse/cgi.el
deleted file mode 100644
index 0e85a52..0000000
--- a/packages/muse/cgi.el
+++ /dev/null
@@ -1,218 +0,0 @@
-;;; cgi.el -- Using Emacs for CGI scripting
-
-;; Copyright (C) 2000, 2006, 2012, 2014 Free Software Foundation, Inc.
-
-;; Author: Eric Marsden  <emarsden@laas.fr>
-;;         Michael Olson <mwolson@gnu.org> (slight modifications)
-;; Keywords: CGI web scripting slow
-;; Version: 0.3
-;; Time-stamp: <2001-08-24 emarsden>
-
-;;     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 3 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.
-
-;;; Commentary:
-
-;; People who like this sort of thing will find this the sort of
-;; thing they like.                           -- Abraham Lincoln
-;;
-;;
-;; Overview ==========================================================
-;;
-;; A simple library for the Common Gateway Interface for Emacs,
-;; allowing you to service requests for non static web pages in elisp.
-;; Provides routines for decoding arguments to GET- and POST-type CGI
-;; requests.
-;;
-;; Usage: place a shell script such as the following in your web
-;; server's CGI directory (typically called something like
-;; /var/www/cgi-bin/):
-;;
-;; ,-------------------------------------------------------------------
-;; | #!/bin/sh
-;; |
-;; | emacs -batch -l cgi.el -f cgi-calendar
-;; `-------------------------------------------------------------------
-;;
-;; (`cgi-calendar' is a sample elisp CGI script provided at the end of
-;; this file).
-;;
-;; Alternatively, if you're running version 2.x of the linux kernel
-;; you could make .elc files directly executable via the binfmt_misc
-;; mechanism and run them straight from the cgi-bin directory.
-;;
-;; Efficiency would be improved by having Emacs bind to the http
-;; service port and spawn a thread per connection.  Extending Emacs to
-;; support server sockets and multithreading is left as an exercise
-;; for the reader.
-;;
-;; References:
-;;   * rfc1738 "Uniform Resource Locators"
-;;   * rfc1630 "Universal Resource Identifiers in WWW"
-;;
-;; Thanks to Christoph Conrad <christoph.conrad@gmx.de> for pointing
-;; out a bug in the URI-decoding.
-
-;;; Code:
-
-(eval-when-compile
-  (require 'cl)
-  (require 'calendar))
-
-(defconst cgi-url-unreserved-chars '(
-    ?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m
-    ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z
-    ?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M
-    ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z
-    ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9
-    ?\$ ?\- ?\_ ?\. ?\! ?\~ ?\* ?\' ?\( ?\) ?\,))
-
-(defun cgi-int-char (i)
-  (if (fboundp 'int-char) (int-char i) i))
-
-(defun cgi-hex-char-p (ch)
-  (declare (character ch))
-  (let ((hexchars '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9
-                   ?A ?B ?C ?D ?E ?F)))
-    (member (upcase ch) hexchars)))
-
-;; decode %xx to the corresponding character and + to ' '
-(defun cgi-decode-string (str)
-  (do ((i 0)
-       (len (length str))
-       (decoded '()))
-      ((>= i len) (concat (nreverse decoded)))
-    (let ((ch (aref str i)))
-      (cond ((eq ?+ ch)
-            (push ?\  decoded)
-            (incf i))
-           ((and (eq ?% ch)
-                 (< (+ i 2) len)
-                 (cgi-hex-char-p (aref str (+ i 1)))
-                 (cgi-hex-char-p (aref str (+ i 2))))
-            (let ((hex (string-to-number (substring str (+ i 1) (+ i 3)) 16)))
-              (push (cgi-int-char hex) decoded)
-              (incf i 3)))
-           (t (push ch decoded)
-              (incf i))))))
-
-(defun cgi-position (item seq &optional start end)
-  (or start (setq start 0))
-  (or end (setq end (length seq)))
-  (while (and (< start end)
-             (not (equal item (aref seq start))))
-    (setq start (1+ start)))
-  (and (< start end) start))
-
-;; Parse "foo=x&bar=y+re" into (("foo" . "x") ("bar" . "y re"))
-;; Substrings are plus-decoded and then URI-decoded.
-(defun cgi-decode (q)
-  (when q
-    (let ((split-=
-           (lambda (str)
-             (let ((pos (or (cgi-position ?= str) 0)))
-               (cons (cgi-decode-string (substring str 0 pos))
-                     (cgi-decode-string (substring str (+ pos 1))))))))
-      (mapcar split-= (split-string q "&")))))
-
-(defun cgi-lose (fmt &rest args)
-  (let ((why (apply #'format fmt args)))
-    (message "Script error: %s" why)    ; to error_log
-    (princ "Content-type: text/html\n\n") ; to browser
-    (princ "<html><head><title>Script error</title></head>\r\n")
-    (princ "<body><h1>Script error</h1>\r\n<p>\r\n")
-    (princ why)
-    (princ "\r\n</body></html>\r\n")
-    (kill-emacs 0)))
-
-(defmacro cgi-evaluate (&rest forms)
-  `(condition-case why
-       (princ (with-output-to-string ,@forms))
-     (error (cgi-lose "Emacs Lisp error: %s" why))))
-
-(defun cgi-arguments ()
-  (let ((method (getenv "REQUEST_METHOD"))
-       req buf)
-    (cond ((null method)
-          (cgi-lose "No request method specified"))
-         ((string= "GET" method)
-          (unless (getenv "QUERY_STRING")
-            (cgi-lose "No query string for GET request"))
-          (cgi-decode (getenv "QUERY_STRING")))
-         ((string= "POST" method)
-          (setq req (getenv "CONTENT_LENGTH"))
-          (unless req
-            (cgi-lose "No content-length for POST request"))
-          (setq buf (get-buffer-create " *cgi*"))
-          (set-buffer buf)
-          (erase-buffer)
-          (loop for i from 1 to (string-to-number req)
-                do (insert (read-event)))
-          (cgi-decode (buffer-string)))
-         (t
-          (cgi-lose "Can't handle request method %s" method)))))
-
-;; ====================================================================
-;; a sample application: calendar via the web. If invoked without
-;; arguments, presents a calendar for the three months around the
-;; current date. You can request a calendar for a specific period by
-;; specifying the year and the month in the query string:
-;;
-;;   ~$ lynx -dump 'http://localhost/cgi-bin/cal?year=1975&month=6'
-;;
-;; When run in batch mode, text normally displayed in the echo area
-;; (via `princ' for example) goes to stdout, and thus to the browser.
-;; Text output using `message' goes to stderr, and thus normally to
-;; your web server's error_log.
-;; ====================================================================
-
-(eval-and-compile
-  (if (fboundp 'calendar-extract-month)
-      (defalias 'cgi-calendar-extract-month 'calendar-extract-month)
-    (defalias 'cgi-calendar-extract-month 'extract-calendar-month))
-
-  (if (fboundp 'calendar-extract-year)
-      (defalias 'cgi-calendar-extract-year 'calendar-extract-year)
-    (defalias 'cgi-calendar-extract-year 'extract-calendar-year))
-
-  (if (fboundp 'calendar-generate)
-      (defalias 'cgi-calendar-generate 'calendar-generate)
-    (defalias 'cgi-calendar-generate 'generate-calendar)))
-
-(defun cgi-calendar-string ()
-  (require 'calendar)
-  (let* ((args (cgi-arguments))
-        (now (calendar-current-date))
-        (mnth (cdr (assoc "month" args)))
-        (month (if mnth (string-to-number mnth)
-                 (cgi-calendar-extract-month now)))
-        (yr (cdr (assoc "year" args)))
-        (year (if yr (string-to-number yr)
-                (cgi-calendar-extract-year now))))
-    (with-temp-buffer
-      (cgi-calendar-generate month year)
-      (buffer-string))))
-
-(defun cgi-calendar ()
-  (cgi-evaluate
-   (princ "Content-type: text/html\n\n")
-   (princ "<html><head><title>Emacs calendar</title></head>\r\n")
-   (princ "<body> <h1>Emacs calendar</h1>\r\n")
-   (princ "<pre>\r\n")
-   (princ (cgi-calendar-string))
-   (princ "\r\n</pre></body></html>\r\n")))
-
-(provide 'cgi)
-;;; cgi.el ends here
diff --git a/packages/muse/dir b/packages/muse/dir
deleted file mode 100644
index 22af354..0000000
--- a/packages/muse/dir
+++ /dev/null
@@ -1,18 +0,0 @@
-This is the file .../info/dir, which contains the
-topmost node of the Info hierarchy, called (dir)Top.
-The first time you invoke Info you start off looking at this node.
-
-File: dir,     Node: Top       This is the top of the INFO tree
-
-  This (the Directory node) gives a menu of major topics.
-  Typing "q" exits, "?" lists all Info commands, "d" returns here,
-  "h" gives a primer for first-timers,
-  "mEmacs<Return>" visits the Emacs manual, etc.
-
-  In Emacs, you can click mouse button 2 on a menu item or cross reference
-  to select it.
-
-* Menu:
-
-Emacs
-* Muse: (muse).                 Authoring and publishing environment for Emacs.
diff --git a/packages/muse/htmlize-hack.el b/packages/muse/htmlize-hack.el
deleted file mode 100644
index 61627b6..0000000
--- a/packages/muse/htmlize-hack.el
+++ /dev/null
@@ -1,20 +0,0 @@
-;; This file provides a fix for htmlize.el and Emacs 23.
-;; To use it, add the path to this directory to your load path and
-;; add (require 'htmlize-hack) to your Emacs init file.
-
-(require 'cl)
-(if t (require 'htmlize))               ; Don't load during compilation.
-
-(when (equal htmlize-version "1.34")
-  (defun htmlize-face-size (face)
-    ;; The size (height) of FACE, taking inheritance into account.
-    ;; Only works in Emacs 21 and later.
-    (let ((size-list
-           (loop
-            for f = face then (face-attribute f :inherit)
-            until (or (null f) (eq f 'unspecified))
-            for h = (face-attribute f :height)
-            collect (if (eq h 'unspecified) nil h))))
-      (reduce 'htmlize-merge-size (cons nil size-list)))))
-
-(provide 'htmlize-hack)
diff --git a/packages/muse/httpd.el b/packages/muse/httpd.el
deleted file mode 100644
index 1fb64a4..0000000
--- a/packages/muse/httpd.el
+++ /dev/null
@@ -1,288 +0,0 @@
-;;; httpd.el -- A web server in Emacs Lisp
-
-;; Copyright (C) 2001, 2003, 2006, 2012 Free Software Foundation, Inc.
-
-;; Author: Eric Marsden <emarsden@laas.fr>
-;;         John Wiegley <johnw@gnu.org>
-;;         Michael Olson <mwolson@gnu.org> (slight modifications)
-;; Version: 1.1
-;; Keywords: games
-
-;;     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 3 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.
-;;
-;; The latest version of this package should be available from
-;;
-;;     <URL:http://purl.org/net/emarsden/home/downloads/>
-
-;;; Commentary:
-
-;; httpd.el is an HTTP server embedded in the Emacs.  It can handle GET
-;; and HEAD requests; adding support for POST should not be too
-;; difficult.  By default, httpd.el will listen on server side Emacs
-;; sockets for HTTP requests.
-;;
-;; I have only tested this code with Emacs; it may need modifications
-;; to work with XEmacs.
-;;
-;; This version has been modified to work with GNU Emacs 21 and 22.
-;;
-;;; Acknowledgements:
-;;
-;; httpd.el was inspired by pshttpd, an HTTP server written in
-;; Postscript by Anders Karlsson <URL:http://www.pugo.org:8080/>.
-;;
-;; Thanks to John Wiegley and Cyprian Adam Laskowski.
-
-;;; Code:
-
-(defvar httpd-document-root "/var/www")
-
-(defvar httpd-path-handlers '()
-  "Alist of (path-regexp . handler) forms.
-If a GET request is made for an URL whose path component matches
-a PATH-REGEXP, the corresponding handler is called to generate
-content.")
-
-(defvar httpd-mime-types-alist
-  '(("html" . "text/html; charset=iso-8859-1")
-    ("txt"  . "text/plain; charset=iso-8859-1")
-    ("jpg"  . "image/jpeg")
-    ("jpeg" . "image/jpeg")
-    ("gif"  . "image/gif")
-    ("png"  . "image/png")
-    ("tif"  . "image/tiff")
-    ("tiff" . "image/tiff")
-    ("css"  . "text/css")
-    ("gz"   . "application/octet-stream")
-    ("ps"   . "application/postscript")
-    ("pdf"  . "application/pdf")
-    ("eps"  . "application/postscript")
-    ("tar"  . "application/x-tar")
-    ("rpm"  . "application/x-rpm")
-    ("zip"  . "application/zip")
-    ("mp3"  . "audio/mpeg")
-    ("mp2"  . "audio/mpeg")
-    ("mid"  . "audio/midi")
-    ("midi" . "audio/midi")
-    ("wav"  . "audio/x-wav")
-    ("au"   . "audio/basic")
-    ("ram"  . "audio/pn-realaudio")
-    ("ra"   . "audio/x-realaudio")
-    ("mpg"  . "video/mpeg")
-    ("mpeg" . "video/mpeg")
-    ("qt"   . "video/quicktime")
-    ("mov"  . "video/quicktime")
-    ("avi"  . "video/x-msvideo")))
-
-(defun httpd-mime-type (filename)
-  (or (cdr (assoc (file-name-extension filename) httpd-mime-types-alist))
-      "text/plain"))
-
-(put 'httpd-exception 'error-conditions '(httpd-exception error))
-
-(defun defhttpd-exception (name code msg)
-  (put name 'error-conditions (list name 'httpd-exception 'error))
-  (put name 'httpd-code code)
-  (put name 'httpd-msg msg))
-
-(defhttpd-exception 'httpd-moved/perm       301 "Moved permanently")
-(defhttpd-exception 'httpd-moved/temp       302 "Moved temporarily")
-(defhttpd-exception 'httpd-bad-request      400 "Bad request")
-(defhttpd-exception 'httpd-forbidden        403 "Forbidden")
-(defhttpd-exception 'httpd-file-not-found   404 "Not found")
-(defhttpd-exception 'httpd-method-forbidden 405 "Method not allowed")
-(defhttpd-exception 'httpd-unimplemented    500 "Internal server error")
-(defhttpd-exception 'httpd-unimplemented    501 "Not implemented")
-(defhttpd-exception 'httpd-unimplemented    503 "Service unavailable")
-
-(defvar httpd-endl "\r\n")
-
-(defvar httpd-process nil)
-(defvar httpd-bytes-sent nil)          ; only used with `httpd-process'
-(defvar httpd-log-accesses t)
-
-(defun httpd-add-handler (path-regexp handler)
-  (push (cons path-regexp handler) httpd-path-handlers))
-
-(defun httpd-try-internal-handler (path &optional cont)
-  (catch 'result
-    (dolist (elem httpd-path-handlers)
-      (let ((regexp (car elem))
-           (handler (cdr elem)))
-       (if (string-match regexp path)
-           (throw 'result (funcall handler path cont)))))))
-
-(defun httpd-date-stamp ()
-  (format-time-string "[%d/%b/%Y %H:%M:%S %z]"))
-
-(defun httpd-log (&rest strings)
-  (if httpd-log-accesses
-      (save-excursion
-       (goto-char (point-max))
-       (with-current-buffer (get-buffer-create "*httpd access_log*")
-         (mapc 'insert strings)))))
-
-(defun httpd-send-data (&rest strings)
-  (dolist (s strings)
-    (send-string httpd-process s)
-    (if httpd-bytes-sent
-       (setq httpd-bytes-sent (+ httpd-bytes-sent (length s))))))
-
-(defun httpd-send (code msg &rest strings)
-  (httpd-log (number-to-string code) " ")
-  (apply 'httpd-send-data
-        "HTTP/1.0 " (number-to-string code) " " msg httpd-endl
-        strings))
-
-(defun httpd-send-eof ()
-  (httpd-log (number-to-string httpd-bytes-sent) "\n")
-  (process-send-eof httpd-process))
-
-(defun httpd-send-file (filename)
-  (with-temp-buffer
-    (insert-file-contents filename)
-    (httpd-send-data (buffer-string))))
-
-(defun httpd-lose (code msg)
-  (httpd-send code msg
-             "Content-Type: text/html" httpd-endl
-             "Connection: close" httpd-endl
-             httpd-endl
-             "<html><head><title>Error</title></head>" httpd-endl
-             "<body><h1>" msg "</h1>" httpd-endl
-             "<p>" msg httpd-endl
-             "</body></html>" httpd-endl)
-  (httpd-send-eof))
-
-(defun httpd-handle-redirect (req where)
-  "Redirect the client to new location WHERE."
-  (httpd-send 301 "Moved permanently"
-             "Location: " where httpd-endl
-             "URI: " where httpd-endl
-             "Connection: close" httpd-endl
-             httpd-endl)
-  (httpd-send-eof))
-
-(defun httpd-handle-GET+HEAD (path &optional want-data req)
-  (if (zerop (length path))
-      (setq path "index.html"))
-
-  ;; could use `expand-file-name' here instead of `concat', but we
-  ;; don't want tilde expansion, etc.
-  (let ((filename (concat httpd-document-root "/" path))
-       modified-since)
-    (cond ((httpd-try-internal-handler path) t)
-         ((file-directory-p filename)
-          (httpd-handle-redirect path (concat "http://"; (system-name) "/"
-                                              path "/")))
-         ((file-readable-p filename)
-          (let ((attrs (file-attributes filename)))
-            (if (and (string-match "^If-Modified-Since:\\s-+\\(.+\\)" req)
-                     (setq modified-since
-                           (apply 'encode-time
-                                  (parse-time-string (match-string 1 req))))
-                     (time-less-p (nth 5 attrs) modified-since))
-                  (httpd-send 304 "Not modified"
-                              "Server: Emacs/httpd.el" httpd-endl
-                              "Connection: close" httpd-endl
-                              httpd-endl)
-              (httpd-send 200 "OK"
-                          "Server: Emacs/httpd.el" httpd-endl
-                          "Connection: close" httpd-endl
-                          "MIME-Version: 1.0" httpd-endl
-                          "Content-Type: "
-                          (httpd-mime-type filename) httpd-endl
-                          "Content-Length: "
-                          (number-to-string (nth 7 attrs)) httpd-endl
-                          httpd-endl)
-              (if want-data
-                  (httpd-send-file filename)))
-            (httpd-send-eof)))
-
-         (t (signal 'httpd-file-not-found path)))))
-
-(defun httpd-handle-request (req &optional cont)
-  (httpd-log (car (process-contact httpd-process)) " - - "
-            (httpd-date-stamp) " \"")
-  (if (not (string-match ".+" req))
-      (progn
-       (httpd-log "\"")
-       (error "HTTP request was empty"))
-    (let ((request (match-string 0 req)))
-      (httpd-log request "\" ")
-      (cond
-       ((string-match "\\.\\." request)
-       ;; reject requests containing ".." in the path. Should really
-       ;; URI-decode first.
-       (signal 'httpd-forbidden request))
-
-       ((string-match "\\`\\(GET\\|HEAD\\|POST\\)\\s-/\\(\\S-*\\)" request)
-       (let ((kind (match-string 1 request))
-             (arg  (match-string 2 request)))
-         (if (string= kind "POST")
-             (unless (httpd-try-internal-handler arg cont)
-               (signal 'httpd-unimplemented arg))
-           (httpd-handle-GET+HEAD arg (string= kind "GET") req))))
-
-       (t (signal 'httpd-bad-request request))))))
-
-(defun httpd-serve (proc string)
-  (let ((httpd-process proc)
-       (httpd-bytes-sent 0))
-    (condition-case why
-       (httpd-handle-request string)
-      (httpd-exception
-       (httpd-lose (get (car why) 'httpd-code)
-                  (get (car why) 'httpd-msg)))
-      ;; Comment out these two lines if you want to catch errors
-      ;; inside Emacs itself.
-      (error
-       (httpd-lose 500 (format "Emacs Lisp error: %s" why)))
-      )))
-
-(defun httpd-start (&optional port)
-  (interactive (list (read-string "Serve Web requests on port: " "8080")))
-  (if (null port)
-      (setq port 8080)
-    (if (stringp port)
-       (setq port (string-to-number port))))
-  (if httpd-process
-      (delete-process httpd-process))
-  (setq httpd-process
-       (if (fboundp 'make-network-process)
-           (make-network-process :name "httpd"
-                                 :buffer (generate-new-buffer "httpd")
-                                 :host 'local :service port
-                                 :server t :noquery t
-                                 :filter 'httpd-serve)
-         (and (fboundp 'open-network-stream-server)
-              (open-network-stream-server "httpd"
-                                          (generate-new-buffer "httpd")
-                                          port nil 'httpd-serve))))
-  (if (and (processp httpd-process)
-          (eq (process-status httpd-process) 'listen))
-      (message "httpd.el is listening on port %d" port)))
-
-(defun httpd-stop ()
-  (interactive)
-  (when httpd-process
-    (message "httpd.el server on port %d has stopped"
-            (cadr (process-contact httpd-process)))
-    (delete-process httpd-process)
-    (setq httpd-process nil)))
-
-(provide 'httpd)
-;;; httpd.el ends here
diff --git a/packages/muse/muse-backlink.el b/packages/muse/muse-backlink.el
deleted file mode 100644
index 76c0c9c..0000000
--- a/packages/muse/muse-backlink.el
+++ /dev/null
@@ -1,327 +0,0 @@
-;;; muse-backlink.el --- backlinks for Muse
-
-;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2014
-;;   Free Software Foundation, Inc.
-
-;; Author: Jim Ottaway <j.ottaway@lse.ac.uk>
-;; Keywords:
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; Hierarchical backlink insertion into new muse pages.
-;;
-;; To add:
-;;
-;; (require 'muse-backlink)
-;; (muse-backlink-install)
-;;
-;; To control what gets backlinked, modify
-;; `muse-backlink-exclude-backlink-regexp' and
-;; `muse-backlink-exclude-backlink-parent-regexp'.
-;;
-;; To stop backlinking temporarily:
-;; (setq muse-backlink-create-backlinks nil)
-;;
-;; To remove the backlink functionality completely:
-;;
-;; (muse-backlink-remove)
-
-;;; Contributors:
-
-;;; Code:
-
-(require 'muse)
-(require 'muse-project)
-
-(eval-when-compile (require 'muse-mode))
-
-(eval-and-compile
-  (if (< emacs-major-version 22)
-      (progn
-        ;; Swiped from Emacs 22.0.50.4
-        (defvar muse-backlink-split-string-default-separators "[ \f\t\n\r\v]+"
-        "The default value of separators for `split-string'.
-
-A regexp matching strings of whitespace.  May be locale-dependent
-\(as yet unimplemented).  Should not match non-breaking spaces.
-
-Warning: binding this to a different value and using it as default is
-likely to have undesired semantics.")
-
-        (defun muse-backlink-split-string (string &optional separators 
omit-nulls)
-        "Split STRING into substrings bounded by matches for SEPARATORS.
-
-The beginning and end of STRING, and each match for SEPARATORS, are
-splitting points.  The substrings matching SEPARATORS are removed, and
-the substrings between the splitting points are collected as a list,
-which is returned.
-
-If SEPARATORS is non-nil, it should be a regular expression matching text
-which separates, but is not part of, the substrings.  If nil it defaults to
-`split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and
-OMIT-NULLS is forced to t.
-
-If OMIT-NULLS is t, zero-length substrings are omitted from the list \(so
-that for the default value of SEPARATORS leading and trailing whitespace
-are effectively trimmed).  If nil, all zero-length substrings are retained,
-which correctly parses CSV format, for example.
-
-Note that the effect of (split-string STRING) is the same as
-(split-string STRING split-string-default-separators t).  In the rare
-case that you wish to retain zero-length substrings when splitting on
-whitespace, use (split-string STRING split-string-default-separators).
-
-Modifies the match data; use `save-match-data' if necessary."
-        (let ((keep-nulls (not (if separators omit-nulls t)))
-              (rexp (or separators 
muse-backlink-split-string-default-separators))
-              (start 0)
-              notfirst
-              (list nil))
-          (while (and (string-match rexp string
-                                    (if (and notfirst
-                                             (= start (match-beginning 0))
-                                             (< start (length string)))
-                                        (1+ start) start))
-                      (< start (length string)))
-            (setq notfirst t)
-            (if (or keep-nulls (< start (match-beginning 0)))
-                (setq list
-                      (cons (substring string start (match-beginning 0))
-                            list)))
-            (setq start (match-end 0)))
-          (if (or keep-nulls (< start (length string)))
-              (setq list
-                    (cons (substring string start)
-                          list)))
-          (nreverse list))))
-    (defalias 'muse-backlink-split-string 'split-string)))
-
-(defgroup muse-backlink nil
-  "Hierarchical backlinking for Muse."
-  :group 'muse)
-
-(defcustom muse-backlink-create-backlinks t
-  "When non-nil, create hierarchical backlinks in new Muse pages.
-For control over which pages will receive backlinks, see
-`muse-backlink-exclude-backlink-parent-regexp' and
-`muse-backlink-exclude-backlink-regexp'."
-  :type 'boolean
-  :group 'muse-backlink)
-
-(defcustom muse-backlink-avoid-bad-links t
-  "When non-nil, avoid bad links when backlinking."
-  :type 'boolean
-  :group 'muse-backlink)
-
-;; The default for exclusion stops backlinks from being added to and
-;; from planner day pages.
-(defcustom muse-backlink-exclude-backlink-parent-regexp
-  "^[0-9][0-9][0-9][0-9]\\.[0-9][0-9]\\.[0-9][0-9]$"
-  "Regular expression matching pages whose children should not have backlinks."
-  :type 'regexp
-  :group 'muse-backlink)
-
-(defcustom muse-backlink-exclude-backlink-regexp
-  "^[0-9][0-9][0-9][0-9]\\.[0-9][0-9]\\.[0-9][0-9]$"
-  "Regular expression matching pages that should not have backlinks."
-  :type 'regexp
-  :group 'muse-backlink)
-
-(defcustom muse-backlink-separator "/"
-  "String that separates backlinks.
-Should be something that will not appear as a substring in an explicit
-link that has no description."
-  :type 'string
-  :group 'muse-backlink)
-
-(defcustom muse-backlink-before-string "backlinks: "
-  "String to come before the backlink list."
-  :type 'string
-  :group 'muse-backlink)
-
-(defcustom muse-backlink-after-string ""
-  "String to come after the backlink list."
-  :type 'string
-  :group 'muse-backlink)
-
-(defcustom muse-backlink-separator "/"
-  "String that separates backlinks.
-Should be something that will not appear as a substring in an explicit
-link that has no description."
-  :type 'string
-  :group 'muse-backlink)
-
-(defcustom muse-backlink-regexp
-  (concat "^"
-          (regexp-quote muse-backlink-before-string)
-          "\\("
-          (regexp-quote muse-backlink-separator)
-          ".+\\)"
-          (regexp-quote muse-backlink-after-string))
-  ;; Really, I want something like this, but I can't make it work:
-  ;;   (concat "^\\("
-  ;;           (regexp-quote muse-backlink-separator)
-  ;;           "\\(?:"
-  ;;           muse-explicit-link-regexp
-  ;;           "\\)\\)+")
-  "Regular expression to match backlinks in a buffer.
-Match 1 is the list of backlinks without `muse-backlink-before-string'
-and `muse-backlink-after-string'."
-  :type 'regexp
-  :group 'muse-backlink)
-
-(defun muse-backlink-goto-insertion-point ()
-  "Find the right place to add backlinks."
-  (goto-char (point-min))
-  (when (looking-at "\\(?:^#.+[ \t]*\n\\)+")
-    (goto-char (match-end 0))))
-
-(defun muse-backlink-get-current ()
-  "Return a list of backlinks in the current buffer."
-  (save-excursion
-    (goto-char (point-min))
-    (when (re-search-forward muse-backlink-regexp nil t)
-      (muse-backlink-split-string
-       (match-string 1)
-       (regexp-quote muse-backlink-separator) t))))
-
-(defun muse-backlink-format-link-list (links)
-  "Format the list of LINKS as backlinks."
-  (concat muse-backlink-separator
-          (mapconcat #'identity links muse-backlink-separator)))
-
-(defun muse-backlink-insert-links (links)
-  "Insert backlinks to LINKS into the current page.
-LINKS is a list of links ordered by ancestry, with the parent as the
-last element."
-  (muse-backlink-goto-insertion-point)
-  (insert muse-backlink-before-string
-          (muse-backlink-format-link-list links)
-          muse-backlink-after-string
-          ;; Could have this in the after string, but they might get
-          ;; deleted.
-          "\n\n"))
-
-(defun muse-backlink-unsaved-page-p (page project)
-  "Return non-nil if PAGE is in PROJECT but has not been saved."
-  (member
-   page
-   (mapcar
-    #'(lambda (b)
-        (with-current-buffer b
-          (and (derived-mode-p 'muse-mode)
-               (equal muse-current-project project)
-               (not (muse-project-page-file
-                     (muse-page-name)
-                     muse-current-project))
-               (muse-page-name))))
-    (buffer-list))))
-
-(defvar muse-backlink-links nil
-  "Internal variable.
-The links to insert in the forthcomingly visited muse page.")
-
-(defvar muse-backlink-pending nil
-  "Internal variable.")
-
-(defvar muse-backlink-parent-buffer nil
-  "Internal variable.
-The parent buffer of the forthcomingly visited muse page.")
-
-
-;;; Attach hook to the derived mode hook, to avoid problems such as
-;;; planner-prepare-file thinking that the buffer needs no template.
-(defun muse-backlink-get-mode-hook ()
-  (derived-mode-hook-name major-mode))
-
-(defun muse-backlink-insert-hook-func ()
-  "Insert backlinks into the current buffer and clean up."
-  (when (and muse-backlink-links
-             muse-backlink-pending
-             (string= (car muse-backlink-links) (muse-page-name)))
-    (muse-backlink-insert-links (cdr muse-backlink-links))
-    (when muse-backlink-avoid-bad-links
-      (save-buffer)
-      (when muse-backlink-parent-buffer
-        (with-current-buffer muse-backlink-parent-buffer
-          (font-lock-fontify-buffer)))) ;FIXME: Why?  --Stef
-    (setq muse-backlink-links nil
-          muse-backlink-parent-buffer nil
-          muse-backlink-pending nil)
-    (remove-hook (muse-backlink-get-mode-hook) 
#'muse-backlink-insert-hook-func)))
-
-(defun muse-backlink-handle-link (link)
-  "When appropriate, arrange for backlinks on visiting LINK."
-  (when (and muse-backlink-create-backlinks
-             (not muse-backlink-pending)
-             (memq this-command
-                   '(muse-follow-name-at-point muse-follow-name-at-mouse))
-             (not muse-publishing-p)
-             (not (and (boundp 'muse-colors-fontifying-p)
-                       muse-colors-fontifying-p)))
-    (require 'muse-mode)
-    (setq
-     muse-backlink-links
-     (save-match-data
-       (let* ((orig-link (or link (match-string 1)))
-              (link (if (string-match "#" orig-link)
-                        (substring orig-link 0 (match-beginning 0))
-                      orig-link)))
-         (unless
-             (or (not muse-current-project)
-                 (string-match muse-url-regexp orig-link)
-                 (string-match muse-image-regexp orig-link)
-                 (and (boundp 'muse-wiki-interwiki-regexp)
-                      (string-match muse-wiki-interwiki-regexp
-                                    orig-link))
-                 ;; Don't add a backlink if the page already
-                 ;; exists, whether it has been saved or not.
-                 (or (muse-project-page-file link muse-current-project)
-                     (muse-backlink-unsaved-page-p link muse-current-project))
-                 (string-match muse-backlink-exclude-backlink-parent-regexp
-                               (muse-page-name))
-                 (string-match muse-backlink-exclude-backlink-regexp link))
-           ;; todo: Hmm. This will only work if the child page is the
-           ;; same mode as the parent page.
-           (add-hook (muse-backlink-get-mode-hook) 
#'muse-backlink-insert-hook-func)
-           (setq muse-backlink-pending t)
-           (when muse-backlink-avoid-bad-links
-             (setq muse-backlink-parent-buffer (current-buffer))
-             (unless (muse-project-page-file
-                      (muse-page-name) muse-current-project)
-               ;; It must be modified...
-               (save-buffer)))
-           (cons link
-                 (append (muse-backlink-get-current)
-                         (list (muse-make-link (muse-page-name))))))))))
-  ;; Make sure we always return nil
-  nil)
-
-(defun muse-backlink-install ()
-  "Add backlinking functionality to muse-mode."
-  (add-to-list 'muse-explicit-link-functions #'muse-backlink-handle-link))
-
-(defun muse-backlink-remove ()
-  "Remove backlinking functionality from muse-mode."
-  (setq muse-explicit-link-functions
-        (delq #'muse-backlink-handle-link muse-explicit-link-functions)))
-
-(provide 'muse-backlink)
-;;; muse-backlink.el ends here
diff --git a/packages/muse/muse-blosxom.el b/packages/muse/muse-blosxom.el
deleted file mode 100644
index d7bce9c..0000000
--- a/packages/muse/muse-blosxom.el
+++ /dev/null
@@ -1,307 +0,0 @@
-;;; muse-blosxom.el --- publish a document tree for serving by (py)Blosxom
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2014
-;;   Free Software Foundation, Inc.
-
-;; Author: Michael Olson <mwolson@gnu.org>
-;; Date: Wed, 23 March 2005
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; The Blosxom publishing style publishes a tree of categorised files
-;; to a mirrored tree of stories to be served by blosxom.cgi or
-;; pyblosxom.cgi.
-;;
-;; Serving entries with (py)blosxom
-;; --------------------------------
-;;
-;; Each Blosxom file must include `#date yyyy-mm-dd', or optionally
-;; the longer `#date yyyy-mm-dd-hh-mm', a title (using the `#title'
-;; directive) plus whatever normal content is desired.
-;;
-;; The date directive is not used directly by (py)blosxom or this
-;; program.  You need to find two additional items to make use of this
-;; feature.
-;;
-;;  1. A script to gather date directives from the entire blog tree
-;;     into a single file.  The file must associate a blog entry with
-;;     a date.
-;;
-;;  2. A plugin for (py)blosxom that reads this file.
-;;
-;; These 2 things are provided for pyblosxom in the contrib/pyblosxom
-;; subdirectory.  `getstamps.py' provides the 1st service, while
-;; `hardcodedates.py' provides the second service.  Eventually it is
-;; hoped that a blosxom plugin and script will be found/written.
-;;
-;; Alternately, the pyblosxom metadate plugin may be used.  On the
-;; plus side, there is no need to run a script to gather the date.  On
-;; the downside, each entry is read twice rather than once when the
-;; page is rendered.  Set the value of muse-blosxom-use-metadate to
-;; non-nil to enable adding a #postdate directive to all published
-;; files.  You can do this by:
-;;
-;; M-x customize-variable RET muse-blosxom-use-metadate RET
-;;
-;; With the metadate plugin installed in pyblosxom, the date set in
-;; this directive will be used instead of the file's modification
-;; time.  The plugin is included with Muse at
-;; contrib/pyblosxom/metadate.py.
-;;
-;; Generating a Muse project entry
-;; -------------------------------
-;;
-;; Muse-blosxom has some helper functions to make specifying
-;; muse-blosxom projects a lot easier.  An example follows.
-;;
-;; (setq muse-project-alist
-;;       `(("blog"
-;;          (,@(muse-project-alist-dirs "~/path/to/blog-entries")
-;;           :default "index")
-;;          ,@(muse-project-alist-styles "~/path/to/blog-entries"
-;;                                       "~/public_html/blog"
-;;                                       "blosxom-xhtml")
-;;         )))
-;;
-;; Note that we need a backtick instead of a single quote on the
-;; second line of this example.
-;;
-;; Creating new blog entries
-;; -------------------------
-;;
-;; There is a function called `muse-blosxom-new-entry' that will
-;; automate the process of making a new blog entry.  To make use of
-;; it, do the following.
-;;
-;;  - Customize `muse-blosxom-base-directory' to the location that
-;;    your blog entries are stored.
-;;
-;;  - Assign the `muse-blosxom-new-entry' function to a key sequence.
-;;    I use the following code to assign this function to `C-c p l'.
-;;
-;;    (global-set-key "\C-cpl" 'muse-blosxom-new-entry)
-;;
-;;  - You should create your directory structure ahead of time under
-;;    your base directory.  These directories, which correspond with
-;;    category names, may be nested.
-;;
-;;  - When you enter this key sequence, you will be prompted for the
-;;    category of your entry and its title.  Upon entering this
-;;    information, a new file will be created that corresponds with
-;;    the title, but in lowercase letters and having special
-;;    characters converted to underscores.  The title and date
-;;    directives will be inserted automatically.
-;;
-;; Using tags
-;; ----------
-;;
-;; If you wish to keep all of your blog entries in one directory and
-;; use tags to classify your entries, set `muse-blosxom-use-tags' to
-;; non-nil.
-;;
-;; For this to work, you will need to be using the PyBlosxom plugin at
-;; http://pyblosxom.sourceforge.net/blog/registry/meta/Tags.
-
-;;; Contributors:
-
-;; Gary Vaughan (gary AT gnu DOT org) is the original author of
-;; `emacs-wiki-blosxom.el', which is the ancestor of this file.
-
-;; Brad Collins (brad AT chenla DOT org) ported this file to Muse.
-
-;; Björn Lindström (bkhl AT elektrubadur DOT se) made many valuable
-;; suggestions.
-
-;; Sasha Kovar (sasha AT arcocene DOT org) fixed
-;; muse-blosxom-new-entry when using tags and also implemented support
-;; for the #postdate directive.
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse Blosxom Publishing
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-project)
-(require 'muse-publish)
-(require 'muse-html)
-
-(defgroup muse-blosxom nil
-  "Options controlling the behavior of Muse Blosxom publishing.
-See `muse-blosxom' for more information."
-  :group 'muse-publish)
-
-(defcustom muse-blosxom-extension ".txt"
-  "Default file extension for publishing Blosxom files."
-  :type 'string
-  :group 'muse-blosxom)
-
-(defcustom muse-blosxom-header
-  "<lisp>(concat (muse-publishing-directive \"title\") \"\\n\"
-  (when muse-blosxom-use-metadate
-    (let ((date (muse-publishing-directive \"date\")))
-      (when date (concat \"#postdate \"
-                         (muse-blosxom-format-date date) \"\\n\"))))
-  (when muse-blosxom-use-tags
-    (let ((tags (muse-publishing-directive \"tags\")))
-      (when tags (concat \"#tags \" tags \"\\n\")))))</lisp>"
-  "Header used for publishing Blosxom files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-blosxom)
-
-(defcustom muse-blosxom-footer ""
-  "Footer used for publishing Blosxom files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-blosxom)
-
-(defcustom muse-blosxom-base-directory "~/Blog"
-  "Base directory of blog entries.
-This is the top-level directory where your Muse blog entries may be found."
-  :type 'directory
-  :group 'muse-blosxom)
-
-(defcustom muse-blosxom-use-tags nil
-  "Determine whether or not to enable use of the #tags directive.
-
-If you wish to keep all of your blog entries in one directory and
-use tags to classify your entries, set `muse-blosxom-use-tags' to
-non-nil.
-
-For this to work, you will need to be using the PyBlosxom plugin
-at http://pyblosxom.sourceforge.net/blog/registry/meta/Tags.";
-  :type 'boolean
-  :group 'muse-blosxom)
-
-(defcustom muse-blosxom-use-metadate nil
-  "Determine whether or not to use the #postdate directive.
-
-If non-nil, published entries include the original date (as specified
-in the muse #date line) which can be read by the metadate PyBlosxom
-plugin.
-
-For this to work, you will need to be using the PyBlosxom plugin
-at http://pyblosxom.sourceforge.net/blog/registry/date/metadate.";
-  :type 'boolean
-  :group 'muse-blosxom)
-
-;; Maintain (published-file . date) alist, which will later be written
-;; to a timestamps file; not implemented yet.
-
-(defvar muse-blosxom-page-date-alist nil)
-
-(defun muse-blosxom-update-page-date-alist ()
-  "Add a date entry to `muse-blosxom-page-date-alist' for this page."
-  (when muse-publishing-current-file
-    ;; Make current file be relative to base directory
-    (let ((rel-file
-           (concat
-            (file-name-as-directory
-             (or (muse-publishing-directive "category")
-                 (file-relative-name
-                  (file-name-directory
-                   (expand-file-name muse-publishing-current-file))
-                  (file-truename muse-blosxom-base-directory))))
-            (file-name-nondirectory muse-publishing-current-file))))
-      ;; Strip the file extension
-      (when muse-ignored-extensions-regexp
-        (setq rel-file (save-match-data
-                         (and (string-match muse-ignored-extensions-regexp
-                                            rel-file)
-                              (replace-match "" t t rel-file)))))
-      ;; Add to page-date alist
-      (add-to-list
-       'muse-blosxom-page-date-alist
-       `(,rel-file . ,(muse-publishing-directive "date"))))))
-
-;; Enter a new blog entry
-
-(defun muse-blosxom-title-to-file (title)
-  "Derive a file name from the given TITLE.
-
-Feel free to overwrite this if you have a different concept of what
-should be allowed in a filename."
-  (muse-replace-regexp-in-string (concat "[^-." muse-regexp-alnum "]")
-                                 "_" (downcase title)))
-
-(defun muse-blosxom-format-date (date)
-  "Convert a date string to PyBlosxom metadate plugin format."
-  (apply #'format "%s-%s-%s %s:%s" (split-string date "-")))
-
-;;;###autoload
-(defun muse-blosxom-new-entry (category title)
-  "Start a new blog entry with given CATEGORY.
-The filename of the blog entry is derived from TITLE.
-The page will be initialized with the current date and TITLE."
-  (interactive
-   (list
-    (if muse-blosxom-use-tags
-        (let ((tag "foo")
-              (tags nil))
-          (while (progn (setq tag (read-string "Tag (RET to continue): "))
-                        (not (string= tag "")))
-            (unless (member tag tags)
-              (setq tags (append tags (list tag)))))
-          tags)
-      (funcall muse-completing-read-function
-               "Category: "
-               (mapcar 'list (muse-project-recurse-directory
-                              muse-blosxom-base-directory))))
-    (read-string "Title: ")))
-  (let ((file (muse-blosxom-title-to-file title)))
-    (muse-project-find-file
-     file "blosxom" nil
-     (if muse-blosxom-use-tags
-         (directory-file-name muse-blosxom-base-directory)
-       (concat (directory-file-name muse-blosxom-base-directory)
-               "/" category))))
-  (goto-char (point-min))
-  (insert "#date " (format-time-string "%Y-%m-%d-%H-%M")
-          "\n#title " title)
-  (if muse-blosxom-use-tags
-      (if (> (length category) 0)
-          (insert (concat "\n#tags " (mapconcat #'identity category ","))))
-    (unless (string= category "")
-      (insert (concat "\n#category " category))))
-  (insert "\n\n")
-  (forward-line 2))
-
-;;; Register the Muse Blosxom Publisher
-
-(muse-derive-style "blosxom-html" "html"
-                   :suffix    'muse-blosxom-extension
-                   :link-suffix 'muse-html-extension
-                   :header    'muse-blosxom-header
-                   :footer    'muse-blosxom-footer
-                   :after     'muse-blosxom-update-page-date-alist
-                   :browser   'find-file)
-
-(muse-derive-style "blosxom-xhtml" "xhtml"
-                   :suffix    'muse-blosxom-extension
-                   :link-suffix 'muse-xhtml-extension
-                   :header    'muse-blosxom-header
-                   :footer    'muse-blosxom-footer
-                   :after     'muse-blosxom-update-page-date-alist
-                   :browser   'find-file)
-
-(provide 'muse-blosxom)
-
-;;; muse-blosxom.el ends here
diff --git a/packages/muse/muse-book.el b/packages/muse/muse-book.el
deleted file mode 100644
index 213a64e..0000000
--- a/packages/muse/muse-book.el
+++ /dev/null
@@ -1,284 +0,0 @@
-;;; muse-book.el --- publish entries into a compilation
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse Book Publishing
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-publish)
-(require 'muse-project)
-(require 'muse-latex)
-(require 'muse-regexps)
-
-(defgroup muse-book nil
-  "Module for publishing a series of Muse pages as a complete book.
-Each page will become a separate chapter in the book, unless the
-style keyword :nochapters is used, in which case they are all run
-together as if one giant chapter."
-  :group 'muse-publish)
-
-(defcustom muse-book-before-publish-hook nil
-  "A hook run in the book buffer before it is marked up."
-  :type 'hook
-  :group 'muse-book)
-
-(defcustom muse-book-after-publish-hook nil
-  "A hook run in the book buffer after it is marked up."
-  :type 'hook
-  :group 'muse-book)
-
-(defcustom muse-book-latex-header
-  "\\documentclass{book}
-
-\\usepackage[english]{babel}
-\\usepackage[latin1]{inputenc}
-\\usepackage[T1]{fontenc}
-
-\\begin{document}
-
-\\title{<lisp>(muse-publishing-directive \"title\")</lisp>}
-\\author{<lisp>(muse-publishing-directive \"author\")</lisp>}
-\\date{<lisp>(muse-publishing-directive \"date\")</lisp>}
-
-\\maketitle
-
-\\tableofcontents\n"
-  "Header used for publishing books to LaTeX.  This may be text or a filename."
-  :type 'string
-  :group 'muse-book)
-
-(defcustom muse-book-latex-footer
-  "<lisp>(muse-latex-bibliography)</lisp>
-\\end{document}"
-  "Footer used for publishing books to LaTeX.  This may be text or a filename."
-  :type 'string
-  :group 'muse-book)
-
-(defun muse-book-publish-chapter (title entry style &optional nochapters)
-  "Publish the chapter TITLE for the file ENTRY using STYLE.
-TITLE is a string, ENTRY is a cons of the form (PAGE-NAME .
-FILE), and STYLE is a Muse style list.
-
-This routine does the same basic work as `muse-publish-markup-buffer',
-but treating the page as if it were a single chapter within a book."
-  (let ((muse-publishing-directives (list (cons "title" title)))
-        (muse-publishing-current-file (cdr entry))
-        (beg (point)) end)
-    (muse-insert-file-contents (cdr entry))
-    (setq end (copy-marker (point-max) t))
-    (muse-publish-markup-region beg end (car entry) style)
-    (goto-char beg)
-    (unless (or nochapters
-                (muse-style-element :nochapters style))
-      (insert "\n")
-      (muse-insert-markup (muse-markup-text 'chapter))
-      (insert (let ((chap (muse-publishing-directive "title")))
-                (if (string= chap title)
-                    (car entry)
-                  chap)))
-      (muse-insert-markup (muse-markup-text 'chapter-end))
-      (insert "\n\n"))
-    (save-restriction
-      (narrow-to-region beg end)
-      (muse-publish-markup (or title "")
-                           '((100 "<\\(lisp\\)>" 0
-                              muse-publish-markup-tag)))
-      (muse-style-run-hooks :after style))
-    (goto-char end)))
-
-(defun muse-book-publish-p (project target)
-  "Determine whether the book in PROJECT is out-of-date."
-  (let ((pats (cadr project)))
-    (catch 'publish
-      (while pats
-        (if (symbolp (car pats))
-            (if (eq :book-end (car pats))
-                (throw 'publish nil)
-              ;; skip past symbol-value pair
-              (setq pats (cddr pats)))
-          (dolist (entry (muse-project-file-entries (car pats)))
-            (when (and (not (muse-project-private-p (cdr entry)))
-                       (file-newer-than-file-p (cdr entry) target))
-              (throw 'publish t)))
-          (setq pats (cdr pats)))))))
-
-(defun muse-book-get-directives (file)
-  "Interpret any publishing directives contained in FILE.
-This is meant to be called in a temp buffer that will later be
-used for publishing."
-  (save-restriction
-    (narrow-to-region (point) (point))
-    (unwind-protect
-        (progn
-          (muse-insert-file-contents file)
-          (muse-publish-markup
-           "attributes"
-           `(;; Remove leading and trailing whitespace from the file
-             (100 "\\(\\`\n+\\|\n+\\'\\)" 0 "")
-             ;; Remove trailing whitespace from all lines
-             (200 ,(concat "[" muse-regexp-blank "]+$") 0 "")
-             ;; Handle any leading #directives
-             (300 "\\`#\\([a-zA-Z-]+\\)\\s-+\\(.+\\)\n+"
-                  0 muse-publish-markup-directive))))
-      (delete-region (point-min) (point-max)))))
-
-(defun muse-book-publish-project
-  (project book title style &optional output-dir force)
-  "Publish PROJECT under the name BOOK with the given TITLE and STYLE.
-BOOK should be a page name, i.e., letting the style determine the
-prefix and/or suffix.  The book is published to OUTPUT-DIR.  If FORCE
-is nil, the book is only published if at least one of its component
-pages has changed since it was last published."
-  (interactive
-   (let ((project (muse-read-project "Publish project as book: " nil t)))
-     (append (list project
-                   (read-string "Basename of book (without extension): ")
-                   (read-string "Title of book: "))
-             (muse-publish-get-info))))
-  (setq project (muse-project project))
-  (let ((muse-current-project project))
-    ;; See if any of the project's files need saving first
-    (muse-project-save-buffers project)
-    ;; Publish the book
-    (muse-book-publish book style output-dir force title)))
-
-(defun muse-book-publish (file style &optional output-dir force title)
-  "Publish FILE as a book with the given TITLE and STYLE.
-The book is published to OUTPUT-DIR.  If FORCE is nil, the book
-is only published if at least one of its component pages has
-changed since it was last published."
-  ;; Cleanup some of the arguments
-  (let ((style-name style))
-    (setq style (muse-style style))
-    (unless style
-      (error "There is no style '%s' defined" style-name)))
-  ;; Publish each page in the project as a chapter in one large book
-  (let* ((output-path (muse-publish-output-file file output-dir style))
-         (output-suffix (muse-style-element :osuffix style))
-         (target output-path)
-         (project muse-current-project)
-         (published nil))
-    (when output-suffix
-      (setq target (concat (muse-path-sans-extension target)
-                           output-suffix)))
-    ;; Unless force is non-nil, determine if the book needs publishing
-    (if (and (not force)
-             (not (muse-book-publish-p project target)))
-        (message "The book \"%s\" is up-to-date." file)
-      ;; Create the book from all its component parts
-      (muse-with-temp-buffer
-        (let ((style-final  (muse-style-element :final  style t))
-              (style-header (muse-style-element :header style))
-              (style-footer (muse-style-element :footer style))
-              (muse-publishing-current-style style)
-              (muse-publishing-directives
-               (list (cons "title" (or title (muse-page-name file)))
-                     (cons "date" (format-time-string "%B %e, %Y"))))
-              (muse-publishing-p t)
-              (muse-current-project project)
-              (pats (cadr project))
-              (nochapters nil))
-          (run-hooks 'muse-before-book-publish-hook)
-          (let ((style-final style-final)
-                (style-header style-header)
-                (style-footer style-footer))
-            (unless title
-              (muse-book-get-directives file)
-              (setq title (muse-publishing-directive "title")))
-            (while pats
-              (if (symbolp (car pats))
-                  (cond
-                   ((eq :book-part (car pats))
-                    (insert "\n")
-                    (muse-insert-markup (muse-markup-text 'part))
-                    (insert (cadr pats))
-                    (muse-insert-markup (muse-markup-text 'part-end))
-                    (insert "\n")
-                    (setq pats (cddr pats)))
-                   ((eq :book-chapter (car pats))
-                    (insert "\n")
-                    (muse-insert-markup (muse-markup-text 'chapter))
-                    (insert (cadr pats))
-                    (muse-insert-markup (muse-markup-text 'chapter-end))
-                    (insert "\n")
-                    (setq pats (cddr pats)))
-                   ((eq :nochapters (car pats))
-                    (setq nochapters t
-                          pats (cddr pats)))
-                   ((eq :book-style (car pats))
-                    (setq style (muse-style (cadr pats)))
-                    (setq style-final  (muse-style-element :final  style t)
-                          style-header (muse-style-element :header style)
-                          style-footer (muse-style-element :footer style)
-                          muse-publishing-current-style style)
-                    (setq pats (cddr pats)))
-                   ((eq :book-funcall (car pats))
-                    (funcall (cadr pats))
-                    (setq pats (cddr pats)))
-                   ((eq :book-end (car pats))
-                    (setq pats nil))
-                   (t
-                    (setq pats (cddr pats))))
-                (let ((entries (muse-project-file-entries (car pats))))
-                  (while (and entries (car entries) (caar entries))
-                    (unless (muse-project-private-p (cdar entries))
-                      (muse-book-publish-chapter title (car entries)
-                                                 style nochapters)
-                      (setq published t))
-                    (setq entries (cdr entries))))
-                (setq pats (cdr pats)))))
-          (goto-char (point-min))
-          (if style-header (muse-insert-file-or-string style-header file))
-          (goto-char (point-max))
-          (if style-footer (muse-insert-file-or-string style-footer file))
-          (run-hooks 'muse-after-book-publish-hook)
-          (if (muse-write-file output-path)
-              (if style-final
-                  (funcall style-final file output-path target))
-            (setq published nil)))))
-    (if published
-        (message "The book \"%s\" has been published." file))
-    published))
-
-;;; Register the Muse BOOK Publishers
-
-(muse-derive-style "book-latex" "latex"
-                   :header 'muse-book-latex-header
-                   :footer 'muse-book-latex-footer
-                   :publish 'muse-book-publish)
-
-(muse-derive-style "book-pdf" "pdf"
-                   :header 'muse-book-latex-header
-                   :footer 'muse-book-latex-footer
-                   :publish 'muse-book-publish)
-
-(provide 'muse-book)
-
-;;; muse-book.el ends here
diff --git a/packages/muse/muse-colors.el b/packages/muse/muse-colors.el
deleted file mode 100644
index 401ed94..0000000
--- a/packages/muse/muse-colors.el
+++ /dev/null
@@ -1,1019 +0,0 @@
-;;; muse-colors.el --- coloring and highlighting used by Muse
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; Author: John Wiegley (johnw AT gnu DOT org)
-;; Keywords: hypermedia
-;; Date: Thu 11-Mar-2004
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;; Lan Yufeng (nlany DOT web AT gmail DOT com) found an error where
-;; headings were being given the wrong face, contributing a patch to
-;; fix this.
-
-;; Sergey Vlasov (vsu AT altlinux DOT ru) fixed an issue with coloring
-;; links that are in consecutive lines.
-
-;; Jim Ottaway ported the <lisp> tag from emacs-wiki.
-
-;; Per B. Sederberg (per AT med DOT upenn DOT edu) contributed the
-;; viewing of inline images.
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Emacs Muse Highlighting
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-mode)
-(require 'muse-regexps)
-(require 'font-lock)
-
-(defgroup muse-colors nil
-  "Options controlling the behavior of Emacs Muse highlighting.
-See `muse-colors-buffer' for more information."
-  :group 'muse-mode)
-
-(defcustom muse-colors-autogen-headings t
-  "Specify whether the heading faces should be auto-generated.
-The default is to scale them.
-
-Choosing `outline' will copy the colors from the outline-mode
-headings.
-
-If you want to customize each of the headings individually, set
-this to nil."
-  :type '(choice (const :tag "Default (scaled) headings" t)
-                 (const :tag "Use outline-mode headings" outline)
-                 (const :tag "Don't touch the headings" nil))
-  :group 'muse-colors)
-
-(defcustom muse-colors-evaluate-lisp-tags t
-  "Specify whether to evaluate the contents of <lisp> tags at
-display time.  If nil, don't evaluate them.  If non-nil, evaluate
-them.
-
-The actual contents of the buffer are not changed, only the
-displayed text."
-  :type 'boolean
-  :group 'muse-colors)
-
-(defcustom muse-colors-inline-images t
-  "Specify whether to inline images inside the Emacs buffer.  If
-nil, don't inline them.  If non-nil, an image link will be
-replaced by the image.
-
-The actual contents of the buffer are not changed, only whether
-an image is displayed."
-  :type 'boolean
-  :group 'muse-colors)
-
-(defcustom muse-colors-inline-image-method 'default-directory
-  "Determine how to locate inline images.
-Setting this to 'default-directory uses the current directory of
-the current Muse buffer.
-
-Setting this to a function calls that function with the filename
-of the image to be inlined.  The value that is returned will be
-used as the filename of the image."
-  :type '(choice (const :tag "Current directory" default-directory)
-                 (const :tag "Publishing directory"
-                        muse-colors-use-publishing-directory)
-                 (function :tag "Custom function"))
-  :group 'muse-colors)
-
-(defvar muse-colors-region-end nil
-  "Indicate the end of the region that is currently being font-locked.")
-(make-variable-buffer-local 'muse-colors-region-end)
-
-;;;###autoload
-(defun muse-colors-toggle-inline-images ()
-  "Toggle display of inlined images on/off."
-  (interactive)
-  ;; toggle the custom setting
-  (if (not muse-colors-inline-images)
-      (setq muse-colors-inline-images t)
-    (setq muse-colors-inline-images nil))
-  ;; reprocess the buffer
-  (muse-colors-buffer)
-  ;; display informative message
-  (if muse-colors-inline-images
-      (message "Images are now displayed inline")
-    (message "Images are now displayed as links")))
-
-(defvar muse-colors-outline-faces-list
-  (if (facep 'outline-1)
-      '(outline-1 outline-2 outline-3 outline-4 outline-5)
-    ;; these are equivalent in coloring to the outline faces
-    '(font-lock-function-name-face
-      font-lock-variable-name-face
-      font-lock-keyword-face
-      font-lock-builtin-face
-      font-lock-comment-face))
-  "Outline faces to use when assigning Muse header faces.")
-
-(defun muse-make-faces-default (&optional later)
-  "Generate the default face definitions for headers."
-  (dolist (num '(1 2 3 4 5))
-    (let ((newsym (intern (concat "muse-header-" (int-to-string num))))
-          (docstring (concat
-                      "Muse header face.  See "
-                      "`muse-colors-autogen-headings' before changing it.")))
-      ;; put in the proper group and give documentation
-      (if later
-          (unless (featurep 'xemacs)
-            (muse-copy-face 'variable-pitch newsym)
-            (set-face-attribute newsym nil :height (1+ (* 0.1 (- 5 num)))
-                                :weight 'bold))
-        (if (featurep 'xemacs)
-            (eval `(defface ,newsym
-                     '((t (:size
-                           ,(nth (1- num)
-                                 '("24pt" "18pt" "14pt" "12pt" "11pt"))
-                           :bold t)))
-                     ,docstring
-                     :group 'muse-colors))
-          (eval `(defface ,newsym
-                   '((t (:height ,(1+ (* 0.1 (- 5 num)))
-                                 :inherit variable-pitch
-                                 :weight bold)))
-                   ,docstring
-                   :group 'muse-colors)))))))
-
-(progn (muse-make-faces-default))
-
-(defun muse-make-faces (&optional frame)
-  "Generate face definitions for headers based the user's preferences."
-  (cond
-   ((not muse-colors-autogen-headings)
-    nil)
-   ((eq muse-colors-autogen-headings t)
-    (muse-make-faces-default t))
-   (t
-    (dolist (num '(1 2 3 4 5))
-      (let ((newsym (intern (concat "muse-header-" (int-to-string num)))))
-        ;; copy the desired face definition
-        (muse-copy-face (nth (1- num) muse-colors-outline-faces-list)
-                        newsym))))))
-
-;; after displaying the Emacs splash screen, the faces are wiped out,
-;; so recover from that
-(add-hook 'window-setup-hook #'muse-make-faces)
-;; ditto for when a new frame is created
-(when (boundp 'after-make-frame-functions)
-  (add-hook 'after-make-frame-functions #'muse-make-faces))
-
-(defface muse-link
-  '((t :inherit link))
-  "Face for Muse cross-references."
-  :group 'muse-colors)
-
-(defface muse-bad-link
-  '((default :inherit link)
-    (((class color) (background light))
-     (:foreground "red" :underline "red" :bold t))
-    (((class color) (background dark))
-     (:foreground "coral" :underline "coral" :bold t))
-    (t (:bold t)))
-  "Face for bad Muse cross-references."
-  :group 'muse-colors)
-
-(defface muse-verbatim
-  '((((class color) (background light))
-     (:foreground "slate gray"))
-    (((class color) (background dark))
-     (:foreground "gray")))
-  "Face for verbatim text."
-  :group 'muse-colors)
-
-(defface muse-emphasis-1
-  '((t (:italic t)))
-  "Face for italic emphasized text."
-  :group 'muse-colors)
-
-(defface muse-emphasis-2
-  '((t (:bold t)))
-  "Face for bold emphasized text."
-  :group 'muse-colors)
-
-(defface muse-emphasis-3
-  '((t (:bold t :italic t)))
-  "Face for bold italic emphasized text."
-  :group 'muse-colors)
-
-(muse-copy-face 'italic 'muse-emphasis-1)
-(muse-copy-face 'bold 'muse-emphasis-2)
-(muse-copy-face 'bold-italic 'muse-emphasis-3)
-
-(defcustom muse-colors-buffer-hook nil
-  "A hook run after a region is highlighted.
-Each function receives three arguments: BEG END VERBOSE.
-BEG and END mark the range being highlighted, and VERBOSE specifies
-whether progress messages should be displayed to the user."
-  :type 'hook
-  :group 'muse-colors)
-
-(defvar muse-colors-highlighting-registry nil
-  "The rules for highlighting Muse and Muse-derived buffers.
-This is automatically generated when using font-lock in Muse buffers.
-
-This an alist of major-mode symbols to `muse-colors-rule' objects.")
-
-(defun muse-colors-make-highlighting-struct ()
-  (list nil nil nil))
-(defconst muse-colors-highlighting.regexp 0
-  "Regexp matching each car of the markup of the current rule.")
-(defconst muse-colors-highlighting.vector 1
-  "Vector of all characters that are part of the markup of the current rule.
-This is composed of the 2nd element of each markup entry.")
-(defconst muse-colors-highlighting.remaining 2
-  "Expressions for highlighting a buffer which have no corresponding
-entry in the vector.")
-
-(defsubst muse-colors-highlighting-entry (mode)
-  "Return the highlighting rules for MODE."
-  (assq mode muse-colors-highlighting-registry))
-
-(defun muse-colors-find-highlighting (mode)
-  "Return the highlighting rules to be used for MODE.
-If MODE does not have highlighting rules, check its parent modes."
-  (let ((seen nil))
-    (catch 'rules
-      (while (and mode (not (memq mode seen)))
-        (let ((entry (muse-colors-highlighting-entry mode)))
-          (when entry (throw 'rules (cdr entry))))
-        (setq seen (cons mode seen))
-        (setq mode (get mode 'derived-mode-parent)))
-      nil)))
-
-(defun muse-colors-define-highlighting (mode markup)
-  "Create or update the markup rules for MODE, using MARKUP.
-
-See `muse-colors-markup' for an explanation of the format that MARKUP
-should take."
-  (unless (and (symbolp mode) mode (consp markup))
-    (error "Invalid arguments"))
-  (let* ((highlighting-entry (muse-colors-highlighting-entry mode))
-         (struct (cdr highlighting-entry))
-         (regexp nil)
-         (vector nil)
-         (remaining nil))
-    ;; Initialize struct
-    (if struct
-        (setq vector (nth muse-colors-highlighting.vector struct))
-      (setq struct (muse-colors-make-highlighting-struct)))
-    ;; Initialize vector
-    (if vector
-        (let ((i 0))
-          (while (< i 128)
-            (aset vector i nil)
-            (setq i (1+ i))))
-      (setq vector (make-vector 128 nil)))
-    ;; Determine vector, regexp, remaining
-    (let ((regexps nil)
-          (rules nil))
-      (dolist (rule markup)
-        (let ((value (cond ((symbolp (car rule))
-                            (symbol-value (car rule)))
-                           ((stringp (car rule))
-                            (car rule))
-                           (t nil))))
-          (when value
-            (setq rules (cons rule rules))
-            (setq regexps (cons value regexps)))))
-      (setq regexps (nreverse regexps))
-      (setq regexp (concat "\\(" (mapconcat #'identity regexps "\\|") "\\)"))
-      (dolist (rule rules)
-        (if (eq (nth 1 rule) t)
-            (setq remaining (cons (cons (nth 0 rule) (nth 2 rule))
-                                  remaining))
-          (aset vector (nth 1 rule)
-                (cons (cons (nth 0 rule) (nth 2 rule))
-                      (aref vector (nth 1 rule)))))))
-    ;; Update the struct
-    (setcar (nthcdr muse-colors-highlighting.regexp struct) regexp)
-    (setcar (nthcdr muse-colors-highlighting.vector struct) vector)
-    (setcar (nthcdr muse-colors-highlighting.remaining struct) remaining)
-    ;; Update entry for mode in muse-colors-highlighting-registry
-    (if highlighting-entry
-        (setcdr highlighting-entry struct)
-      (setq muse-colors-highlighting-registry
-            (cons (cons mode struct)
-                  muse-colors-highlighting-registry)))))
-
-(defun muse-configure-highlighting (sym val)
-  "Extract color markup information from VAL and set to SYM.
-This is usually called with `muse-colors-markup' as both arguments."
-  (muse-colors-define-highlighting 'muse-mode val)
-  (set sym val))
-
-(defun muse-colors-emphasized ()
-  "Color emphasized text and headings."
-  ;; Here we need to check four different points - the start and end
-  ;; of the leading *s, and the start and end of the trailing *s.  We
-  ;; allow the outsides to be surrounded by whitespace or punctuation,
-  ;; but no word characters, and the insides must not be surrounded by
-  ;; whitespace or punctuation.  Thus the following are valid:
-  ;;
-  ;; " *foo bar* "
-  ;; "**foo**,"
-  ;; and the following is invalid:
-  ;; "** testing **"
-  (let* ((beg (match-beginning 0))
-         (e1 (match-end 0))
-         (leader (- e1 beg))
-         b2 e2 multiline)
-    (unless (or (eq (get-text-property beg 'invisible) 'muse)
-                (get-text-property beg 'muse-comment)
-                (get-text-property beg 'muse-directive))
-      ;; check if it's a header
-      (if (eq (char-after e1) ?\ )
-          (when (or (= beg (point-min))
-                    (eq (char-before beg) ?\n))
-            (add-text-properties
-             (muse-line-beginning-position) (muse-line-end-position)
-             (list 'face (intern (concat "muse-header-"
-                                         (int-to-string leader))))))
-        ;; beginning of line or space or symbol
-        (when (or (= beg (point-min))
-                  (eq (char-syntax (char-before beg)) ?\ )
-                  (memq (char-before beg)
-                        '(?\- ?\[ ?\< ?\( ?\' ?\` ?\" ?\n)))
-          (save-excursion
-            (skip-chars-forward "^*<>\n" muse-colors-region-end)
-            (when (eq (char-after) ?\n)
-              (setq multiline t)
-              (skip-chars-forward "^*<>" muse-colors-region-end))
-            (setq b2 (point))
-            (skip-chars-forward "*" muse-colors-region-end)
-            (setq e2 (point))
-            ;; Abort if space exists just before end
-            ;; or bad leader
-            ;; or no '*' at end
-            ;; or word constituent follows
-            (unless (or (> leader 5)
-                        (not (eq leader (- e2 b2)))
-                        (eq (char-syntax (char-before b2)) ?\ )
-                        (not (eq (char-after b2) ?*))
-                        (and (not (eobp))
-                             (eq (char-syntax (char-after (1+ b2))) ?w)))
-              (add-text-properties beg e1 '(invisible muse))
-              (add-text-properties
-               e1 b2 (list 'face (cond ((= leader 1) 'muse-emphasis-1)
-                                       ((= leader 2) 'muse-emphasis-2)
-                                       ((= leader 3) 'muse-emphasis-3))))
-              (add-text-properties b2 e2 '(invisible muse))
-              (when multiline
-                (add-text-properties
-                 beg e2 '(font-lock-multiline t))))))))))
-
-(defun muse-colors-underlined ()
-  "Color underlined text."
-  (let ((start (match-beginning 0))
-        multiline)
-    (unless (or (eq (get-text-property start 'invisible) 'muse)
-                (get-text-property start 'muse-comment)
-                (get-text-property start 'muse-directive))
-      ;; beginning of line or space or symbol
-      (when (or (= start (point-min))
-                (eq (char-syntax (char-before start)) ?\ )
-                (memq (char-before start)
-                      '(?\- ?\[ ?\< ?\( ?\' ?\` ?\" ?\n)))
-        (save-excursion
-          (skip-chars-forward "^_<>\n" muse-colors-region-end)
-          (when (eq (char-after) ?\n)
-            (setq multiline t)
-            (skip-chars-forward "^_<>" muse-colors-region-end))
-          ;; Abort if space exists just before end
-          ;; or no '_' at end
-          ;; or word constituent follows
-          (unless (or (eq (char-syntax (char-before (point))) ?\ )
-                      (not (eq (char-after (point)) ?_))
-                      (and (not (eobp))
-                           (eq (char-syntax (char-after (1+ (point)))) ?w)))
-            (add-text-properties start (1+ start) '(invisible muse))
-            (add-text-properties (1+ start) (point) '(face underline))
-            (add-text-properties (point)
-                                 (min (1+ (point)) (point-max))
-                                 '(invisible muse))
-            (when multiline
-              (add-text-properties
-               start (min (1+ (point)) (point-max))
-               '(font-lock-multiline t)))))))))
-
-(defun muse-colors-verbatim ()
-  "Render in teletype and suppress further parsing."
-  (let ((start (match-beginning 0))
-        multiline)
-    (unless (or (eq (get-text-property start 'invisible) 'muse)
-                (get-text-property start 'muse-comment)
-                (get-text-property start 'muse-directive))
-      ;; beginning of line or space or symbol
-      (when (or (= start (point-min))
-                (eq (char-syntax (char-before start)) ?\ )
-                (memq (char-before start)
-                      '(?\- ?\[ ?\< ?\( ?\' ?\` ?\" ?\n)))
-        (let ((pos (point)))
-          (skip-chars-forward "^=\n" muse-colors-region-end)
-          (when (eq (char-after) ?\n)
-            (setq multiline t)
-            (skip-chars-forward "^=" muse-colors-region-end))
-          ;; Abort if space exists just before end
-          ;; or no '=' at end
-          ;; or word constituent follows
-          (unless (or (eq (char-syntax (char-before (point))) ?\ )
-                      (not (eq (char-after (point)) ?=))
-                      (and (not (eobp))
-                           (eq (char-syntax (char-after (1+ (point)))) ?w)))
-            (setq pos (min (1+ (point)) (point-max)))
-            (add-text-properties start (1+ start) '(invisible muse))
-            (add-text-properties (1+ start) (point) '(face muse-verbatim))
-            (add-text-properties (point)
-                                 (min (1+ (point)) (point-max))
-                                 '(invisible muse))
-            (when multiline
-              (add-text-properties
-               start (min (1+ (point)) (point-max))
-               '(font-lock-multiline t))))
-          (goto-char pos))))))
-
-(defcustom muse-colors-markup
-  `(;; make emphasized text appear emphasized
-    ("\\*\\{1,5\\}" ?* muse-colors-emphasized)
-
-    ;; make underlined text appear underlined
-    (,(concat "_[^" muse-regexp-blank "_\n]")
-     ?_ muse-colors-underlined)
-
-    ("^#title " ?\# muse-colors-title)
-
-    (muse-explicit-link-regexp ?\[ muse-colors-explicit-link)
-
-    ;; render in teletype and suppress further parsing
-    (,(concat "=[^" muse-regexp-blank "=\n]") ?= muse-colors-verbatim)
-
-    ;; highlight any markup tags encountered
-    (muse-tag-regexp ?\< muse-colors-custom-tags)
-
-    ;; display comments
-    (,(concat "^;[" muse-regexp-blank "]") ?\; muse-colors-comment)
-
-    ;; this has to come later since it doesn't have a special
-    ;; character in the second cell
-    (muse-url-regexp t muse-colors-implicit-link)
-    )
-  "Expressions to highlight an Emacs Muse buffer.
-These are arranged in a rather special fashion, so as to be as quick as
-possible.
-
-Each element of the list is itself a list, of the form:
-
-  (LOCATE-REGEXP TEST-CHAR MATCH-FUNCTION)
-
-LOCATE-REGEXP is a partial regexp, and should be the smallest possible
-regexp to differentiate this rule from other rules.  It may also be a
-symbol containing such a regexp.  The buffer region is scanned only
-once, and LOCATE-REGEXP indicates where the scanner should stop to
-look for highlighting possibilities.
-
-TEST-CHAR is a char or t.  The character should match the beginning
-text matched by LOCATE-REGEXP.  These chars are used to build a vector
-for fast MATCH-FUNCTION calling.
-
-MATCH-FUNCTION is the function called when a region has been
-identified.  It is responsible for adding the appropriate text
-properties to change the appearance of the buffer.
-
-This markup is used to modify the appearance of the original text to
-make it look more like the published HTML would look (like making some
-markup text invisible, inlining images, etc).
-
-font-lock is used to apply the markup rules, so that they can happen
-on a deferred basis.  They are not always accurate, but you can use
-\\[font-lock-fontifty-block] near the point of error to force
-fontification in that area."
-  :type '(repeat
-          (list :tag "Highlight rule"
-                (choice (regexp :tag "Locate regexp")
-                        (symbol :tag "Regexp symbol"))
-                (choice (character :tag "Confirm character")
-                        (const :tag "Default rule" t))
-                function))
-  :set 'muse-configure-highlighting
-  :group 'muse-colors)
-
-;; XEmacs users don't have `font-lock-multiline'.
-(unless (boundp 'font-lock-multiline)
-  (defvar font-lock-multiline nil))
-
-(defun muse-use-font-lock ()
-  "Set up font-locking for Muse."
-  (muse-add-to-invisibility-spec 'muse)
-  (set (make-local-variable 'font-lock-multiline) 'undecided)
-  (set (make-local-variable 'font-lock-defaults)
-       `(nil t nil nil beginning-of-line
-         (font-lock-fontify-region-function . muse-colors-region)
-         (font-lock-unfontify-region-function
-          . muse-unhighlight-region)))
-  (set (make-local-variable 'font-lock-fontify-region-function)
-       'muse-colors-region)
-  (set (make-local-variable 'font-lock-unfontify-region-function)
-       'muse-unhighlight-region)
-  (muse-make-faces)
-  (muse-colors-define-highlighting 'muse-mode muse-colors-markup)
-  (font-lock-mode t))
-
-(defun muse-colors-buffer ()
-  "Re-highlight the entire Muse buffer."
-  (interactive)
-  (muse-colors-region (point-min) (point-max) t))
-
-(defvar muse-colors-fontifying-p nil
-  "Indicate whether Muse is fontifying the current buffer.")
-(make-variable-buffer-local 'muse-colors-fontifying-p)
-
-(defvar muse-colors-delayed-commands nil
-  "Commands to be run immediately after highlighting a region.
-
-This is meant to accommodate highlighting <lisp> in #title
-directives after everything else.
-
-It may be modified by Muse functions during highlighting, but not
-the user.")
-(make-variable-buffer-local 'muse-colors-delayed-commands)
-
-(defun muse-colors-region (beg end &optional verbose)
-  "Apply highlighting according to `muse-colors-markup'.
-Note that this function should NOT change the buffer, nor should any
-of the functions listed in `muse-colors-markup'."
-  (let ((buffer-undo-list t)
-        (inhibit-read-only t)
-        (inhibit-point-motion-hooks t)
-        (inhibit-modification-hooks t)
-        (modified-p (buffer-modified-p))
-        (muse-colors-fontifying-p t)
-        (muse-colors-region-end (muse-line-end-position end))
-        (muse-colors-delayed-commands nil)
-        (highlighting (muse-colors-find-highlighting major-mode))
-        regexp vector remaining
-        deactivate-mark)
-    (unless highlighting
-      (error "No highlighting found for this mode"))
-    (setq regexp (nth muse-colors-highlighting.regexp highlighting)
-          vector (nth muse-colors-highlighting.vector highlighting)
-          remaining (nth muse-colors-highlighting.remaining highlighting))
-    (unwind-protect
-        (save-excursion
-          (save-restriction
-            (widen)
-            ;; check to see if we should expand the beg/end area for
-            ;; proper multiline matches
-            (when (and font-lock-multiline
-                       (> beg (point-min))
-                       (get-text-property (1- beg) 'font-lock-multiline))
-              ;; We are just after or in a multiline match.
-              (setq beg (or (previous-single-property-change
-                             beg 'font-lock-multiline)
-                            (point-min)))
-              (goto-char beg)
-              (setq beg (muse-line-beginning-position)))
-            (when font-lock-multiline
-              (setq end (or (text-property-any end (point-max)
-                                               'font-lock-multiline nil)
-                            (point-max))))
-            (goto-char end)
-            (setq end (muse-line-beginning-position 2))
-            ;; Undo any fontification in the area.
-            (font-lock-unfontify-region beg end)
-            ;; And apply fontification based on `muse-colors-markup'
-            (let ((len (float (- end beg)))
-                  (case-fold-search nil)
-                  markup-list)
-              (goto-char beg)
-              (while (and (< (point) end)
-                          (re-search-forward regexp end t))
-                (if verbose
-                    (message "Highlighting buffer...%d%%"
-                             (* (/ (float (- (point) beg)) len) 100)))
-                (let ((ch (char-after (match-beginning 0))))
-                  (when (< ch 128)
-                    (setq markup-list (aref vector ch))))
-                (unless markup-list
-                  (setq markup-list remaining))
-                (let ((prev (point)))
-                  ;; backtrack and figure out which rule matched
-                  (goto-char (match-beginning 0))
-                  (catch 'done
-                    (dolist (entry markup-list)
-                      (let ((value (cond ((symbolp (car entry))
-                                          (symbol-value (car entry)))
-                                         ((stringp (car entry))
-                                          (car entry))
-                                         (t nil))))
-                        (when (and (stringp value) (looking-at value))
-                          (goto-char (match-end 0))
-                          (when (cdr entry)
-                            (funcall (cdr entry)))
-                          (throw 'done t))))
-                    ;; if no rule matched, which should never happen,
-                    ;; return to previous position so that forward
-                    ;; progress is ensured
-                    (goto-char prev))))
-              (dolist (command muse-colors-delayed-commands)
-                (apply (car command) (cdr command)))
-              (run-hook-with-args 'muse-colors-buffer-hook
-                                  beg end verbose)
-              (if verbose (message "Highlighting buffer...done")))))
-      (set-buffer-modified-p modified-p))))
-
-(defcustom muse-colors-tags
-  '(("example"  t nil nil muse-colors-example-tag)
-    ("code"     t nil nil muse-colors-example-tag)
-    ("verbatim" t nil nil muse-colors-literal-tag)
-    ("lisp"     t t   nil muse-colors-lisp-tag)
-    ("literal"  t nil nil muse-colors-literal-tag))
-  "A list of tag specifications for specially highlighting text.
-XML-style tags are the best way to add custom highlighting to Muse.
-This is easily accomplished by customizing this list of markup tags.
-
-For each entry, the name of the tag is given, whether it expects
-a closing tag and/or an optional set of attributes, whether it is
-nestable, and a function that performs whatever action is desired
-within the delimited region.
-
-The function is called with three arguments, the beginning and
-end of the region surrounded by the tags. If properties are
-allowed, they are passed as a third argument in the form of an
-alist. The `end' argument to the function is the last character
-of the enclosed tag or region.
-
-Functions should not modify the contents of the buffer."
-  :type '(repeat (list (string :tag "Markup tag")
-                       (boolean :tag "Expect closing tag" :value t)
-                       (boolean :tag "Parse attributes" :value nil)
-                       (boolean :tag "Nestable" :value nil)
-                       function))
-  :group 'muse-colors)
-
-(defvar muse-colors-inhibit-tags-in-directives t
-  "If non-nil, don't allow tags to be interpreted in directives.
-This is used to delay highlighting of <lisp> tags in #title until later.")
-(make-variable-buffer-local 'muse-colors-inhibit-tags-in-directives)
-
-(defsubst muse-colors-tag-info (tagname &rest args)
-  "Get tag info associated with TAGNAME, ignoring ARGS."
-  (assoc tagname muse-colors-tags))
-
-(defun muse-colors-custom-tags ()
-  "Highlight `muse-colors-tags'."
-  (let ((tag-info (muse-colors-tag-info (match-string 1))))
-    (unless (or (not tag-info)
-                (get-text-property (match-beginning 0) 'muse-comment)
-                (and muse-colors-inhibit-tags-in-directives
-                     (get-text-property (match-beginning 0) 'muse-directive)))
-      (let ((closed-tag (match-string 3))
-            (start (match-beginning 0))
-            end attrs)
-        (when (nth 2 tag-info)
-          (let ((attrstr (match-string 2)))
-            (while (and attrstr
-                        (string-match (concat "\\([^"
-                                              muse-regexp-blank
-                                              "=\n]+\\)\\(=\""
-                                              "\\([^\"]+\\)\"\\)?")
-                                      attrstr))
-              (let ((attr (cons (downcase
-                                 (muse-match-string-no-properties 1 attrstr))
-                                (muse-match-string-no-properties 3 attrstr))))
-                (setq attrstr (replace-match "" t t attrstr))
-                (if attrs
-                    (nconc attrs (list attr))
-                  (setq attrs (list attr)))))))
-        (if (and (cadr tag-info) (not closed-tag))
-            (if (muse-goto-tag-end (car tag-info) (nth 3 tag-info))
-                (setq end (match-end 0))
-              (setq tag-info nil)))
-        (when tag-info
-          (let ((args (list start end)))
-            (if (nth 2 tag-info)
-                (nconc args (list attrs)))
-            (apply (nth 4 tag-info) args)))))))
-
-(defun muse-unhighlight-region (begin end &optional verbose)
-  "Remove all visual highlights in the buffer (except font-lock)."
-  (let ((buffer-undo-list t)
-        (inhibit-read-only t)
-        (inhibit-point-motion-hooks t)
-        (inhibit-modification-hooks t)
-        (modified-p (buffer-modified-p))
-        deactivate-mark)
-    (unwind-protect
-        (remove-text-properties
-         begin end '(face nil font-lock-multiline nil end-glyph nil
-                          invisible nil intangible nil display nil
-                          mouse-face nil keymap nil help-echo nil
-                          muse-link nil muse-directive nil muse-comment nil
-                          muse-no-implicit-link nil muse-no-flyspell nil))
-      (set-buffer-modified-p modified-p))))
-
-(defun muse-colors-example-tag (beg end)
-  "Strip properties and colorize with `muse-verbatim'."
-  (muse-unhighlight-region beg end)
-  (let ((multi (save-excursion
-                 (goto-char beg)
-                 (forward-line 1)
-                 (> end (point)))))
-    (add-text-properties beg end `(face muse-verbatim
-                                   font-lock-multiline ,multi))))
-
-(defun muse-colors-literal-tag (beg end)
-  "Strip properties and mark as literal."
-  (muse-unhighlight-region beg end)
-  (let ((multi (save-excursion
-                 (goto-char beg)
-                 (forward-line 1)
-                 (> end (point)))))
-    (add-text-properties beg end `(font-lock-multiline ,multi))))
-
-(defun muse-colors-lisp-tag (beg end attrs)
-  "Color the region enclosed by a <lisp> tag."
-  (if (not muse-colors-evaluate-lisp-tags)
-      (muse-colors-literal-tag beg end)
-    (muse-unhighlight-region beg end)
-    (let (beg-lisp end-lisp)
-      (save-match-data
-        (goto-char beg)
-        (setq beg-lisp (and (looking-at "<[^>]+>")
-                            (match-end 0)))
-        (goto-char end)
-        (setq end-lisp (and (muse-looking-back "</[^>]+>")
-                            (match-beginning 0))))
-      (add-text-properties
-       beg end
-       (list 'font-lock-multiline t
-             'display (muse-eval-lisp
-                       (concat
-                        "(progn "
-                        (buffer-substring-no-properties beg-lisp end-lisp)
-                        ")"))
-             'intangible t)))))
-
-(defvar muse-mode-local-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [return] 'muse-follow-name-at-point)
-    (define-key map [(control ?m)] 'muse-follow-name-at-point)
-    (define-key map [(shift return)] 'muse-follow-name-at-point-other-window)
-    (if (featurep 'xemacs)
-        (progn
-          (define-key map [(button2)] 'muse-follow-name-at-mouse)
-          (define-key map [(shift button2)]
-            'muse-follow-name-at-mouse-other-window))
-      (define-key map [(shift control ?m)]
-        'muse-follow-name-at-point-other-window)
-      (define-key map [mouse-2] 'muse-follow-name-at-mouse)
-      (define-key map [(shift mouse-2)]
-        'muse-follow-name-at-mouse-other-window)
-      (unless (eq emacs-major-version 21)
-        (set-keymap-parent map muse-mode-map)))
-    map)
-  "Local keymap used by Muse while on a link.")
-
-(defvar muse-keymap-property
-  (if (or (featurep 'xemacs)
-          (>= emacs-major-version 21))
-      'keymap
-    'local-map)
-  "The name of the keymap or local-map property.")
-
-(defsubst muse-link-properties (help-str &optional face)
-  "Determine text properties to use for a link."
-  (append (if face
-              (list 'face face 'mouse-face 'highlight 'muse-link t)
-            (list 'invisible 'muse 'intangible t))
-          (list 'help-echo help-str 'rear-nonsticky t
-                muse-keymap-property muse-mode-local-map)))
-
-(defun muse-link-face (link-name &optional explicit)
-  "Return the type of LINK-NAME as a face symbol.
-For EXPLICIT links, this is either a normal link or a bad-link
-face.  For implicit links, it is either colored normally or
-ignored."
-  (save-match-data
-    (let ((link (if explicit
-                    (muse-handle-explicit-link link-name)
-                  (muse-handle-implicit-link link-name))))
-      (when link
-        (cond ((string-match muse-url-regexp link)
-               'muse-link)
-              ((muse-file-remote-p link)
-               'muse-link)
-              ((string-match muse-file-regexp link)
-               (when (string-match "/[^/]+#[^#./]+\\'" link)
-                 ;; strip anchor from the end of a path
-                 (setq link (substring link 0 (match-beginning 0))))
-               (if (file-exists-p link)
-                   'muse-link
-                 'muse-bad-link))
-              ((not (featurep 'muse-project))
-               'muse-link)
-              (t
-               (if (string-match "#" link)
-                   (setq link (substring link 0 (match-beginning 0))))
-               (if (or (and (muse-project-of-file)
-                            (muse-project-page-file
-                             link muse-current-project t))
-                       (file-exists-p link))
-                   'muse-link
-                 'muse-bad-link)))))))
-
-(defun muse-colors-use-publishing-directory (link)
-  "Make LINK relative to the directory where we will publish the
-current file."
-  (let ((style (car (muse-project-applicable-styles
-                     link (cddr (muse-project)))))
-        path)
-    (when (and style
-               (setq path (muse-style-element :path style)))
-      (expand-file-name link path))))
-
-(defun muse-colors-resolve-image-file (link)
-  "Determine if we can create images and see if the link is an image
-file."
-  (save-match-data
-    (and (or (fboundp 'create-image)
-             (fboundp 'make-glyph))
-         (not (string-match "\\`[uU][rR][lL]:" link))
-         (string-match muse-image-regexp link))))
-
-(defun muse-make-file-glyph (filename)
-  "Given a file name, return a newly-created image glyph.
-This is a hack for supporting inline images in XEmacs."
-  (let ((case-fold-search nil))
-    ;; Scan filename to determine image type
-    (when (fboundp 'make-glyph)
-      (save-match-data
-        (cond ((string-match "jpe?g" filename)
-               (make-glyph (vector 'jpeg :file filename) 'buffer))
-              ((string-match "gif" filename)
-               (make-glyph (vector 'gif :file filename) 'buffer))
-              ((string-match "png" filename)
-               (make-glyph (vector 'png :file filename) 'buffer)))))))
-
-(defun muse-colors-insert-image (link beg end invis-props)
-  "Create an image using create-image or make-glyph and insert it
-in place of an image link defined by BEG and END."
-  (setq link (expand-file-name link))
-  (let ((image-file (cond
-                     ((eq muse-colors-inline-image-method 'default-directory)
-                      link)
-                     ((functionp muse-colors-inline-image-method)
-                      (funcall muse-colors-inline-image-method link))))
-        glyph)
-    (when (stringp image-file)
-      (if (fboundp 'create-image)
-          ;; use create-image and display property
-          (let ((display-stuff (condition-case nil
-                                   (create-image image-file)
-                                 (error nil))))
-            (when display-stuff
-              (add-text-properties beg end (list 'display display-stuff))))
-        ;; use make-glyph and invisible property
-        (and (setq glyph (muse-make-file-glyph image-file))
-             (progn
-               (add-text-properties beg end invis-props)
-               (add-text-properties beg end (list
-                                             'end-glyph glyph
-                                             'help-echo link))))))))
-
-(defun muse-colors-explicit-link ()
-  "Color explicit links."
-  (when (and (eq ?\[ (char-after (match-beginning 0)))
-             (not (get-text-property (match-beginning 0) 'muse-comment))
-             (not (get-text-property (match-beginning 0) 'muse-directive)))
-    ;; remove flyspell overlays
-    (when (fboundp 'flyspell-unhighlight-at)
-      (let ((cur (match-beginning 0)))
-        (while (> (match-end 0) cur)
-          (flyspell-unhighlight-at cur)
-          (setq cur (1+ cur)))))
-    (let* ((unesc-link (muse-get-link))
-           (unesc-desc (muse-get-link-desc))
-           (link (muse-link-unescape unesc-link))
-           (desc (muse-link-unescape unesc-desc))
-           (props (muse-link-properties desc (muse-link-face link t)))
-           (invis-props (append props (muse-link-properties desc))))
-      ;; see if we should try and inline an image
-      (if (and muse-colors-inline-images
-               (or (muse-colors-resolve-image-file link)
-                   (and desc
-                        (muse-colors-resolve-image-file desc)
-                        (setq link desc))))
-          ;; we found an image, so inline it
-          (muse-colors-insert-image
-           link
-           (match-beginning 0) (match-end 0) invis-props)
-        (if desc
-            (progn
-              ;; we put the normal face properties on the invisible
-              ;; portion too, since emacs sometimes will position
-              ;; the cursor on an intangible character
-              (add-text-properties (match-beginning 0)
-                                   (match-beginning 2) invis-props)
-              (add-text-properties (match-beginning 2) (match-end 2) props)
-              (add-text-properties (match-end 2) (match-end 0) invis-props)
-              ;; in case specials were escaped, cause the unescaped
-              ;; text to be displayed
-              (unless (string= desc unesc-desc)
-                (add-text-properties (match-beginning 2) (match-end 2)
-                                     (list 'display desc))))
-          (add-text-properties (match-beginning 0)
-                               (match-beginning 1) invis-props)
-          (add-text-properties (match-beginning 1) (match-end 0) props)
-          (add-text-properties (match-end 1) (match-end 0) invis-props)
-          (unless (string= link unesc-link)
-            (add-text-properties (match-beginning 1) (match-end 1)
-                                 (list 'display link))))
-        (goto-char (match-end 0))
-        (add-text-properties
-         (match-beginning 0) (match-end 0)
-         (muse-link-properties (muse-match-string-no-properties 0)
-                               (muse-link-face link t)))))))
-
-(defun muse-colors-implicit-link ()
-  "Color implicit links."
-  (unless (or (eq (get-text-property (match-beginning 0) 'invisible) 'muse)
-              (get-text-property (match-beginning 0) 'muse-comment)
-              (get-text-property (match-beginning 0) 'muse-directive)
-              (get-text-property (match-beginning 0) 'muse-no-implicit-link)
-              (eq (char-before (match-beginning 0)) ?\")
-              (eq (char-after (match-end 0)) ?\"))
-    ;; remove flyspell overlays
-    (when (fboundp 'flyspell-unhighlight-at)
-      (let ((cur (match-beginning 0)))
-        (while (> (match-end 0) cur)
-          (flyspell-unhighlight-at cur)
-          (setq cur (1+ cur)))))
-    ;; colorize link
-    (let ((link (muse-match-string-no-properties 0))
-          (face (muse-link-face (match-string 0))))
-      (when face
-        (add-text-properties (match-beginning 0) (match-end 0)
-                             (muse-link-properties
-                              (muse-match-string-no-properties 0) face))))))
-
-(defun muse-colors-title ()
-  "Color #title directives."
-  (let ((beg (+ 7 (match-beginning 0))))
-    (add-text-properties beg (muse-line-end-position) '(muse-directive t))
-    ;; colorize <lisp> tags in #title after other <lisp> tags have had a
-    ;; chance to run, so that we can have behavior that is consistent
-    ;; with how the document is published
-    (setq muse-colors-delayed-commands
-          (cons (list 'muse-colors-title-lisp beg (muse-line-end-position))
-                muse-colors-delayed-commands))))
-
-(defun muse-colors-title-lisp (beg end)
-  "Called after other highlighting is done for a region in order to handle
-<lisp> tags that exist in #title directives."
-  (save-restriction
-    (narrow-to-region beg end)
-    (goto-char (point-min))
-    (let ((muse-colors-inhibit-tags-in-directives nil)
-          (muse-colors-tags '(("lisp" t t nil muse-colors-lisp-tag))))
-      (while (re-search-forward muse-tag-regexp nil t)
-        (muse-colors-custom-tags))))
-  (add-text-properties beg end '(face muse-header-1)))
-
-(defun muse-colors-comment ()
-  "Color comments."
-  (add-text-properties (match-beginning 0) (muse-line-end-position)
-                       (list 'face 'font-lock-comment-face
-                             'muse-comment t)))
-
-
-(provide 'muse-colors)
-
-;;; muse-colors.el ends here
diff --git a/packages/muse/muse-context.el b/packages/muse/muse-context.el
deleted file mode 100644
index 45968b0..0000000
--- a/packages/muse/muse-context.el
+++ /dev/null
@@ -1,458 +0,0 @@
-;;; muse-context.el --- publish entries in ConTeXt or PDF format
-
-;; Copyright (C) 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
-
-;; Author: Jean Magnan de Bornier (jean@bornier.net)
-;; Created: 16-Apr-2007
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; This file when loaded allows you to publish .muse files as ConTeXt
-;; files or as pdf files, using respectively the "context" and
-;; "context-pdf" styles. It is far from being perfect, so any feedback
-;; will be welcome and any mistake hopefully fixed.
-
-;;; Author:
-
-;; Jean Magnan de Bornier, who based this file on muse-latex.el and
-;; made the context, context-pdf, context-slides, and
-;; context-slides-pdf Muse publishing styles.
-
-;; 16 Avril 2007
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse ConTeXt Publishing
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-publish)
-
-(defgroup muse-context nil
-  "Rules for marking up a Muse file as a ConTeXt article."
-  :group 'muse-publish)
-
-(defcustom muse-context-extension ".tex"
-  "Default file extension for publishing ConTeXt files."
-  :type 'string
-  :group 'muse-context)
-
-(defcustom muse-context-pdf-extension ".pdf"
-  "Default file extension for publishing ConTeXt files to PDF."
-  :type 'string
-  :group 'muse-context)
-
-(defcustom muse-context-pdf-program "texexec --pdf"
-  "The program that is called to generate PDF content from ConTeXt content."
-  :type 'string
-  :group 'muse-context)
-
-(defcustom muse-context-pdf-cruft '(".pgf" ".tmp" ".tui" ".tuo" ".toc"  ".log")
-  "Extensions of files to remove after generating PDF output successfully."
-  :type 'string
-  :group 'muse-context)
-
-(defcustom muse-context-header
-  "\\setupinteraction [state=start]
-\\usemodule[tikz]
-\\usemodule[bib]\n
-<lisp>(muse-context-setup-bibliography)</lisp>
- \\setuppublications[]\n
-\\setuppublicationlist[]\n\\setupcite[]\n
-\\starttext
-\\startalignment[center]
-  \\blank[2*big]
-    {\\tfd <lisp>(muse-publishing-directive \"title\")</lisp>}
-  \\blank[3*medium]
-    {\\tfa <lisp>(muse-publishing-directive \"author\")</lisp>}
-  \\blank[2*medium]
-    {\\tfa <lisp>(muse-publishing-directive \"date\")</lisp>}
-  \\blank[3*medium]
-\\stopalignment
-
-<lisp>(and muse-publish-generate-contents
-           (not muse-context-permit-contents-tag)
-           \"\\\\placecontent\n\\\\page[yes]\")</lisp>\n\n"
-  "Header used for publishing ConTeXt files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-context)
-
-(defcustom muse-context-footer "<lisp>(muse-context-bibliography)</lisp>
-\\stoptext\n"
-  "Footer used for publishing ConTeXt files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-context)
-
-(defcustom muse-context-markup-regexps
-  `(;; numeric ranges
-    (10000 "\\([0-9]+\\)-\\([0-9]+\\)" 0 "\\1--\\2")
-
-    ;; be careful of closing quote pairs
-    (10100 "\"'" 0 "\"\\\\-'"))
-  "List of markup regexps for identifying regions in a Muse page.
-For more on the structure of this list, see `muse-publish-markup-regexps'."
-  :type '(repeat (choice
-                  (list :tag "Markup rule"
-                        integer
-                        (choice regexp symbol)
-                        integer
-                        (choice string function symbol))
-                  function))
-  :group 'muse-context)
-
-(defcustom muse-context-markup-functions
-  '((table . muse-context-markup-table))
-  "An alist of style types to custom functions for that kind of text.
-For more on the structure of this list, see
-`muse-publish-markup-functions'."
-  :type '(alist :key-type symbol :value-type function)
-  :group 'muse-context)
-
-(defcustom muse-context-markup-strings
-  '((image-with-desc . "\\placefigure[][]{%3%}{\\externalfigure[%1%.%2%]}")
-    (image           . "\\placefigure[][]{}{\\externalfigure[%s.%s]}")
-    (image-link      . "\\useURL[aa][%s][][%1%] \\from[aa]")
-    (anchor-ref      . "\\goto{%2%}{}[%1%]")
-    (url             . "\\useURL[aa][%s][][%s] \\from[aa]")
-    (url-and-desc    . "\\useURL[bb][%s][][%s]\\from[bb]\\footnote{%1%}")
-    (link            . "\\goto{%2%}[program(%1%)]\\footnote{%1%}")
-    (link-and-anchor . "\\useexternaldocument[%4%][%4%][] \\at{%3%, 
page}{}[%4%::%2%]\\footnote{%1%}")
-    (email-addr      . "\\useURL[mail][mailto:%s][][%s]\\from[mail]";)
-    (anchor          . "\\reference[%s] ")
-    (emdash          . "---")
-    (comment-begin   . "\\doifmode{comment}{")
-    (comment-end     . "}")
-    (rule            . "\\blank[medium]\\hrule\\blank[medium]")
-    (no-break-space  . "~")
-    (enddots         . "\\ldots ")
-    (dots            . "\\dots ")
-    (part            . "\\part{")
-    (part-end        . "}")
-    (chapter         . "\\chapter{")
-    (chapter-end     . "}")
-    (section         . "\\section{")
-    (section-end     . "}")
-    (subsection      . "\\subsection{")
-    (subsection-end  . "}")
-    (subsubsection   . "\\subsubsection{")
-    (subsubsection-end . "}")
-    (section-other   . "\\subsubsubject{")
-    (section-other-end . "}")
-    (footnote        . "\\footnote{")
-    (footnote-end    . "}")
-    (footnotetext    . "\\footnotetext[%d]{")
-    (begin-underline . "\\underbar{")
-    (end-underline   . "}")
-    (begin-literal   . "\\type{")
-    (end-literal     . "}")
-    (begin-emph      . "{\\em ")
-    (end-emph        . "}")
-    (begin-more-emph . "{\\bf ")
-    (end-more-emph   . "}")
-    (begin-most-emph . "{\\bf {\\em ")
-    (end-most-emph   . "}}")
-    (begin-example   . "\\starttyping")
-    (end-example     . "\\stoptyping")
-    (begin-center    . "\\startalignment[center]\n")
-    (end-center      . "\n\\stopalignment")
-    (begin-quote     . "\\startquotation\n")
-    (end-quote       . "\n\\stopquotation")
-    (begin-cite     . "\\cite[authoryear][")
-    (begin-cite-author . "\\cite[author][")
-    (begin-cite-year . "\\cite[year][")
-    (end-cite        . "]")
-    (begin-uli       . "\\startitemize\n")
-    (end-uli         . "\n\\stopitemize")
-    (begin-uli-item  . "\\item ")
-    (begin-oli       . "\\startitemize[n]\n")
-    (end-oli         . "\n\\stopitemize")
-    (begin-oli-item  . "\\item ")
-    (begin-dl        . "\\startitemize\n")
-    (end-dl          . "\n\\stopitemize")
-    (begin-ddt       . "\\head ")
-    (end-ddt         . "\n")
-    (begin-verse     . "\\blank[big]")
-    (end-verse-line  . "\\par")
-    (verse-space     . "\\fixedspaces ~~")
-    (end-verse       . "\\blank[big]"))
-  "Strings used for marking up text.
-These cover the most basic kinds of markup, the handling of which
-differs little between the various styles."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-context)
-
-(defcustom muse-context-slides-header
-  "\\usemodule[<lisp>(if (string-equal (muse-publishing-directive \"module\") 
nil) \"pre-01\" (muse-publishing-directive \"module\"))</lisp>]
-\\usemodule[tikz]
-\\usemodule[newmat]
-\\setupinteraction [state=start]
-\\starttext
-\\TitlePage { <lisp>(muse-publishing-directive \"title\")</lisp>
-\\blank[3*medium]
-\\tfa <lisp>(muse-publishing-directive \"author\")</lisp>
- \\blank[2*medium]
-  \\tfa <lisp>(muse-publishing-directive \"date\")</lisp>}"
-  "Header for publishing a presentation (slides) using ConTeXt.
-Any of the predefined modules, which are available in the
-tex/context/base directory, can be used by writing a \"module\"
-directive at the top of the muse file; if no such directive is
-provided, module pre-01 is used.  Alternatively, you can use your
-own style (\"mystyle\", in this example) by replacing
-\"\\usemodule[]\" with \"\\input mystyle\".
-
-This may be text or a filename."
-  :type 'string
-  :group 'muse-context)
-
-(defcustom muse-context-slides-markup-strings
-   '((section      . "\\Topic {")
-     (subsection   . "\\page \n{\\bf ")
-     (subsubsection . "{\\em "))
-  "Strings used for marking up text in ConTeXt slides."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-context)
-
-(defcustom muse-context-markup-specials-document
-  '((?\\ . "\\textbackslash{}")
-    (?\_ . "\\textunderscore{}")
-    (?\< . "\\switchtobodyfont[small]")
-    (?\> . "\\switchtobodyfont[big]")
-    (?^  . "\\^")
-    (?\~ . "\\~")
-    (?\@ . "\\@")
-    (?\$ . "\\$")
-    (?\% . "\\%")
-    (?\{ . "\\{")
-    (?\} . "\\}")
-    (?\& . "\\&")
-    (?\# . "\\#"))
-  "A table of characters which must be represented specially.
-These are applied to the entire document, sans already-escaped
-regions."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-context)
-
-(defcustom muse-context-markup-specials-example
-  '()
-  "A table of characters which must be represented specially.
-These are applied to <example> regions.
-
-With the default interpretation of <example> regions, no specials
-need to be escaped."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-context)
-
-(defcustom muse-context-markup-specials-literal
-  '()
-  "A table of characters which must be represented specially.
-This applies to =monospaced text= and <code> regions."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-context)
-
-(defcustom muse-context-markup-specials-url
-  '((?\\ . "\\textbackslash")
-    (?\_ . "\\_")
-    (?\< . "\\<")
-    (?\> . "\\>")
-    (?\$ . "\\$")
-    (?\% . "\\%")
-    (?\{ . "\\{")
-    (?\} . "\\}")
-    (?\& . "\\&")
-    (?\# . "\\#"))
-  "A table of characters which must be represented specially.
-These are applied to URLs."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-context)
-
-(defcustom muse-context-markup-specials-image
-  '((?\\ . "\\textbackslash")       ; cannot find suitable replacement
-    (?\< . "\\<")
-    (?\> . "\\>")
-    (?\$ . "\\$")
-    (?\% . "\\%")
-    (?\{ . "\\{")
-    (?\} . "\\}")
-    (?\& . "\\&")
-    (?\# . "\\#")                     ; cannot find suitable replacement
-    )
-  "A table of characters which must be represented specially.
-These are applied to image filenames."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-context)
-
-(defun muse-context-decide-specials (context)
-  "Determine the specials to escape, depending on the CONTEXT argument."
-  (cond ((memq context '(underline emphasis document url-desc verbatim
-                                   footnote))
-         muse-context-markup-specials-document)
-        ((eq context 'image)
-         muse-context-markup-specials-image)
-        ((memq context '(email url))
-         muse-context-markup-specials-url)
-        ((eq context 'literal)
-         muse-context-markup-specials-literal)
-        ((eq context 'example)
-         muse-context-markup-specials-example)
-        (t (error "Invalid context argument '%s' in muse-context" context))))
-
-(defun muse-context-markup-table ()
-  (let* ((table-info (muse-publish-table-fields (match-beginning 0)
-                                                (match-end 0)))
-         (row-len (car table-info))
-         (field-list (cdr table-info)))
-    (when table-info
-      (muse-insert-markup "\\starttable[|"
-                          (mapconcat 'symbol-name (make-vector row-len 'l)
-                                     "|") "|]\n \\HL\n \\VL ")
-      (dolist (fields field-list)
-        (let ((type (car fields)))
-          (setq fields (cdr fields))
-          (when (= type 3)
-            (muse-insert-markup ""))
-          (insert (car fields))
-          (setq fields (cdr fields))
-          (dolist (field fields)
-            (muse-insert-markup " \\VL ")
-            (insert field))
-          (muse-insert-markup "\\VL\\NR\n \\HL\n \\VL ")
-          (when (= type 2)
-            (muse-insert-markup " "))))
-      (muse-insert-markup "\\stoptable\n")
-      (while (search-backward "VL \\stoptable" nil t)
-        (replace-match "stoptable" nil t)))))
-
-(defun muse-context-fixup-dquotes ()
-  "Fixup double quotes."
-  (goto-char (point-min))
-  (let ((open t))
-    (while (search-forward "\"" nil t)
-      (unless (get-text-property (match-beginning 0) 'read-only)
-        (when (or (bobp)
-                  (eq (char-before) ?\n))
-          (setq open t))
-        (if open
-            (progn
-              (replace-match "``")
-              (setq open nil))
-          (replace-match "''")
-          (setq open t))))))
-
-(defcustom muse-context-permit-contents-tag nil
-  "If nil, ignore <contents> tags.  Otherwise, insert table of contents.
-
-Most of the time, it is best to have a table of contents on the
-first page, with a new page immediately following.  To make this
-work with documents published in both HTML and ConTeXt, we need to
-ignore the <contents> tag.
-
-If you don't agree with this, then set this option to non-nil,
-and it will do what you expect."
-  :type 'boolean
-  :group 'muse-context)
-
-(defun muse-context-fixup-citations ()
-  "Replace semicolons in multi-head citations with colons."
-  (goto-char (point-min))
-  (while (re-search-forward "\\\\cite.?\\[" nil t)
-    (let ((start (point))
-          (end (re-search-forward "]")))
-      (save-restriction
-        (narrow-to-region start end)
-        (goto-char (point-min))
-        (while (re-search-forward ";" nil t)
-          (replace-match ","))))))
-
-(defun muse-context-munge-buffer ()
-  (muse-context-fixup-dquotes)
-  (muse-context-fixup-citations)
-  (when (and muse-context-permit-contents-tag
-             muse-publish-generate-contents)
-    (goto-char (car muse-publish-generate-contents))
-    (muse-insert-markup "\\placecontent")))
-
-(defun muse-context-bibliography ()
-  (save-excursion
-    (goto-char (point-min))
-    (if (re-search-forward "\\\\cite.?\\[" nil t)
-        "\\completepublications[criterium=all]"
-      "")))
-
-(defun muse-context-setup-bibliography ()
-  (save-excursion
-    (goto-char (point-min))
-    (if (re-search-forward "\\\\cite.?\\[" nil t)
-        (concat
-         "\\usemodule[bibltx]\n\\setupbibtex [database="
-         (muse-publishing-directive "bibsource") "]")
-      "")))
-
-(defun muse-context-pdf-browse-file (file)
-  (shell-command (concat "open " file)))
-
-(defun muse-context-pdf-generate (file output-path final-target)
-  (apply
-   #'muse-publish-transform-output
-   file output-path final-target "PDF"
-   (function
-    (lambda (file output-path)
-      (let* ((fnd (file-name-directory output-path))
-             (command (format "%s \"%s\""
-                              muse-context-pdf-program
-                              (file-relative-name file fnd)))
-             (times 0)
-             (default-directory fnd)
-             result)
-        ;; XEmacs can sometimes return a non-number result.  We'll err
-        ;; on the side of caution by continuing to attempt to generate
-        ;; the PDF if this happens and treat the final result as
-        ;; successful.
-        (while (and (< times 2)
-                    (or (not (numberp result))
-                        (not (eq result 0))
-                        ;; table of contents takes 2 passes
-;;                         (file-readable-p
-;;                          (muse-replace-regexp-in-string
-;;                           "\\.tex\\'" ".toc" file t t))
-                        ))
-          (setq result (shell-command command)
-                times (1+ times)))
-        (if (or (not (numberp result))
-                (eq result 0))
-            t
-          nil))))
-   muse-context-pdf-cruft))
-
-(muse-define-style "context"
-                   :suffix    'muse-context-extension
-                   :regexps   'muse-context-markup-regexps
-                   :functions 'muse-context-markup-functions
-                   :strings   'muse-context-markup-strings
-                   :specials  'muse-context-decide-specials
-                   :after     'muse-context-munge-buffer
-                   :header    'muse-context-header
-                   :footer    'muse-context-footer
-                   :browser   'find-file)
-
-(muse-derive-style "context-pdf" "context"
-                   :final   'muse-context-pdf-generate
-                   :browser 'muse-context-pdf-browse-file
-                   :link-suffix 'muse-context-pdf-extension
-                   :osuffix 'muse-context-pdf-extension)
-
-(muse-derive-style "context-slides" "context"
-                   :header  'muse-context-slides-header
-                   :strings 'muse-context-slides-markup-strings)
-
-(muse-derive-style "context-slides-pdf" "context-pdf"
-                   :header  'muse-context-slides-header
-                   :strings 'muse-context-slides-markup-strings)
-
-(provide 'muse-context)
-
-;;; muse-context.el ends here
diff --git a/packages/muse/muse-docbook.el b/packages/muse/muse-docbook.el
deleted file mode 100644
index a54089f..0000000
--- a/packages/muse/muse-docbook.el
+++ /dev/null
@@ -1,352 +0,0 @@
-;;; muse-docbook.el --- publish DocBook files
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;; Dale P. Smith (dpsm AT en DOT com) improved the markup
-;; significantly and made many valuable suggestions.
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse DocBook XML Publishing
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-publish)
-(require 'muse-regexps)
-(require 'muse-xml-common)
-
-(defgroup muse-docbook nil
-  "Options controlling the behavior of Muse DocBook XML publishing.
-See `muse-docbook' for more information."
-  :group 'muse-publish)
-
-(defcustom muse-docbook-extension ".xml"
-  "Default file extension for publishing DocBook XML files."
-  :type 'string
-  :group 'muse-docbook)
-
-(defcustom muse-docbook-header
-  "<?xml version=\"1.0\" encoding=\"<lisp>
-  (muse-docbook-encoding)</lisp>\"?>
-<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook V4.2//EN\"
-                  
\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\";<lisp>(muse-docbook-entities)</lisp>>
-<article>
-  <articleinfo>
-    <title><lisp>(muse-publishing-directive \"title\")</lisp></title>
-    <author><lisp>(muse-docbook-get-author
-                    (muse-publishing-directive \"author\"))</lisp></author>
-    <pubdate><lisp>(muse-publishing-directive \"date\")</lisp></pubdate>
-  </articleinfo>
-  <!-- Page published by Emacs Muse begins here -->\n"
-  "Header used for publishing DocBook XML files.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-docbook)
-
-(defcustom muse-docbook-footer "
-  <!-- Page published by Emacs Muse ends here -->
-<lisp>(muse-docbook-bibliography)</lisp></article>\n"
-  "Footer used for publishing DocBook XML files.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-docbook)
-
-(defcustom muse-docbook-markup-regexps
-  `(;; Beginning of doc, end of doc, or plain paragraph separator
-    (10000 ,(concat "\\(\\(\n\\(?:[" muse-regexp-blank "]*\n\\)*"
-                    "\\([" muse-regexp-blank "]*\n\\)\\)"
-                    "\\|\\`\\s-*\\|\\s-*\\'\\)")
-           3 muse-docbook-markup-paragraph))
-  "List of markup rules for publishing a Muse page to DocBook XML.
-For more on the structure of this list, see `muse-publish-markup-regexps'."
-  :type '(repeat (choice
-                  (list :tag "Markup rule"
-                        integer
-                        (choice regexp symbol)
-                        integer
-                        (choice string function symbol))
-                  function))
-  :group 'muse-docbook)
-
-(defcustom muse-docbook-markup-functions
-  '((anchor . muse-xml-markup-anchor)
-    (table . muse-xml-markup-table))
-  "An alist of style types to custom functions for that kind of text.
-For more on the structure of this list, see
-`muse-publish-markup-functions'."
-  :type '(alist :key-type symbol :value-type function)
-  :group 'muse-docbook)
-
-(defcustom muse-docbook-markup-strings
-  '((image-with-desc . "<mediaobject>
-<imageobject>
-<imagedata fileref=\"%1%.%2%\" format=\"%2%\" />
-</imageobject>
-<caption><para>%3%</para></caption>
-</mediaobject>")
-    (image           . "<inlinemediaobject><imageobject>
-<imagedata fileref=\"%1%.%2%\" format=\"%2%\" />
-</imageobject></inlinemediaobject>")
-    (image-link      . "<ulink url=\"%1%\"><inlinemediaobject><imageobject>
-<imagedata fileref=\"%2%.%3%\" format=\"%3%\" />
-</imageobject></inlinemediaobject></ulink>")
-    (anchor-ref      . "<link linkend=\"%s\">%s</link>")
-    (url             . "<ulink url=\"%s\">%s</ulink>")
-    (link            . "<ulink url=\"%s\">%s</ulink>")
-    (link-and-anchor . "<ulink url=\"%s#%s\">%s</ulink>")
-    (email-addr      . "<email>%s</email>")
-    (anchor          . "<anchor id=\"%s\" />\n")
-    (emdash          . "%s&mdash;%s")
-    (comment-begin   . "<!-- ")
-    (comment-end     . " -->")
-    (rule            . "")
-    (no-break-space  . "&nbsp;")
-    (enddots         . "....")
-    (dots            . "...")
-    (section         . "<section><title>")
-    (section-end     . "</title>")
-    (subsection      . "<section><title>")
-    (subsection-end  . "</title>")
-    (subsubsection   . "<section><title>")
-    (subsubsection-end . "</title>")
-    (section-other   . "<section><title>")
-    (section-other-end . "</title>")
-    (section-close   . "</section>")
-    (footnote        . "<footnote><para>")
-    (footnote-end    . "</para></footnote>")
-    (begin-underline . "")
-    (end-underline   . "")
-    (begin-literal   . "<systemitem>")
-    (end-literal     . "</systemitem>")
-    (begin-emph      . "<emphasis>")
-    (end-emph        . "</emphasis>")
-    (begin-more-emph . "<emphasis role=\"strong\">")
-    (end-more-emph   . "</emphasis>")
-    (begin-most-emph . "<emphasis role=\"strong\"><emphasis>")
-    (end-most-emph   . "</emphasis></emphasis>")
-    (begin-verse     . "<literallayout>\n")
-    (verse-space     . "  ")
-    (end-verse       . "</literallayout>")
-    (begin-example   . "<programlisting>")
-    (end-example     . "</programlisting>")
-    (begin-center    . "<para role=\"centered\">\n")
-    (end-center      . "\n</para>")
-    (begin-quote     . "<blockquote>\n")
-    (end-quote       . "\n</blockquote>")
-    (begin-cite      . "<citation role=\"%s\">")
-    (begin-cite-author . "<citation role=\"%s\">A:")
-    (begin-cite-year . "<citation role=\"%s\">Y:")
-    (end-cite        . "</citation>")
-    (begin-quote-item . "<para>")
-    (end-quote-item  . "</para>")
-    (begin-uli       . "<itemizedlist mark=\"bullet\">\n")
-    (end-uli         . "\n</itemizedlist>")
-    (begin-uli-item  . "<listitem><para>")
-    (end-uli-item    . "</para></listitem>")
-    (begin-oli       . "<orderedlist>\n")
-    (end-oli         . "\n</orderedlist>")
-    (begin-oli-item  . "<listitem><para>")
-    (end-oli-item    . "</para></listitem>")
-    (begin-dl        . "<variablelist>\n")
-    (end-dl          . "\n</variablelist>")
-    (begin-dl-item   . "<varlistentry>\n")
-    (end-dl-item     . "\n</varlistentry>")
-    (begin-ddt       . "<term>")
-    (end-ddt         . "</term>")
-    (begin-dde       . "<listitem><para>")
-    (end-dde         . "</para></listitem>")
-    (begin-table     . "<informaltable>\n")
-    (end-table       . "</informaltable>")
-    (begin-table-group . "  <tgroup cols='%s'>\n")
-    (end-table-group . "  </tgroup>\n")
-    (begin-table-row . "    <row>\n")
-    (end-table-row   . "    </row>\n")
-    (begin-table-entry . "      <entry>")
-    (end-table-entry . "</entry>\n"))
-  "Strings used for marking up text.
-These cover the most basic kinds of markup, the handling of which
-differs little between the various styles."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-docbook)
-
-(defcustom muse-docbook-encoding-default 'utf-8
-  "The default Emacs buffer encoding to use in published files.
-This will be used if no special characters are found."
-  :type 'symbol
-  :group 'muse-docbook)
-
-(defcustom muse-docbook-charset-default "utf-8"
-  "The default DocBook XML charset to use if no translation is
-found in `muse-docbook-encoding-map'."
-  :type 'string
-  :group 'muse-docbook)
-
-(defun muse-docbook-encoding ()
-  (muse-xml-transform-content-type
-   (or (and (boundp 'buffer-file-coding-system)
-            buffer-file-coding-system)
-       muse-docbook-encoding-default)
-   muse-docbook-charset-default))
-
-(defun muse-docbook-markup-paragraph ()
-  (catch 'bail-out
-    (let ((end (copy-marker (match-end 0) t)))
-      (goto-char (match-beginning 0))
-      (when (save-excursion
-              (save-match-data
-                (and (not (get-text-property (max (point-min) (1- (point)))
-                                             'muse-no-paragraph))
-                     (re-search-backward
-                      "<\\(/?\\)\\(para\\|footnote\\|literallayout\\)[ >]"
-                      nil t)
-                     (cond ((string= (match-string 2) "literallayout")
-                            (and (not (string= (match-string 1) "/"))
-                                 (throw 'bail-out t)))
-                           ((string= (match-string 2) "para")
-                            (and
-                             (not (string= (match-string 1) "/"))
-                             ;; don't mess up nested lists
-                             (not (and (muse-looking-back "<listitem>")
-                                       (throw 'bail-out t)))))
-                           ((string= (match-string 2) "footnote")
-                            (string= (match-string 1) "/"))
-                           (t nil)))))
-        (when (get-text-property (1- (point)) 'muse-end-list)
-          (goto-char (previous-single-property-change (1- (point))
-                                                      'muse-end-list)))
-        (muse-insert-markup "</para>"))
-      (goto-char end))
-    (cond
-     ((eobp)
-      (unless (bolp)
-        (insert "\n")))
-     ((get-text-property (point) 'muse-no-paragraph)
-      (forward-char 1)
-      nil)
-     ((eq (char-after) ?\<)
-      (when (looking-at (concat "<\\(emphasis\\|systemitem\\|inlinemediaobject"
-                                "\\|u?link\\|anchor\\|email\\)[ >]"))
-        (muse-insert-markup "<para>")))
-     (t
-      (muse-insert-markup "<para>")))))
-
-(defun muse-docbook-get-author (&optional author)
-  "Split the AUTHOR directive into separate fields.
-AUTHOR should be of the form: \"Firstname Other Names Lastname\",
-and anything after `Firstname' is optional."
-  (setq author (save-match-data (split-string author)))
-  (let ((num-el (length author)))
-    (cond ((eq num-el 1)
-           (concat "<firstname>" (car author) "</firstname>"))
-          ((eq num-el 2)
-           (concat "<firstname>" (nth 0 author) "</firstname>"
-                   "<surname>" (nth 1 author) "</surname>"))
-          ((eq num-el 3)
-           (concat "<firstname>" (nth 0 author) "</firstname>"
-                   "<othername>" (nth 1 author) "</othername>"
-                   "<surname>" (nth 2 author) "</surname>"))
-          (t
-           (let (first last)
-             (setq first (car author))
-             (setq author (nreverse (cdr author)))
-             (setq last (car author))
-             (setq author (nreverse (cdr author)))
-             (concat "<firstname>" first "</firstname>"
-                     "<othername>"
-                     (mapconcat 'identity author " ")
-                     "</othername>"
-                     "<surname>" last "</surname>"))))))
-
-(defun muse-docbook-fixup-images ()
-  (goto-char (point-min))
-  (while (re-search-forward (concat "<imagedata fileref=\"[^\"]+\""
-                                    " format=\"\\([^\"]+\\)\" />$")
-                            nil t)
-    (replace-match (upcase (match-string 1)) t t nil 1)))
-
-(defun muse-docbook-fixup-citations ()
-  ;; remove the role attribute if there is no role
-  (goto-char (point-min))
-  (while (re-search-forward "<\\(citation role=\"nil\"\\)>" nil t)
-    (replace-match "citation" t t nil 1))
-  ;; replace colons in multi-head citations with semicolons
-  (goto-char (point-min))
-  (while (re-search-forward "<citation.*>" nil t)
-    (let ((start (point))
-          (end (re-search-forward "</citation>")))
-      (save-restriction
-        (narrow-to-region start end)
-        (goto-char (point-min))
-        (while (re-search-forward "," nil t)
-          (replace-match ";"))))))
-
-(defun muse-docbook-munge-buffer ()
-  (muse-docbook-fixup-images)
-  (muse-docbook-fixup-citations))
-
-(defun muse-docbook-entities ()
-  (save-excursion
-    (goto-char (point-min))
-    (if (re-search-forward "<citation" nil t)
-        (concat
-         " [\n<!ENTITY bibliography SYSTEM \""
-         (if (string-match ".short$" (muse-page-name))
-             (substring (muse-page-name) 0 -6)
-           (muse-page-name))
-         ".bib.xml\">\n]")
-      "")))
-
-(defun muse-docbook-bibliography ()
-  (save-excursion
-    (goto-char (point-min))
-    (if (re-search-forward "<citation" nil t)
-        "&bibliography;\n"
-      "")))
-
-(defun muse-docbook-finalize-buffer ()
-  (when (boundp 'buffer-file-coding-system)
-    (when (memq buffer-file-coding-system '(no-conversion undecided-unix))
-      ;; make it agree with the default charset
-      (setq buffer-file-coding-system muse-docbook-encoding-default))))
-
-;;; Register the Muse DocBook XML Publisher
-
-(muse-define-style "docbook"
-                   :suffix     'muse-docbook-extension
-                   :regexps    'muse-docbook-markup-regexps
-                   :functions  'muse-docbook-markup-functions
-                   :strings    'muse-docbook-markup-strings
-                   :specials   'muse-xml-decide-specials
-                   :before-end 'muse-docbook-munge-buffer
-                   :after      'muse-docbook-finalize-buffer
-                   :header     'muse-docbook-header
-                   :footer     'muse-docbook-footer
-                   :browser    'find-file)
-
-(provide 'muse-docbook)
-
-;;; muse-docbook.el ends here
diff --git a/packages/muse/muse-groff.el b/packages/muse/muse-groff.el
deleted file mode 100644
index 7218652..0000000
--- a/packages/muse/muse-groff.el
+++ /dev/null
@@ -1,274 +0,0 @@
-;;; muse-groff.el --- publish groff -mom -mwww files
-
-;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; Author: Andrew J. Korty (ajk AT iu DOT edu)
-;; Date: Tue 5-Jul-2005
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse Publishing Using groff -mom -mwww
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-publish)
-
-(defgroup muse-groff nil
-  "Rules for marking up a Muse file with groff -mom -mwww macros."
-  :group 'muse-publish)
-
-(defcustom muse-groff-extension ".groff"
-  "Default file extension for publishing groff -mom -mwww files."
-  :type 'string
-  :group 'muse-groff)
-
-(defcustom muse-groff-pdf-extension ".pdf"
-  "Default file extension for publishing groff -mom -mwww files to PDF."
-  :type 'string
-  :group 'muse-groff)
-
-(defcustom muse-groff-header
-  ".TITLE \"<lisp>(muse-publishing-directive \"title\")</lisp>\"
-.SUBTITLE \"<lisp>(muse-publishing-directive \"date\")</lisp>\"
-.AUTHOR \"<lisp>(muse-publishing-directive \"author\")</lisp>\"
-.PRINTSTYLE TYPESET
-.de list
-.    LIST \\$1
-.    SHIFT_LIST \\$2
-..
-.PARA_INDENT 0
-.START
-<lisp>(and muse-publish-generate-contents \".TOC\n\")</lisp>\n"
-  "Header used for publishing groff -mom -mwww files."
-  :type '(choice string file)
-  :group 'muse-groff)
-
-(defcustom muse-groff-footer " "
-  "Footer used for publishing groff -mom -mwww files."
-  :type '(choice string file)
-  :group 'muse-groff)
-
-(defcustom muse-groff-markup-regexps
-  `((10400 ,(concat "\\(\n</\\(blockquote\\|center\\)>\\)?\n"
-                    "\\(["
-                    muse-regexp-blank
-                    "]*\n\\)+\\(<\\(blockquote\\|center\\)>\n\\)?")
-           0 muse-groff-markup-paragraph))
-"List of markup regexps for identifying regions in a Muse page.
-For more on the structure of this list, see `muse-publish-markup-regexps'."
-  :type '(repeat (choice
-                  (list :tag "Markup rule"
-                        integer
-                        (choice regexp symbol)
-                        integer
-                        (choice string function symbol))
-                  function))
-  :group 'muse-groff)
-
-(defcustom muse-groff-markup-functions
-  '((table . muse-groff-markup-table))
-  "An alist of style types to custom functions for that kind of text.
-For more on the structure of this list, see
-`muse-publish-markup-functions'."
-  :type '(alist :key-type symbol :value-type function)
-  :group 'muse-groff)
-
-(defcustom muse-groff-markup-tags
-  '()
-  "A list of tag specifications, for specially marking up GROFF."
-  :type '(repeat (list (string :tag "Markup tag")
-                       (boolean :tag "Expect closing tag" :value t)
-                       (boolean :tag "Parse attributes" :value nil)
-                       (boolean :tag "Nestable" :value nil)
-                       function))
-  :group 'muse-groff)
-
-(defcustom muse-groff-markup-strings
-  `((image-with-desc . "\n.MPIMG -R %s.%s\n")
-    (image           . "\n.MPIMG -R %s.%s\n")
-    (image-link      . "\n.\\\" %s\n.MPIMG -R %s.%s")
-    (url             . "\n.URL %s %s\n\\z")
-    (link            . "\n.URL %s %s\n\\z")
-    (email-addr      . "\f[C]%s\f[]")
-    (emdash          . "\\(em")
-    (rule            . "\n.RULE\n")
-    (no-break-space  . "\\h")
-    (line-break      . "\\p")
-    (enddots         . "....")
-    (dots            . "...")
-;;     (part            . "\\part{")
-;;     (part-end        . "}")
-;;     (chapter         . "\\chapter{")
-;;     (chapter-end     . "}")
-    (section         . ".HEAD \"")
-    (section-end     . "\"")
-    (subsection      . ".SUBHEAD \"")
-    (subsection-end  . "\"")
-    (subsubsection   . ".PARAHEAD \"")
-    (subsubsection-end . "\"")
-;;     (footnote        . "\\c\n.FOOTNOTE\n")
-;;     (footnote-end    . "\n.FOOTNOTE OFF\n")
-;;     (footnotemark    . "\\footnotemark[%d]")
-;;     (footnotetext    . "\\footnotetext[%d]{")
-;;     (footnotetext-end . "}")
-    (begin-underline . "\n.UNDERSCORE \"")
-    (end-underline   . "\"\n")
-    (begin-literal   . "\\fC")
-    (end-literal     . "\\fP")
-    (begin-emph      . "\\fI")
-    (end-emph        . "\\fP")
-    (begin-more-emph . "\\fB")
-    (end-more-emph   . "\\fP")
-    (begin-most-emph . "\\f(BI")
-    (end-most-emph   . "\\fP")
-    (begin-verse     . ".QUOTE")
-    (end-verse       . ".QUOTE OFF")
-    (begin-center    . "\n.CENTER\n")
-    (end-center      . "\n.QUAD L\n")
-    (begin-example   . ,(concat
-                         ".QUOTE_FONT CR\n.QUOTE_INDENT 1\n"".QUOTE_SIZE -2\n"
-                         ".UNDERLINE_QUOTES OFF\n.QUOTE"))
-    (end-example     . ".QUOTE OFF")
-    (begin-quote     . ".BLOCKQUOTE")
-    (end-quote       . ".BLOCKQUOTE OFF")
-    (begin-cite     . "")
-    (begin-cite-author . "")
-    (begin-cite-year . "")
-    (end-cite        . "")
-    (begin-uli       . ".list BULLET\n.SHIFT_LIST 2m\n.ITEM\n")
-    (end-uli         . "\n.LIST OFF")
-    (begin-oli       . ".list DIGIT\n.SHIFT_LIST 2m\n.ITEM\n")
-    (end-oli         . "\n.LIST OFF")
-    (begin-ddt       . "\\fB")
-    (begin-dde       . "\\fP\n.IR 4P\n")
-    (end-ddt         . ".IRX CLEAR"))
-  "Strings used for marking up text.
-These cover the most basic kinds of markup, the handling of which
-differs little between the various styles."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-groff)
-
-(defcustom muse-groff-markup-specials
-  '((?\\ . "\\e"))
-  "A table of characters which must be represented specially."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-groff)
-
-(defun muse-groff-markup-paragraph ()
-  (let ((end (copy-marker (match-end 0) t)))
-    (goto-char (1+ (match-beginning 0)))
-    (delete-region (point) end)
-    (unless (looking-at "\.\\(\\(\\(SUB\\|PARA\\)?HEAD \\)\\|RULE$\\)")
-      (muse-insert-markup ".ALD .5v\n.PP\n.ne 2\n"))))
-
-(defun muse-groff-protect-leading-chars ()
-  "Protect leading periods and apostrophes from being interpreted as
-command characters."
-  (while (re-search-forward "^[.']" nil t)
-    (replace-match "\\\\&\\&" t)))
-
-(defun muse-groff-concat-lists ()
-  "Join like lists."
-  (let ((type "")
-        arg begin)
-    (while (re-search-forward "^\.LIST[ \t]+\\(.*\\)\n" nil t)
-      (setq arg (match-string 1))
-      (if (string= arg "OFF")
-          (setq begin (match-beginning 0))
-        (if (and begin (string= type arg))
-            (delete-region begin (match-end 0))
-          (setq type arg
-                begin 0))))))
-
-(defun muse-groff-fixup-dquotes ()
-  "Fixup double quotes."
-  (let ((open t))
-    (while (search-forward "\"" nil t)
-      (unless (get-text-property (match-beginning 0) 'read-only)
-        (if (and (bolp) (eq (char-before) ?\n))
-            (setq open t))
-        (if open
-            (progn
-              (replace-match "``")
-              (setq open nil))
-          (replace-match "''")
-          (setq open t))))))
-
-(defun muse-groff-prepare-buffer ()
-  (goto-char (point-min))
-  (muse-groff-protect-leading-chars))
-
-(defun muse-groff-munge-buffer ()
-  (goto-char (point-min))
-  (muse-groff-concat-lists))
-
-(defun muse-groff-pdf-browse-file (file)
-  (shell-command (concat "open " file)))
-
-(defun muse-groff-pdf-generate (file output-path final-target)
-  (muse-publish-transform-output
-   file output-path final-target "PDF"
-   (function
-    (lambda (file output-path)
-      (let ((command
-             (format
-              (concat "file=%s; ext=%s; cd %s && cp $file$ext $file.ref && "
-                      "groff -mom -mwww -t $file$ext > $file.ps && "
-                      "pstopdf $file.ps")
-              (file-name-sans-extension file)
-              muse-groff-extension
-              (file-name-directory output-path))))
-        (shell-command command))))
-   ".ps"))
-
-;;; Register the Muse GROFF Publisher
-
-(muse-define-style "groff"
-                   :suffix    'muse-groff-extension
-                   :regexps   'muse-groff-markup-regexps
-;;;               :functions 'muse-groff-markup-functions
-                   :strings   'muse-groff-markup-strings
-                   :tags      'muse-groff-markup-tags
-                   :specials  'muse-groff-markup-specials
-                   :before    'muse-groff-prepare-buffer
-                   :before-end 'muse-groff-munge-buffer
-                   :header    'muse-groff-header
-                   :footer    'muse-groff-footer
-                   :browser   'find-file)
-
-(muse-derive-style "groff-pdf" "groff"
-                   :final   'muse-groff-pdf-generate
-                   :browser 'muse-groff-pdf-browse-file
-                   :osuffix 'muse-groff-pdf-extension)
-
-(provide 'muse-groff)
-
-;;; muse-groff.el ends here
-;;
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; End:
diff --git a/packages/muse/muse-html.el b/packages/muse/muse-html.el
deleted file mode 100644
index bcdee56..0000000
--- a/packages/muse/muse-html.el
+++ /dev/null
@@ -1,756 +0,0 @@
-;;; muse-html.el --- publish to HTML and XHTML
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2014
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;; Zhiqiang Ye (yezq AT mail DOT cbi DOT pku DOT edu DOT cn) suggested
-;; appending an 'encoding="..."' fragment to the first line of the
-;; sample publishing header so that when editing the resulting XHTML
-;; file, Emacs would use the proper encoding.
-
-;; Sun Jiyang (sunyijiang AT gmail DOT com) came up with the idea for
-;; the <src> tag and provided an implementation for emacs-wiki.
-
-;; Charles Wang (wcy123 AT gmail DOT com) provided an initial
-;; implementation of the <src> tag for Muse.
-
-;; Clinton Ebadi (clinton AT unknownlamer DOT org) provided further
-;; ideas for the implementation of the <src> tag.
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse HTML Publishing
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-publish)
-(require 'muse-regexps)
-(require 'muse-xml-common)
-
-(defgroup muse-html nil
-  "Options controlling the behavior of Muse HTML publishing."
-  :group 'muse-publish)
-
-(defcustom muse-html-extension ".html"
-  "Default file extension for publishing HTML files."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-xhtml-extension ".html"
-  "Default file extension for publishing XHTML files."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-html-style-sheet
-  "<style type=\"text/css\">
-body {
-  background: white; color: black;
-  margin-left: 3%; margin-right: 7%;
-}
-
-p { margin-top: 1% }
-p.verse { margin-left: 3% }
-
-.example { margin-left: 3% }
-
-h2 {
-  margin-top: 25px;
-  margin-bottom: 0px;
-}
-h3 { margin-bottom: 0px; }
-    </style>"
-  "Store your stylesheet definitions here.
-This is used in `muse-html-header'.
-You can put raw CSS in here or a <link> tag to an external stylesheet.
-This text may contain <lisp> markup tags.
-
-An example of using <link> is as follows.
-
-<link rel=\"stylesheet\" type=\"text/css\" charset=\"utf-8\" media=\"all\" 
href=\"/default.css\">"
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-xhtml-style-sheet
-  "<style type=\"text/css\">
-body {
-  background: white; color: black;
-  margin-left: 3%; margin-right: 7%;
-}
-
-p { margin-top: 1% }
-p.verse { margin-left: 3% }
-
-.example { margin-left: 3% }
-
-h2 {
-  margin-top: 25px;
-  margin-bottom: 0px;
-}
-h3 { margin-bottom: 0px; }
-    </style>"
-  "Store your stylesheet definitions here.
-This is used in `muse-xhtml-header'.
-You can put raw CSS in here or a <link> tag to an external stylesheet.
-This text may contain <lisp> markup tags.
-
-An example of using <link> is as follows.
-
-<link rel=\"stylesheet\" type=\"text/css\" charset=\"utf-8\" media=\"all\" 
href=\"/default.css\" />"
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-html-header
-  "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
-<html>
-  <head>
-    <title><lisp>
-  (concat (muse-publishing-directive \"title\")
-          (let ((author (muse-publishing-directive \"author\")))
-            (if (not (string= author (user-full-name)))
-                (concat \" (by \" author \")\"))))</lisp></title>
-    <meta name=\"generator\" content=\"muse.el\">
-    <meta http-equiv=\"<lisp>muse-html-meta-http-equiv</lisp>\"
-          content=\"<lisp>muse-html-meta-content-type</lisp>\">
-    <lisp>
-      (let ((maintainer (muse-style-element :maintainer)))
-        (when maintainer
-          (concat \"<link rev=\\\"made\\\" href=\\\"\" maintainer \"\\\">\")))
-    </lisp><lisp>
-      (muse-style-element :style-sheet muse-publishing-current-style)
-    </lisp>
-  </head>
-  <body>
-    <h1><lisp>
-  (concat (muse-publishing-directive \"title\")
-          (let ((author (muse-publishing-directive \"author\")))
-            (if (not (string= author (user-full-name)))
-                (concat \" (by \" author \")\"))))</lisp></h1>
-    <!-- Page published by Emacs Muse begins here -->\n"
-  "Header used for publishing HTML files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-html-footer "
-<!-- Page published by Emacs Muse ends here -->
-  </body>
-</html>\n"
-  "Footer used for publishing HTML files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-xhtml-header
-  "<?xml version=\"1.0\" encoding=\"<lisp>
-  (muse-html-encoding)</lisp>\"?>
-<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
-    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\";>
-<html xmlns=\"http://www.w3.org/1999/xhtml\";>
-  <head>
-    <title><lisp>
-  (concat (muse-publishing-directive \"title\")
-          (let ((author (muse-publishing-directive \"author\")))
-            (if (not (string= author (user-full-name)))
-                (concat \" (by \" author \")\"))))</lisp></title>
-    <meta name=\"generator\" content=\"muse.el\" />
-    <meta http-equiv=\"<lisp>muse-html-meta-http-equiv</lisp>\"
-          content=\"<lisp>muse-html-meta-content-type</lisp>\" />
-    <lisp>
-      (let ((maintainer (muse-style-element :maintainer)))
-        (when maintainer
-          (concat \"<link rev=\\\"made\\\" href=\\\"\" maintainer \"\\\" 
/>\")))
-    </lisp><lisp>
-      (muse-style-element :style-sheet muse-publishing-current-style)
-    </lisp>
-  </head>
-  <body>
-    <h1><lisp>
-  (concat (muse-publishing-directive \"title\")
-          (let ((author (muse-publishing-directive \"author\")))
-            (if (not (string= author (user-full-name)))
-                (concat \" (by \" author \")\"))))</lisp></h1>
-    <!-- Page published by Emacs Muse begins here -->\n"
-  "Header used for publishing XHTML files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-xhtml-footer "
-<!-- Page published by Emacs Muse ends here -->
-  </body>
-</html>\n"
-  "Footer used for publishing XHTML files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-html-anchor-on-word nil
-  "When true, anchors surround the closest word. This allows you
-to select them in a browser (i.e. for pasting), but has the
-side-effect of marking up headers in multiple colors if your
-header style is different from your link style."
-  :type 'boolean
-  :group 'muse-html)
-
-(defcustom muse-html-table-attributes
-  " class=\"muse-table\" border=\"2\" cellpadding=\"5\""
-  "The attribute to be used with HTML <table> tags.
-Note that Muse supports insertion of raw HTML tags, as long
-as you wrap the region in <literal></literal>."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-html-markup-regexps
-  `(;; Beginning of doc, end of doc, or plain paragraph separator
-    (10000 ,(concat "\\(\\(\n\\(?:[" muse-regexp-blank "]*\n\\)*"
-                    "\\([" muse-regexp-blank "]*\n\\)\\)"
-                    "\\|\\`\\s-*\\|\\s-*\\'\\)")
-           ;; this is somewhat repetitive because we only require the
-           ;; line just before the paragraph beginning to be not
-           ;; read-only
-           3 muse-html-markup-paragraph))
-  "List of markup rules for publishing a Muse page to HTML.
-For more on the structure of this list, see `muse-publish-markup-regexps'."
-  :type '(repeat (choice
-                  (list :tag "Markup rule"
-                        integer
-                        (choice regexp symbol)
-                        integer
-                        (choice string function symbol))
-                  function))
-  :group 'muse-html)
-
-(defcustom muse-html-markup-functions
-  '((anchor   . muse-html-markup-anchor)
-    (table    . muse-html-markup-table)
-    (footnote . muse-html-markup-footnote))
-  "An alist of style types to custom functions for that kind of text.
-For more on the structure of this list, see
-`muse-publish-markup-functions'."
-  :type '(alist :key-type symbol :value-type function)
-  :group 'muse-html)
-
-(defcustom muse-html-markup-strings
-  '((image-with-desc . "<table class=\"image\" width=\"100%%\">
-  <tr><td align=\"center\"><img src=\"%1%.%2%\" alt=\"%3%\"></td></tr>
-  <tr><td align=\"center\" class=\"image-caption\">%3%</td></tr>
-</table>")
-    (image           . "<img src=\"%s.%s\" alt=\"\">")
-    (image-link      . "<a class=\"image-link\" href=\"%s\">
-<img src=\"%s.%s\"></a>")
-    (anchor-ref      . "<a href=\"#%s\">%s</a>")
-    (url             . "<a href=\"%s\">%s</a>")
-    (link            . "<a href=\"%s\">%s</a>")
-    (link-and-anchor . "<a href=\"%s#%s\">%s</a>")
-    (email-addr      . "<a href=\"mailto:%s\";>%s</a>")
-    (anchor          . "<a name=\"%1%\" id=\"%1%\">")
-    (emdash          . "%s&mdash;%s")
-    (comment-begin   . "<!-- ")
-    (comment-end     . " -->")
-    (rule            . "<hr>")
-    (fn-sep          . "<hr>\n")
-    (no-break-space  . "&nbsp;")
-    (line-break      . "<br>")
-    (enddots         . "....")
-    (dots            . "...")
-    (section         . "<h2>")
-    (section-end     . "</h2>")
-    (subsection      . "<h3>")
-    (subsection-end  . "</h3>")
-    (subsubsection   . "<h4>")
-    (subsubsection-end . "</h4>")
-    (section-other   . "<h5>")
-    (section-other-end . "</h5>")
-    (begin-underline . "<u>")
-    (end-underline   . "</u>")
-    (begin-literal   . "<code>")
-    (end-literal     . "</code>")
-    (begin-cite      . "<span class=\"citation\">")
-    (begin-cite-author . "<span class=\"citation-author\">")
-    (begin-cite-year . "<span class=\"citation-year\">")
-    (end-cite        . "</span>")
-    (begin-emph      . "<em>")
-    (end-emph        . "</em>")
-    (begin-more-emph . "<strong>")
-    (end-more-emph   . "</strong>")
-    (begin-most-emph . "<strong><em>")
-    (end-most-emph   . "</em></strong>")
-    (begin-verse     . "<p class=\"verse\">\n")
-    (verse-space     . "&nbsp;&nbsp;")
-    (end-verse-line  . "<br>")
-    (end-last-stanza-line . "<br>")
-    (empty-verse-line . "<br>")
-    (end-verse       . "</p>")
-    (begin-example   . "<pre class=\"example\">")
-    (end-example     . "</pre>")
-    (begin-center    . "<center>\n<p>")
-    (end-center      . "</p>\n</center>")
-    (begin-quote     . "<blockquote>\n")
-    (end-quote       . "\n</blockquote>")
-    (begin-quote-item . "<p class=\"quoted\">")
-    (end-quote-item  . "</p>")
-    (begin-uli       . "<ul>\n")
-    (end-uli         . "\n</ul>")
-    (begin-uli-item  . "<li>")
-    (end-uli-item    . "</li>")
-    (begin-oli       . "<ol>\n")
-    (end-oli         . "\n</ol>")
-    (begin-oli-item  . "<li>")
-    (end-oli-item    . "</li>")
-    (begin-dl        . "<dl>\n")
-    (end-dl          . "\n</dl>")
-    (begin-ddt       . "<dt><strong>")
-    (end-ddt         . "</strong></dt>")
-    (begin-dde       . "<dd>")
-    (end-dde         . "</dd>")
-    (begin-table     . "<table%s>\n")
-    (end-table       . "</table>")
-    (begin-table-row . "    <tr>\n")
-    (end-table-row   . "    </tr>\n")
-    (begin-table-entry . "      <%s>")
-    (end-table-entry . "</%s>\n"))
-  "Strings used for marking up text as HTML.
-These cover the most basic kinds of markup, the handling of which
-differs little between the various styles."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-html)
-
-(defcustom muse-xhtml-markup-strings
-  '((image-with-desc . "<table class=\"image\" width=\"100%%\">
-  <tr><td align=\"center\"><img src=\"%1%.%2%\" alt=\"%3%\" /></td></tr>
-  <tr><td align=\"center\" class=\"image-caption\">%3%</td></tr>
-</table>")
-    (image           . "<img src=\"%s.%s\" alt=\"\" />")
-    (image-link      . "<a class=\"image-link\" href=\"%s\">
-<img src=\"%s.%s\" alt=\"\" /></a>")
-    (rule            . "<hr />")
-    (fn-sep          . "<hr />\n")
-    (line-break      . "<br />")
-    (begin-underline . "<span style=\"text-decoration: underline;\">")
-    (end-underline   . "</span>")
-    (begin-center    . "<p style=\"text-align: center;\">\n")
-    (end-center      . "\n</p>")
-    (end-verse-line  . "<br />")
-    (end-last-stanza-line . "<br />")
-    (empty-verse-line . "<br />"))
-  "Strings used for marking up text as XHTML.
-These cover the most basic kinds of markup, the handling of which
-differs little between the various styles.
-
-If a markup rule is not found here, `muse-html-markup-strings' is
-searched."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-html)
-
-(defcustom muse-xhtml1.1-markup-strings
-  '((anchor          . "<a id=\"%s\">"))
-  "Strings used for marking up text as XHTML 1.1.
-These cover the most basic kinds of markup, the handling of which
-differs little between the various styles.
-
-If a markup rule is not found here, `muse-xhtml-markup-strings'
-and `muse-html-markup-strings' are searched."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-html)
-
-(defcustom muse-html-markup-tags
-  '(("class" t t   t muse-html-class-tag)
-    ("div"   t t   t muse-html-div-tag)
-    ("src"   t t nil muse-html-src-tag))
- "A list of tag specifications, for specially marking up HTML."
-  :type '(repeat (list (string :tag "Markup tag")
-                       (boolean :tag "Expect closing tag" :value t)
-                       (boolean :tag "Parse attributes" :value nil)
-                       (boolean :tag "Nestable" :value nil)
-                       function))
-  :group 'muse-html)
-
-(defcustom muse-html-meta-http-equiv "Content-Type"
-  "The http-equiv attribute used for the HTML <meta> tag."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-html-meta-content-type "text/html"
-  "The content type used for the HTML <meta> tag.
-If you are striving for XHTML 1.1 compliance, you may want to
-change this to \"application/xhtml+xml\"."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-html-meta-content-encoding (if (featurep 'mule)
-                                              'detect
-                                            "iso-8859-1")
-  "The charset to append to the HTML <meta> tag.
-If set to the symbol `detect', use `muse-html-encoding-map' to try
-and determine the HTML charset from emacs's coding.  If set to a
-string, this string will be used to force a particular charset"
-  :type '(choice string symbol)
-  :group 'muse-html)
-
-(defcustom muse-html-encoding-default 'iso-8859-1
-  "The default Emacs buffer encoding to use in published files.
-This will be used if no special characters are found."
-  :type 'symbol
-  :group 'muse-html)
-
-(defcustom muse-html-charset-default "iso-8859-1"
-  "The default HTML meta charset to use if no translation is found in
-`muse-html-encoding-map'."
-  :type 'string
-  :group 'muse-html)
-
-(defcustom muse-html-src-allowed-modes t
-  "Modes that we allow the <src> tag to colorize.
-If t, permit the <src> tag to colorize any mode.
-
-If a list of mode names, such as (\"html\" \"latex\"), and the
-lang argument to <src> is not in the list, then use fundamental
-mode instead."
-  :type '(choice (const :tag "Any" t)
-                 (repeat (string :tag "Mode")))
-  :group 'muse-html)
-
-(defun muse-html-insert-anchor (anchor)
-  "Insert an anchor, either around the word at point, or within a tag."
-  (skip-chars-forward (concat muse-regexp-blank "\n"))
-  (if (looking-at (concat "<\\([^" muse-regexp-blank "/>\n]+\\)>"))
-      (let ((tag (match-string 1)))
-        (goto-char (match-end 0))
-        (muse-insert-markup (muse-markup-text 'anchor anchor))
-        (when muse-html-anchor-on-word
-          (or (and (search-forward (format "</%s>" tag)
-                                   (muse-line-end-position) t)
-                   (goto-char (match-beginning 0)))
-              (forward-word 1)))
-        (muse-insert-markup "</a>"))
-    (muse-insert-markup (muse-markup-text 'anchor anchor))
-    (when muse-html-anchor-on-word
-      (forward-word 1))
-    (muse-insert-markup "</a>\n")))
-
-(defun muse-html-markup-anchor ()
-  (unless (get-text-property (match-end 1) 'muse-link)
-    (save-match-data
-      (muse-html-insert-anchor (match-string 2)))
-    (match-string 1)))
-
-(defun muse-html-markup-paragraph ()
-  (let ((end (copy-marker (match-end 0) t)))
-    (goto-char (match-beginning 0))
-    (when (save-excursion
-            (save-match-data
-              (and (not (get-text-property (max (point-min) (1- (point)))
-                                           'muse-no-paragraph))
-                   (re-search-backward "<\\(/?\\)p[ >]" nil t)
-                   (not (string-equal (match-string 1) "/")))))
-      (when (get-text-property (1- (point)) 'muse-end-list)
-        (goto-char (previous-single-property-change (1- (point))
-                                                    'muse-end-list)))
-      (muse-insert-markup "</p>"))
-    (goto-char end))
-  (cond
-   ((eobp)
-    (unless (bolp)
-      (insert "\n")))
-   ((get-text-property (point) 'muse-no-paragraph)
-    (forward-char 1)
-    nil)
-   ((eq (char-after) ?\<)
-    (cond
-     ((looking-at "<\\(em\\|strong\\|code\\|span\\)[ >]")
-      (muse-insert-markup "<p>"))
-     ((looking-at "<a ")
-      (if (looking-at "<a[^>\n]+><img")
-          (muse-insert-markup "<p class=\"image-link\">")
-        (muse-insert-markup "<p>")))
-     ((looking-at "<img[ >]")
-      (muse-insert-markup "<p class=\"image\">"))
-     (t
-      (forward-char 1)
-      nil)))
-   ((muse-looking-back "\\(</h[1-4]>\\|<hr>\\)\n\n")
-    (muse-insert-markup "<p class=\"first\">"))
-   (t
-    (muse-insert-markup "<p>"))))
-
-(defun muse-html-markup-footnote ()
-  (cond
-   ((get-text-property (match-beginning 0) 'muse-link)
-    nil)
-   ((= (muse-line-beginning-position) (match-beginning 0))
-    (prog1
-        (let ((text (match-string 1)))
-          (muse-insert-markup
-           (concat "<p class=\"footnote\">"
-                   "<a class=\"footnum\" name=\"fn." text
-                   "\" href=\"#fnr." text "\">"
-                   text ".</a>")))
-      (save-excursion
-        (save-match-data
-          (let* ((beg (goto-char (match-end 0)))
-                 (end (and (search-forward "\n\n" nil t)
-                           (prog1
-                               (copy-marker (match-beginning 0))
-                             (goto-char beg)))))
-            (while (re-search-forward (concat "^["
-                                              muse-regexp-blank
-                                              "]+\\([^\n]\\)")
-                                      end t)
-              (replace-match "\\1" t)))))
-      (replace-match "")))
-   (t (let ((text (match-string 1)))
-        (muse-insert-markup
-         (concat "<sup><a class=\"footref\" name=\"fnr." text
-                 "\" href=\"#fn." text "\">"
-                 text "</a></sup>")))
-      (replace-match ""))))
-
-(defun muse-html-markup-table ()
-  (muse-xml-markup-table muse-html-table-attributes))
-
-;; Handling of tags for HTML
-
-(defun muse-html-strip-links (string)
-  "Remove all HTML links from STRING."
-  (muse-replace-regexp-in-string "\\(<a .*?>\\|</a>\\)" "" string nil t))
-
-(defun muse-html-insert-contents (depth)
-  "Scan the current document and generate a table of contents at point.
-DEPTH indicates how many levels of headings to include.  The default is 2."
-  (let ((max-depth (or depth 2))
-        (index 1)
-        base contents l end)
-    (save-excursion
-      (goto-char (point-min))
-      (search-forward "Page published by Emacs Muse begins here" nil t)
-      (catch 'done
-        (while (re-search-forward "<h\\([0-9]+\\)>\\(.+?\\)</h\\1>$" nil t)
-          (unless (and (get-text-property (point) 'read-only)
-                       (not (get-text-property (match-beginning 0)
-                                               'muse-contents)))
-            (remove-text-properties (match-beginning 0) (match-end 0)
-                                    '(muse-contents nil))
-            (setq l (1- (string-to-number (match-string 1))))
-            (if (null base)
-                (setq base l)
-              (if (< l base)
-                  (throw 'done t)))
-            (when (<= l max-depth)
-              ;; escape specials now before copying the text, so that we
-              ;; can deal sanely with both emphasis in titles and
-              ;; special characters
-              (goto-char (match-end 2))
-              (setq end (point-marker))
-              (muse-publish-escape-specials (match-beginning 2) end
-                                            nil 'document)
-              (muse-publish-mark-read-only (match-beginning 2) end)
-              (setq contents (cons (cons l (buffer-substring-no-properties
-                                            (match-beginning 2) end))
-                                   contents))
-              (set-marker end nil)
-              (goto-char (match-beginning 2))
-              (muse-html-insert-anchor (concat "sec" (int-to-string index)))
-              (setq index (1+ index)))))))
-    (setq index 1 contents (nreverse contents))
-    (let ((depth 1) (sub-open 0) (p (point)))
-      (muse-insert-markup "<div class=\"contents\">\n<dl>\n")
-      (while contents
-        (muse-insert-markup "<dt>\n"
-                            "<a href=\"#sec" (int-to-string index) "\">"
-                            (muse-html-strip-links (cdar contents))
-                            "</a>\n"
-                            "</dt>\n")
-        (setq index (1+ index)
-              depth (caar contents)
-              contents (cdr contents))
-        (when contents
-          (cond
-           ((< (caar contents) depth)
-            (let ((idx (caar contents)))
-              (while (< idx depth)
-                (muse-insert-markup "</dl>\n</dd>\n")
-                (setq sub-open (1- sub-open)
-                      idx (1+ idx)))))
-           ((> (caar contents) depth) ; can't jump more than one ahead
-            (muse-insert-markup "<dd>\n<dl>\n")
-            (setq sub-open (1+ sub-open))))))
-      (while (> sub-open 0)
-        (muse-insert-markup "</dl>\n</dd>\n")
-        (setq sub-open (1- sub-open)))
-      (muse-insert-markup "</dl>\n</div>\n")
-      (muse-publish-mark-read-only p (point)))))
-
-(defun muse-html-denote-headings ()
-  "Place a text property on any headings in the current buffer.
-This allows the headings to be picked up later on if publishing a
-table of contents."
-  (save-excursion
-    (goto-char (point-min))
-    (search-forward "Page published by Emacs Muse begins here" nil t)
-    (while (re-search-forward "<h\\([0-9]+\\)>\\(.+?\\)</h\\1>$" nil t)
-      (unless (get-text-property (point) 'read-only)
-        (add-text-properties (match-beginning 0) (match-end 0)
-                             '(muse-contents t))))))
-
-(defun muse-html-class-tag (beg end attrs)
-  (let ((name (cdr (assoc "name" attrs))))
-    (when name
-      (goto-char beg)
-      (muse-insert-markup "<span class=\"" name "\">")
-      (save-excursion
-        (goto-char end)
-        (muse-insert-markup "</span>")))))
-
-(defun muse-html-div-tag (beg end attrs)
-  "Publish a <div> tag for HTML."
-  (let ((id (cdr (assoc "id" attrs)))
-        (style (cdr (assoc "style" attrs))))
-    (when (or id style)
-      (goto-char beg)
-      (if (null id)
-          (muse-insert-markup "<div style=\"" style "\">")
-        (muse-insert-markup "<div id=\"" id "\">"))
-      (save-excursion
-        (goto-char end)
-        (muse-insert-markup "</div>")))))
-
-(defun muse-html-src-tag (beg end attrs)
-  "Publish the region using htmlize.
-The language to use may be specified by the \"lang\" attribute.
-
-Muse will look for a function named LANG-mode, where LANG is the
-value of the \"lang\" attribute.
-
-This tag requires htmlize 1.34 or later in order to work."
-  (if (condition-case nil
-          (progn
-            (require 'htmlize)
-            (if (fboundp 'htmlize-region-for-paste)
-                nil
-              (muse-display-warning
-               (concat "The `htmlize-region-for-paste' function was not"
-                       " found.\nThis is available in htmlize.el 1.34"
-                       " or later."))
-              t))
-        (error nil t))
-      ;; if htmlize.el was not found, treat this like an example tag
-      (muse-publish-example-tag beg end)
-    (muse-publish-ensure-block beg end)
-    (let* ((lang (cdr (assoc "lang" attrs)))
-           (mode (or (and (not (eq muse-html-src-allowed-modes t))
-                          (not (member lang muse-html-src-allowed-modes))
-                          'fundamental-mode)
-                     (intern-soft (concat lang "-mode"))))
-           (text (muse-delete-and-extract-region beg end))
-           (htmltext
-            (with-temp-buffer
-              (insert text)
-              (if (functionp mode)
-                  (funcall mode)
-                (fundamental-mode))
-              (if (fboundp 'font-lock-ensure)
-                  (font-lock-ensure)
-                (font-lock-fontify-buffer))
-              ;; silence the byte-compiler
-              (when (fboundp 'htmlize-region-for-paste)
-                ;; transform the region to HTML
-                (htmlize-region-for-paste (point-min) (point-max))))))
-      (save-restriction
-        (narrow-to-region (point) (point))
-        (insert htmltext)
-        (goto-char (point-min))
-        (re-search-forward "<pre\\([^>]*\\)>\n?" nil t)
-        (replace-match "<pre class=\"src\">")
-        (goto-char (point-max))
-        (muse-publish-mark-read-only (point-min) (point-max))))))
-
-;; Register the Muse HTML Publisher
-
-(defun muse-html-browse-file (file)
-  (browse-url (concat "file:" file)))
-
-(defun muse-html-encoding ()
-  (if (stringp muse-html-meta-content-encoding)
-      muse-html-meta-content-encoding
-    (muse-xml-transform-content-type
-     (or (and (boundp 'buffer-file-coding-system)
-              buffer-file-coding-system)
-         muse-html-encoding-default)
-     muse-html-charset-default)))
-
-(defun muse-html-prepare-buffer ()
-  (make-local-variable 'muse-html-meta-http-equiv)
-  (set (make-local-variable 'muse-html-meta-content-type)
-       (if (save-match-data
-             (string-match "charset=" muse-html-meta-content-type))
-           muse-html-meta-content-type
-         (concat muse-html-meta-content-type "; charset="
-                 (muse-html-encoding)))))
-
-(defun muse-html-munge-buffer ()
-  (if muse-publish-generate-contents
-      (progn
-        (goto-char (car muse-publish-generate-contents))
-        (muse-html-insert-contents (cdr muse-publish-generate-contents))
-        (setq muse-publish-generate-contents nil))
-    (muse-html-denote-headings)))
-
-(defun muse-html-finalize-buffer ()
-  (when (and (boundp 'buffer-file-coding-system)
-             (memq buffer-file-coding-system '(no-conversion undecided-unix)))
-    ;; make it agree with the default charset
-    (setq buffer-file-coding-system muse-html-encoding-default)))
-
-;;; Register the Muse HTML and XHTML Publishers
-
-(muse-define-style "html"
-                   :suffix    'muse-html-extension
-                   :regexps   'muse-html-markup-regexps
-                   :functions 'muse-html-markup-functions
-                   :strings   'muse-html-markup-strings
-                   :tags      'muse-html-markup-tags
-                   :specials  'muse-xml-decide-specials
-                   :before    'muse-html-prepare-buffer
-                   :before-end 'muse-html-munge-buffer
-                   :after     'muse-html-finalize-buffer
-                   :header    'muse-html-header
-                   :footer    'muse-html-footer
-                   :style-sheet 'muse-html-style-sheet
-                   :browser   'muse-html-browse-file)
-
-(muse-derive-style "xhtml" "html"
-                   :suffix    'muse-xhtml-extension
-                   :strings   'muse-xhtml-markup-strings
-                   :header    'muse-xhtml-header
-                   :footer    'muse-xhtml-footer
-                   :style-sheet 'muse-xhtml-style-sheet)
-
-;; xhtml1.0 is an alias for xhtml
-(muse-derive-style "xhtml1.0" "xhtml")
-
-;; xhtml1.1 has some quirks that need attention from us
-(muse-derive-style "xhtml1.1" "xhtml"
-                   :strings   'muse-xhtml1.1-markup-strings)
-
-(provide 'muse-html)
-
-;;; muse-html.el ends here
diff --git a/packages/muse/muse-http.el b/packages/muse/muse-http.el
deleted file mode 100644
index 0c83c92..0000000
--- a/packages/muse/muse-http.el
+++ /dev/null
@@ -1,239 +0,0 @@
-;;; muse-http.el --- publish HTML files over HTTP
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Publishing HTML over HTTP (using httpd.el)
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-html)
-(require 'muse-project)
-(require 'httpd)
-(require 'cgi)
-
-(defgroup muse-http nil
-  "Options controlling the behavior of Emacs Muse over HTTP."
-  :group 'press)
-
-(defcustom muse-http-maintainer (concat "webmaster@" (system-name))
-  "The maintainer address to use for the HTTP `From' field."
-  :type 'string
-  :group 'muse-http)
-
-(defcustom muse-http-publishing-style "html"
-  "The style to use when publishing projects over http."
-  :type 'string
-  :group 'muse-http)
-
-(defcustom muse-http-max-cache-size 64
-  "The number of pages to cache when serving over HTTP.
-This only applies if set while running the persisted invocation
-server.  See main documentation for the `muse-http'
-customization group."
-  :type 'integer
-  :group 'muse-http)
-
-(defvar muse-buffer-mtime nil)
-(make-variable-buffer-local 'muse-buffer-mtime)
-
-(defun muse-sort-buffers (l r)
-  (let ((l-mtime (with-current-buffer l muse-buffer-mtime))
-        (r-mtime (with-current-buffer r muse-buffer-mtime)))
-    (cond
-     ((and (null l-mtime) (null r-mtime)) l)
-     ((null l-mtime) r)
-     ((null r-mtime) l)
-     (t (muse-time-less-p r-mtime l-mtime)))))
-
-(defun muse-winnow-list (entries &optional predicate)
-  "Return only those ENTRIES for which PREDICATE returns non-nil."
-  (let ((flist (list t)))
-    (let ((entry entries))
-      (while entry
-        (if (funcall predicate (car entry))
-            (nconc flist (list (car entry))))
-        (setq entry (cdr entry))))
-    (cdr flist)))
-
-(defun muse-http-prune-cache ()
-  "If the page cache has become too large, prune it."
-  (let* ((buflist
-          (sort (muse-winnow-list (buffer-list)
-                                  (function
-                                   (lambda (buf)
-                                     (with-current-buffer buf
-                                       muse-buffer-mtime))))
-                'muse-sort-buffers))
-         (len (length buflist)))
-    (while (> len muse-http-max-cache-size)
-      (kill-buffer (car buflist))
-      (setq len (1- len)))))
-
-(defvar muse-http-serving-p nil)
-
-(defun muse-http-send-buffer (&optional modified code msg)
-  "Markup and send the contents of the current buffer via HTTP."
-  (httpd-send (or code 200) (or msg "OK")
-              "Server: muse.el/" muse-version httpd-endl
-              "Connection: close" httpd-endl
-              "MIME-Version: 1.0" httpd-endl
-              "Date: " (format-time-string "%a, %e %b %Y %T %Z")
-              httpd-endl
-              "From: " muse-http-maintainer httpd-endl)
-  (when modified
-    (httpd-send-data "Last-Modified: "
-                     (format-time-string "%a, %e %b %Y %T %Z" modified)
-                     httpd-endl))
-  (httpd-send-data "Content-Type: text/html; charset=iso-8859-1" httpd-endl
-                   "Content-Length: " (number-to-string (1- (point-max)))
-                   httpd-endl httpd-endl
-                   (buffer-string))
-  (httpd-send-eof))
-
-(defun muse-http-reject (title msg &optional annotation)
-  (muse-with-temp-buffer
-    (insert msg ".\n")
-    (if annotation
-        (insert annotation "\n"))
-    (muse-publish-markup-buffer title muse-http-publishing-style)
-    (muse-http-send-buffer nil 404 msg)))
-
-(defun muse-http-prepare-url (target explicit)
-  (save-match-data
-    (unless (or (not explicit)
-                (string-match muse-url-regexp target)
-                (string-match muse-image-regexp target)
-                (string-match muse-file-regexp target))
-      (setq target (concat "page?" target
-                           "&project=" muse-http-serving-p))))
-  (muse-publish-read-only target))
-
-(defun muse-http-render-page (name)
-  "Render the Muse page identified by NAME.
-When serving from a dedicated Emacs process (see the httpd-serve
-script), a maximum of `muse-http-max-cache-size' pages will be
-cached in memory to speed up serving time."
-  (let ((file (muse-project-page-file name muse-http-serving-p))
-        (muse-publish-url-transforms
-         (cons 'muse-http-prepare-url muse-publish-url-transforms))
-        (inhibit-read-only t))
-    (when file
-      (with-current-buffer (get-buffer-create file)
-        (let ((modified-time (nth 5 (file-attributes file)))
-              (muse-publishing-current-file file)
-              muse-publishing-current-style)
-          (when (or (null muse-buffer-mtime)
-                    (muse-time-less-p muse-buffer-mtime modified-time))
-            (erase-buffer)
-            (setq muse-buffer-mtime modified-time))
-          (goto-char (point-max))
-          (when (bobp)
-            (muse-insert-file-contents file t)
-            (let ((styles (cddr (muse-project muse-http-serving-p)))
-                  style)
-              (while (and styles (null style))
-                (let ((include-regexp
-                       (muse-style-element :include (car styles)))
-                      (exclude-regexp
-                       (muse-style-element :exclude (car styles))))
-                  (when (and (or (and (null include-regexp)
-                                      (null exclude-regexp))
-                                 (if include-regexp
-                                     (string-match include-regexp file)
-                                   (not (string-match exclude-regexp file))))
-                             (not (muse-project-private-p file)))
-                    (setq style (car styles))
-                    (while (muse-style-element :base style)
-                      (setq style
-                            (muse-style (muse-style-element :base style))))
-                    (if (string= (car style) muse-http-publishing-style)
-                        (setq style (car styles))
-                      (setq style nil))))
-                (setq styles (cdr styles)))
-              (muse-publish-markup-buffer
-               name (or style muse-http-publishing-style))))
-          (set-buffer-modified-p nil)
-          (muse-http-prune-cache)
-          (current-buffer))))))
-
-(defun muse-http-transmit-page (name)
-  "Render the Muse page identified by NAME.
-When serving from a dedicated Emacs process (see the httpd-serve
-script), a maximum of `muse-http-max-cache-size' pages will be
-cached in memory to speed up serving time."
-  (let ((inhibit-read-only t)
-        (buffer (muse-http-render-page name)))
-    (if buffer
-        (with-current-buffer buffer
-          (muse-http-send-buffer muse-buffer-mtime)))))
-
-(defvar httpd-vars nil)
-
-(defsubst httpd-var (var)
-  "Return value of VAR as a URL variable.  If VAR doesn't exist, nil."
-  (cdr (assoc var httpd-vars)))
-
-(defsubst httpd-var-p (var)
-  "Return non-nil if VAR was passed as a URL variable."
-  (not (null (assoc var httpd-vars))))
-
-(defun muse-http-serve (page &optional content)
-  "Serve the given PAGE from this press server."
-  ;; index.html is really a reference to the project home page
-  (if (and muse-project-alist
-           (string-match "\\`index.html?\\'" page))
-      (setq page (concat "page?"
-                         (muse-get-keyword :default
-                                           (cadr (car muse-project-alist))))))
-  ;; handle the actual request
-  (let ((vc-follow-symlinks t)
-        (muse-publish-report-threshhold nil)
-        muse-http-serving-p
-        httpd-vars)
-    (save-excursion
-      ;; process any CGI variables, if cgi.el is available
-      (if (string-match "\\`\\([^&]+\\)&" page)
-          (setq httpd-vars (cgi-decode (substring page (match-end 0)))
-                page (match-string 1 page)))
-      (unless (setq muse-http-serving-p (httpd-var "project"))
-        (let ((project (car muse-project-alist)))
-          (setq muse-http-serving-p (car project))
-          (setq httpd-vars (cons (cons "project" (car project))
-                                 httpd-vars))))
-      (if (and muse-http-serving-p
-               (string-match "\\`page\\?\\(.+\\)" page))
-          (muse-http-transmit-page (match-string 1 page))))))
-
-(if (featurep 'httpd)
-    (httpd-add-handler "\\`\\(index\\.html?\\|page\\(\\?\\|\\'\\)\\)"
-                       'muse-http-serve))
-
-(provide 'muse-http)
-
-;;; muse-http.el ends here
diff --git a/packages/muse/muse-ikiwiki.el b/packages/muse/muse-ikiwiki.el
deleted file mode 100644
index a664880..0000000
--- a/packages/muse/muse-ikiwiki.el
+++ /dev/null
@@ -1,219 +0,0 @@
-;;; muse-ikiwiki.el --- integrate with Ikiwiki
-
-;; Copyright (C) 2008, 2009, 2010  Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse Ikiwiki Integration
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse)
-(require 'muse-html)
-(require 'muse-ipc)
-(require 'muse-publish)
-
-(eval-when-compile
-  (require 'muse-colors))
-
-(defgroup muse-ikiwiki nil
-  "Options controlling the behavior of Muse integration with Ikiwiki."
-  :group 'muse-publish)
-
-(defcustom muse-ikiwiki-header ""
-  "Header used for publishing Ikiwiki output files.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-ikiwiki)
-
-(defcustom muse-ikiwiki-footer ""
-  "Footer used for publishing Ikiwiki output files.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-ikiwiki)
-
-(defcustom muse-ikiwiki-markup-regexps
-  `(;; Ikiwiki directives
-    (1350 ,(concat "\\(\\\\?\\)\\[\\[!""\\(?:-\\|\\w\\)+"
-                   "\\([" muse-regexp-blank "\n]+"
-                   "\\(?:\\(?:\\(?:-\\|\\w\\)+=\\)?"
-                   "\\(?:\"\"\".*?\"\"\"\\|\"[^\"]+\""
-                   "\\|[^]" muse-regexp-blank "\n]+\\)"
-                   "[" muse-regexp-blank "\n]*\\)*\\)?\\]\\]")
-          0 muse-ikiwiki-markup-directive))
-  "List of markup rules for publishing Ikiwiki markup on Muse pages.
-For more on the structure of this list, see `muse-publish-markup-regexps'."
-  :type '(repeat (choice
-                  (list :tag "Markup rule"
-                        integer
-                        (choice regexp symbol)
-                        integer
-                        (choice string function symbol))
-                  function))
-  :group 'muse-ikiwiki)
-
-;;; Publishing
-
-(defun muse-ikiwiki-markup-directive ()
-  "Handle publishing of an Ikiwiki directive."
-  (unless (get-text-property (match-beginning 0) 'read-only)
-    (add-text-properties (match-beginning 0) (match-end 0)
-                         '(muse-no-paragraph t))
-    (muse-publish-mark-read-only (match-beginning 0) (match-end 0))))
-
-(defun muse-ikiwiki-publish-buffer (name title &optional style)
-  "Publish a buffer for Ikiwki.
-The name of the corresponding file is NAME.
-The name of the style is given by STYLE.  It defaults to \"ikiwiki\"."
-  (unless style (setq style "ikiwiki"))
-  (unless title (setq title (muse-page-name name)))
-  (let ((muse-batch-publishing-p t)
-        (muse-publishing-current-file name)
-        (muse-publishing-current-output-path name)
-        (muse-publishing-current-style style)
-        (font-lock-verbose nil)
-        (vc-handled-backends nil)) ; don't activate VC when publishing files
-    (run-hooks 'muse-before-publish-hook)
-    (let ((muse-inhibit-before-publish-hook t))
-      (muse-publish-markup-buffer title style))))
-
-(defun muse-ikiwiki-publish-file (file name &optional style)
-  "Publish a single file for Ikiwiki.
-The name of the real file is NAME, and the name of the temporary
-file containing the content is FILE.
-The name of the style is given by STYLE.  It defaults to \"ikiwiki\"."
-  (if (not (stringp file))
-      (message "Error: No file given to publish")
-    (unless style
-      (setq style "ikiwiki"))
-    (let ((output-path file)
-          (target file)
-          (vc-handled-backends nil) ; don't activate VC when publishing files
-          auto-mode-alist
-          muse-current-output-style)
-      (setq auto-mode-alist
-            (delete (cons (concat "\\." muse-file-extension "\\'")
-                          'muse-mode-choose-mode)
-                    auto-mode-alist))
-      (setq muse-current-output-style (list :base style :path file))
-      (muse-with-temp-buffer
-        (muse-insert-file-contents file)
-        (muse-ikiwiki-publish-buffer name nil style)
-        (when (muse-write-file output-path t)
-          (muse-style-run-hooks :final style file output-path target))))))
-
-(defun muse-ikiwiki-start-server (port)
-  "Start Muse IPC server, initializing with the client on PORT."
-  (muse-ipc-start "foo" #'muse-ikiwiki-publish-buffer port))
-
-;;; Colors
-
-(defface muse-ikiwiki-directive
-  '((((class color) (background light))
-     (:foreground "dark green"))
-    (((class color) (background dark))
-     (:foreground "green")))
-  "Face for Ikiwiki directives."
-  :group 'muse-ikiwiki)
-
-(defun muse-colors-ikiwiki-directive ()
-  "Color ikiwiki directives."
-  (let ((start (match-beginning 0)))
-    (unless (or (eq (get-text-property start 'invisible) 'muse)
-                (get-text-property start 'muse-comment)
-                (get-text-property start 'muse-directive))
-      ;; beginning of line or space or symbol
-      (save-excursion
-        (and
-         (catch 'valid
-           (while t
-             (skip-chars-forward "^\"]" muse-colors-region-end)
-             (cond ((eq (point) (point-max))
-                    (throw 'valid nil))
-                   ((> (point) muse-colors-region-end)
-                    (throw 'valid nil))
-                   ((eq (char-after) ?\")
-                    (if (and (< (1+ (point)) muse-colors-region-end)
-                             (eq (char-after (1+ (point))) ?\"))
-                        (if (and (< (+ 2 (point)) muse-colors-region-end)
-                                 (eq (char-after (+ 2 (point))) ?\"))
-                            ;; triple-quote
-                            (progn
-                              (forward-char 3)
-                              (or (and (looking-at "\"\"\"")
-                                       (goto-char (match-end 0)))
-                                  (re-search-forward
-                                   "\"\"\"" muse-colors-region-end t)
-                                  (throw 'valid nil)))
-                          ;; empty quotes (""), which are invalid
-                          (throw 'valid nil))
-                      ;; quote with content
-                      (forward-char 1)
-                      (skip-chars-forward "^\"" muse-colors-region-end)
-                      (when (eq (char-after) ?\")
-                        (forward-char 1))))
-                   ((eq (char-after) ?\])
-                    (forward-char 1)
-                    (when (and (< (point) muse-colors-region-end)
-                               (eq (char-after (point)) ?\]))
-                      (forward-char 1)
-                      (throw 'valid t)))
-                   (t (throw 'valid nil)))))
-         ;; found a valid directive
-         (let ((end (point)))
-           ;; remove flyspell overlays
-           (when (fboundp 'flyspell-unhighlight-at)
-             (let ((cur start))
-               (while (> end cur)
-                 (flyspell-unhighlight-at cur)
-                 (setq cur (1+ cur)))))
-           (add-text-properties start end
-                                '(face muse-ikiwiki-directive
-                                  muse-directive t muse-no-flyspell t))
-           (when (progn
-                   (goto-char start)
-                   (skip-chars-forward "^\n" end)
-                   (and (eq (char-after) ?\n)
-                        (not (= (point) end))))
-             (add-text-properties start end
-                                  '(font-lock-multiline t)))))))))
-
-(defun muse-ikiwiki-insinuate-colors ()
-  (add-to-list 'muse-colors-markup
-               '("\\[\\[!" ?\[ muse-colors-ikiwiki-directive)
-               nil))
-
-(eval-after-load "muse-colors" '(muse-ikiwiki-insinuate-colors))
-
-;; Styles
-(muse-derive-style "ikiwiki" "xhtml"
-                   :header  'muse-ikiwiki-header
-                   :footer  'muse-ikiwiki-footer
-                   :regexps 'muse-ikiwiki-markup-regexps)
-
-(provide 'muse-ikiwiki)
-
-;;; muse-ikiwiki.el ends here
diff --git a/packages/muse/muse-import-docbook.el 
b/packages/muse/muse-import-docbook.el
deleted file mode 100644
index ed1b22b..0000000
--- a/packages/muse/muse-import-docbook.el
+++ /dev/null
@@ -1,137 +0,0 @@
-;;; muse-import-docbook.el --- convert Docbook XML into Muse format
-
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; Author: Elena Pomohaci <e.pomohaci@gmail.com>
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; It works only for article type docbook docs and recognize
-;; followings elements: article, sect1, sect2, sect3, title,
-
-;;; Contributors:
-
-;;; Code:
-
-(require 'muse-import-xml)
-
-(defvar muse-import-docbook-prefix "muse-import-docbook-"
-  "The name prefix for tag functions")
-
-(defvar muse-import-docbook-para-indent "\n\n"
-  "Para elements indentation (0, less than 6 spaces, more than 6 spaces)")
-
-(defun muse-import-docbook-reset-para-indent ()
-  (setq muse-import-docbook-para-indent "\n\n"))
-
-
-;;;###autoload
-(defun muse-import-docbook (src dest)
-  "Convert the Docbook buffer SRC to Muse, writing output in the DEST buffer."
-  (interactive "bDocbook buffer:\nBMuse buffer:")
-  (setq muse-import-xml-prefix muse-import-docbook-prefix)
-  (setq muse-import-xml-generic-function-name "muse-import-xml-node")
-  (muse-import-xml src dest))
-
-;;;###autoload
-(defun muse-import-docbook-files (src dest)
-  "Convert the Docbook file SRC to Muse, writing output to the DEST file."
-  (interactive "fDocbook file:\nFMuse file:")
-  (with-temp-file dest
-    (muse-import-docbook (find-file-noselect src) (current-buffer))))
-
-
-;;; element specific functions
-
-(defun muse-import-docbook-get-title (node)
-  (let ((tit (car (xml-get-children node 'title))))
-    (insert (car (cddr tit)) ?\n ?\n)
-    (muse-import-xml-parse-tree (xml-node-children (remove tit node)))))
-
-
-(defun muse-import-docbook-article (node)
-  "Article conversion function"
-  (muse-import-xml-node node))
-
-(defun muse-import-docbook-articleinfo (node)
-  "Article conversion function"
-  (insert "#title ")
-  (muse-import-docbook-get-title node)
-  (insert ?\n))
-
-
-(defalias 'muse-import-docbook-appendix 'muse-import-docbook-article)
-
-(defalias 'muse-import-docbook-appendixinfo 'muse-import-docbook-articleinfo)
-
-
-(defun muse-import-docbook-sect1 (node)
-  "Section 1 conversion function"
-  (insert ?\n "* ")
-  (muse-import-docbook-get-title node))
-
-(defun muse-import-docbook-sect2 (node)
-  "Section 2 conversion function"
-  (insert ?\n "** ")
-  (muse-import-docbook-get-title node))
-
-(defun muse-import-docbook-sect3 (node)
-  "Section 3 conversion function"
-  (insert ?\n "*** ")
-  (muse-import-docbook-get-title node))
-
-
-(defun muse-import-docbook-graphic (node)
-  "Graphic conversion function. Image format is forced to PNG"
-  (let ((name (xml-get-attribute node 'fileref)))
-  (insert "\n[[img/" name ".png][" name "]]")))
-
-(defun muse-import-docbook-para (node)
-  (insert muse-import-docbook-para-indent)
-  (muse-import-xml-node node))
-
-
-(defun muse-import-docbook-emphasis (node)
-  (insert "*")
-  (muse-import-xml-node node)
-  (insert "*"))
-
-(defun muse-import-docbook-quote (node)
-  (insert "\"")
-  (muse-import-xml-node node)
-  (insert "\""))
-
-(defun muse-import-docbook-blockquote (node)
-  (setq muse-import-docbook-para-indent "\n\n  ")
-  (muse-import-xml-node node)
-  (muse-import-docbook-reset-para-indent))
-
-(defun muse-import-docbook-member (node)
-  (insert "\n> ")
-  (muse-import-xml-node node))
-
-(defun muse-import-docbook-bridgehead (node)
-  (insert "\n* ")
-  (muse-import-xml-node node))
-
-(provide 'muse-import-docbook)
-
-;;; muse-import-docbook.el ends here
diff --git a/packages/muse/muse-import-latex.el 
b/packages/muse/muse-import-latex.el
deleted file mode 100644
index 5297131..0000000
--- a/packages/muse/muse-import-latex.el
+++ /dev/null
@@ -1,149 +0,0 @@
-;;; muse-import-latex.el --- convert a LaTex file into a Muse file
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; Helper commands for converting a LaTeX file into a Muse file.
-
-;;; Contributors:
-
-;;; Code:
-
-(require 'muse)
-(require 'muse-regexps)
-
-(defun muse-i-l-write-citation (note author citation pages)
-  (save-excursion
-    (goto-char (point-max))
-    (if (= note 1)
-        (insert "\nFootnotes:\n\n"))
-    (let ((beg (point)))
-      (insert "\n[" (number-to-string note) "]  " author)
-      (if (and citation pages)
-          (insert ", " citation ", " pages))
-      (insert "\n")
-      (goto-char beg)
-      (while (re-search-forward (concat "p.\\\\[" muse-regexp-blank "\n]+")
-                                nil t)
-        (replace-match "p."))
-      (goto-char beg)
-      (while (re-search-forward "--" nil t)
-        (replace-match "-")))))
-
-(defun muse-i-l-write-footnote (note text)
-  (save-excursion
-    (goto-char (point-max))
-    (if (= note 1)
-        (insert "\nFootnotes:\n\n"))
-    (insert "\n[" (number-to-string note) "]  " text ?\n)))
-
-;;;###autoload
-(defun muse-import-latex ()
-  (interactive)
-  (goto-char (point-min))
-  (while (not (eobp))
-    (cond
-     ((or (looking-at "^\\\\documentclass")
-          (looking-at "^\\\\input")
-          (looking-at "^\\\\begin{document}")
-          (looking-at "^\\\\end{document}")
-          (looking-at "^\\\\author")
-          (looking-at "^\\\\\\(med\\|big\\|small\\)skip")
-          (looking-at "^\\\\maketitle"))
-      (delete-region (point) (muse-line-end-position)))
-     ((looking-at "^\\\\title{\\(.+\\)}")
-      (delete-region (match-end 1) (muse-line-end-position))
-      (delete-region (point) (match-beginning 1))
-      (insert "#title ")))
-    (forward-line))
-  (goto-char (point-min))
-  (while (re-search-forward "\\\\\\(l\\)?dots{}" nil t)
-    (replace-match (concat (and (string= (match-string 1) "l") ".")
-                           "...")))
-  (goto-char (point-min))
-  (while (re-search-forward "\\(``\\|''\\)" nil t)
-    (replace-match "\""))
-  (goto-char (point-min))
-  (while (re-search-forward "---" nil t)
-    (replace-match " -- "))
-  (goto-char (point-min))
-  (while (re-search-forward "\\\\tableofcontents" nil t)
-    (replace-match "<contents>"))
-  (goto-char (point-min))
-  (while (re-search-forward "\\\\\\\\" nil t)
-    (replace-match ""))
-  (goto-char (point-min))
-  (while (re-search-forward "\\\\\\(sub\\)?section{\\([^}]+\\)}" nil t)
-    (replace-match (concat (if (string= (match-string 1) "sub")
-                               "**" "*")
-                           " " (match-string 2))))
-  (goto-char (point-min))
-  (while (re-search-forward "\\\\\\(begin\\|end\\){verse}" nil t)
-    (replace-match (concat "<" (if (string= (match-string 1) "end") "/")
-                           "verse>")))
-  (goto-char (point-min))
-  (while (re-search-forward "\\\\\\(begin\\|end\\){quote}\n" nil t)
-    (replace-match ""))
-  (goto-char (point-min))
-  (while (re-search-forward
-          "\\\\\\(emph\\|textbf\\){\\([^}]+?\\)\\(\\\\/\\)?}" nil t)
-    (replace-match
-     (if (string= (match-string 1) "emph") "*\\2*" "**\\2**")))
-  (let ((footnote-index 1))
-    (goto-char (point-min))
-    (while (re-search-forward
-            (concat "\\\\\\(q\\)?\\(footnote\\|excerpt\\)\\(np\\)?"
-                    "\\({\\([^}]+\\)}\\)?"
-                    "\\({\\([^}]+\\)}{\\([^}]+\\)}\\)?{\\([^}]+\\)}") nil t)
-      (let ((beg (match-beginning 0))
-            (end (match-end 0)))
-        (unless (string= (match-string 2) "footnote")
-          (if (null (match-string 1))
-              (insert "  " (match-string 9))
-            (let ((b (point)) e)
-              (insert "\"" (match-string 9) "\"")
-              (setq e (point-marker))
-              (save-match-data
-                (save-excursion
-                  (goto-char b)
-                  (while (< (point) e)
-                    (if (looking-at "\\s-+")
-                        (delete-region (match-beginning 0)
-                                       (match-end 0)))
-                    (forward-line))))
-              (set-marker e nil))))
-        (insert "[" (number-to-string footnote-index) "]")
-        (if (string= (match-string 2) "footnote")
-            (muse-i-l-write-footnote footnote-index (match-string 9))
-          (muse-i-l-write-citation footnote-index (match-string 5)
-                                   (match-string 7) (match-string 8)))
-        (setq footnote-index (1+ footnote-index))
-        (delete-region beg end))))
-  (goto-char (point-min))
-  (while (looking-at "\n") (delete-char 1))
-  (goto-char (point-min))
-  (while (re-search-forward "\n\n+" nil t)
-    (replace-match "\n\n")))
-
-(provide 'muse-import-latex)
-
-;;; muse-import-latex.el ends here
diff --git a/packages/muse/muse-import-xml.el b/packages/muse/muse-import-xml.el
deleted file mode 100644
index 2579ce8..0000000
--- a/packages/muse/muse-import-xml.el
+++ /dev/null
@@ -1,88 +0,0 @@
-;;; muse-import-xml.el --- common to all from-xml converters
-
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; Author: Elena Pomohaci <e.pomohaci@gmail.com>
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;;; Code:
-
-(provide 'muse-import-xml)
-
-(require 'xml)
-(require 'muse)
-
-(defvar muse-import-xml-prefix ""
-  "The name prefix for tag functions")
-
-(defvar muse-import-xml-generic-function-name "muse-import-xml-generic"
-  "The generic function name")
-
-(defun muse-import-xml-convert-to-list (buf)
-  "Convert xml BUF in a xml-list"
-  (with-temp-buffer
-    (insert-buffer-substring buf)
-    (goto-char (point-min))
-    (while (re-search-forward ">[ \n\t]*<" nil t)
-      (replace-match "><" nil nil)) ; clean all superfluous blank characters
-    (xml-parse-region (point-min)
-                      (point-max)
-                      (current-buffer))))
-
-
-(defun muse-import-xml-generic (node)
-  "The generic function called when there is no node specific function."
-  (let ((name (xml-node-name node)))
-    (insert "<" (symbol-name name)  ">")
-    (muse-import-xml-node node)
-    (insert "</" (symbol-name name) ">")))
-
-(defun muse-import-xml-parse-tree (lst)
-  "Parse an xml tree list"
-  (mapc #'muse-import-xml-parse-node lst))
-
-(defun muse-import-xml-parse-node (node)
-  "Parse a xml tree node"
-  (if (stringp node)
-      (insert (muse-replace-regexp-in-string "^[ \t]+" "" node))
-    (let ((fname (intern-soft (concat muse-import-xml-prefix
-                                      (symbol-name (xml-node-name node))))))
-      (if (functionp fname)
-          (funcall fname node)
-        (funcall (intern muse-import-xml-generic-function-name) node)))))
-
-
-(defun muse-import-xml-node (node)
-  "Default node function"
-  (muse-import-xml-parse-tree (xml-node-children node)))
-
-
-(defun muse-import-xml (src dest)
-  "Convert the xml SRC buffer in a muse DEST buffer"
-  (set-buffer (get-buffer-create dest))
-  (when (fboundp 'muse-mode)
-    (muse-mode))
-  (muse-import-xml-parse-tree (muse-import-xml-convert-to-list src)))
-
-;;; muse-import-xml.el ends here
diff --git a/packages/muse/muse-ipc.el b/packages/muse/muse-ipc.el
deleted file mode 100644
index da8eb37..0000000
--- a/packages/muse/muse-ipc.el
+++ /dev/null
@@ -1,194 +0,0 @@
-;;; muse-ipc.el --- publish Muse documents from other processes
-
-;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; This file is still in alpha state.  Not for production use!
-
-;;; Contributors:
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse Inter-Process Communication
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(eval-when-compile (require 'cl))
-
-(require 'muse)
-(require 'muse-publish)
-
-(defgroup muse-ipc nil
-  "Options controlling the behavior of Muse's IPC module."
-  :group 'muse-publish)
-
-(defcustom muse-ipc-timeout 60
-  "Maximum time to wait for a client to respond."
-  :group 'muse-ipc
-  :type 'number)
-
-(defcustom muse-ipc-ignore-done nil
-  "If non-nil, ignore any `done' messages that we get from clients."
-  :group 'muse-ipc
-  :type 'boolean)
-
-(defvar muse-ipc-server-port nil
-  "Port of the Emacs server.")
-
-(defvar muse-ipc-server-process nil
-  "Process of the Emacs server.")
-
-(defvar muse-ipc-server-registered nil
-  "Whether we have successfully registered our port with the client.")
-
-(defun muse-ipc-init-filter (proc string)
-  "Handle data from client while initiating a connection."
-  (unless muse-ipc-server-registered
-    (when (string-match "\\`ok$" string)
-      (setq muse-ipc-server-registered t))))
-
-(defun muse-ipc-delete-client (proc)
-  "Delete a client."
-  (let ((buffer (process-get proc :buffer)))
-    (when (and buffer (buffer-live-p buffer))
-      (with-current-buffer buffer
-        (set-buffer-modified-p nil))
-      (kill-buffer buffer)))
-  (when (eq (process-status proc) 'open)
-    (delete-process proc)))
-
-(defun* muse-ipc-server-filter (proc string)
-  "Handle data from a client after it connects."
-  ;; Authenticate
-  (unless (process-get proc :authenticated)
-    (if (and (string-match "\\`begin \\(.+\\)$" string)
-             (equal (match-string 1 string)
-                    (process-get proc :shared-secret)))
-        (progn
-          (setq string (substring string (match-end 0)))
-          (process-put proc :authenticated t)
-          (process-send-string proc "ok\n"))
-      (process-send-string proc "nok\n")
-      (delete-process proc))
-    (return-from muse-ipc-server-filter))
-
-  ;; Handle case where the client is sending data to be published
-  (when (process-get proc :sending-data)
-    (with-current-buffer (process-get proc :buffer)
-      (insert string)
-      (let ((buf-len (1- (point)))
-            (expected-len (process-get proc :data-bytes)))
-        (cond ((= buf-len expected-len)
-               (process-put proc :sending-data nil))
-              ((> buf-len expected-len)
-               (process-send-string proc "nok\n")
-               (muse-ipc-delete-client proc)))))
-    (return-from muse-ipc-server-filter))
-
-  ;; Dispatch commands
-  (cond
-   ((string-match "\\`done$" string)
-    ;; done, close the server
-    (unless muse-ipc-ignore-done
-      (muse-ipc-stop-server)))
-
-   ((string-match "\\`name \\(.+\\)$" string)
-    ;; set name
-    (process-put proc :file-name (match-string 1 string))
-    (process-send-string proc "ok\n"))
-
-   ((string-match "\\`title \\(.+\\)$" string)
-    ;; set title
-    (process-put proc :title (match-string 1 string))
-    (process-send-string proc "ok\n"))
-
-   (t
-    ;; unrecognized command
-    (process-send-string proc "nok\n"))))
-
-(defun muse-ipc-stop-server ()
-  "Stop Muse IPC server and reset connection data."
-  (stop-process muse-ipc-server-process)
-  (delete-process muse-ipc-server-process)
-  (setq muse-ipc-server-port nil)
-  (setq muse-ipc-server-process nil))
-
-(defun muse-ipc-start (shared-secret publish-fn client-port &optional 
server-port)
-  "Start an IPC connection and send a response to CLIENT-PORT.
-If SERVER-PORT is provided, start the IPC server on that port, otherwise
-choose a random port.
-
-SHARED-SECRET is used as a very minimal security measure to
-authenticate the Muse IPC server during initialization, and also
-any incoming clients once the server is started.
-
-PUBLISH-FN is the function which should be called in buffer of
-the received contents.  It should transform the buffer into a
-published state.  It must take at least two arguments.  The first
-argument is the full path of the file that the contents
-correspond with.  The second argument is the title to use when
-publishing the file."
-  (when (stringp client-port)
-    (setq client-port (string-to-number client-port)))
-  (when (stringp server-port)
-    (setq server-port (string-to-number server-port)))
-  (setq muse-ipc-server-process
-        (make-network-process
-         :name "muse-ipc"
-         :buffer nil
-         :host 'local :service (or server-port t)
-         :server t :noquery t :nowait t
-         :plist (list :authenticated nil :shared-secret shared-secret
-                      :publish-fn publish-fn)
-         :filter 'muse-ipc-server-filter))
-  (unless muse-ipc-server-process
-    (error "Error: Could not start Muse IPC Server process"))
-  (set-process-coding-system muse-ipc-server-process
-                             'raw-text-unix 'raw-text-unix)
-  (setq muse-ipc-server-port
-        (number-to-string
-         (cadr (process-contact muse-ipc-server-process))))
-  (let ((client-proc
-         (make-network-process
-          :name "muse-ipc-client"
-          :buffer nil
-          :host 'local :service client-port
-          :noquery t
-          :filter 'muse-ipc-init-filter)))
-    (setq muse-ipc-server-registered nil)
-    (process-send-string client-proc
-                         (concat "begin " shared-secret "\n"))
-    (accept-process-output client-proc muse-ipc-timeout nil t)
-    (unless muse-ipc-server-registered
-      (error "Error: Did not register listener"))
-    (process-send-string client-proc
-                         (concat "port " muse-ipc-server-port "\n"))
-    (stop-process client-proc)
-    (delete-process client-proc))
-
-  ;; Accept process output until the server dies
-  (while muse-ipc-server-process (accept-process-output nil 1)))
-
-(provide 'muse-ipc)
-
-;;; muse-ipc.el ends here
diff --git a/packages/muse/muse-journal.el b/packages/muse/muse-journal.el
deleted file mode 100644
index e523b4c..0000000
--- a/packages/muse/muse-journal.el
+++ /dev/null
@@ -1,774 +0,0 @@
-;;; muse-journal.el --- keep and publish a journal
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; The module facilitates the keeping and publication of a journal.
-;; When publishing to HTML, it assumes the form of a web log, or blog.
-;;
-;; The input format for each entry is as follows:
-;;
-;;   * 20040317: Title of entry
-;;
-;;   Text for the entry.
-;;
-;;   <qotd>
-;;   "You know who you are. It comes down to a simple gut check: You
-;;   either love what you do or you don't. Period." -- P. Bronson
-;;   </qotd>
-;;
-;; The "qotd", or Quote of the Day, is entirely optional.  When
-;; generated to HTML, this entry is rendered as:
-;;
-;;   <div class="entry">
-;;     <div class="entry-qotd">
-;;       <h3>Quote of the Day:</h3>
-;;       <p>"You know who you are. It comes down to a simple gut
-;;         check: You either love what you do or you don't. Period."
-;;         -- P. Bronson</p>
-;;     </div>
-;;     <div class="entry-body">
-;;       <div class="entry-head">
-;;         <div class="entry-date">
-;;           <span class="date">March 17, 2004</span>
-;;         </div>
-;;         <div class="entry-title">
-;;           <h2>Title of entry</h2>
-;;         </div>
-;;       </div>
-;;       <div class="entry-text">
-;;         <p>Text for the entry.</p>
-;;       </div>
-;;     </div>
-;;   </div>
-;;
-;; The plurality of "div" tags makes it possible to display the
-;; entries in any form you wish, using a CSS style.
-;;
-;; Also, an .RDF file can be generated from your journal by publishing
-;; it with the "rdf" style.  It uses the first two sentences of the
-;; first paragraph of each entry as its "description", and
-;; autogenerates tags for linking to the various entries.
-
-;;; Contributors:
-
-;; René Stadler (mail AT renestadler DOT de) provided a patch that
-;; causes dates in RSS feeds to be generated in a format that RSS
-;; readers can parse.
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse Journal Publishing
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-publish)
-(require 'muse-html)
-(require 'muse-latex)
-(require 'muse-book)
-
-(defgroup muse-journal nil
-  "Rules for transforming a journal into its final form."
-  :group 'muse-publish)
-
-(defcustom muse-journal-heading-regexp
-  "\\(?:\\([0-9]+\\)\\(?:: \\)?\\)?\\(.+?\\)?"
-  "A regexp that matches a journal heading.
-Paren group 1 is the ISO date, group 2 is the optional category,
-and group 3 is the optional heading for the entry."
-  :type 'regexp
-  :group 'muse-journal)
-
-(defcustom muse-journal-date-format "%a, %e %b %Y"
-  "Date format to use for journal entries."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-html-heading-regexp
-  (concat "^<h2[^>\n]*>" muse-journal-heading-regexp "</h2>$")
-  "A regexp that matches a journal heading from an HTML document.
-Paren group 1 is the ISO date, group 2 is the optional category,
-and group 3 is the optional heading for the entry."
-  :type 'regexp
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-heading-regexp
-  (concat "^\\* " muse-journal-heading-regexp "$")
-  "A regexp that matches a journal heading from an HTML document.
-Paren group 1 is the ISO date, group 2 is the optional category,
-and group 3 is the optional heading for the entry."
-  :type 'regexp
-  :group 'muse-journal)
-
-(defcustom muse-journal-html-entry-template
-  "<div class=\"entry\">
-  <a name=\"%anchor%\" style=\"text-decoration: none\">&nbsp;</a>
-  <div class=\"entry-body\">
-    <div class=\"entry-head\">
-      <div class=\"entry-date\">
-        <span class=\"date\">%date%</span>
-      </div>
-      <div class=\"entry-title\">
-        <h2>%title%</h2>
-      </div>
-    </div>
-    <div class=\"entry-text\">
-      <div class=\"entry-qotd\">
-        <p>%qotd%</p>
-      </div>
-%text%
-    </div>
-  </div>
-</div>\n\n"
-  "Template used to publish individual journal entries as HTML.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-latex-section
-  "\\section*{%title% \\hfill {\\normalsize %date%}}
-\\addcontentsline{toc}{chapter}{%title%}"
-  "Template used to publish a LaTeX section."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-latex-subsection
-  "\\subsection*{%title%}
-\\addcontentsline{toc}{section}{%title%}"
-  "Template used to publish a LaTeX subsection."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-markup-tags
-  '(("qotd" t nil nil muse-journal-qotd-tag))
-  "A list of tag specifications, for specially marking up Journal entries.
-See `muse-publish-markup-tags' for more info.
-
-This is used by journal-latex and its related styles, as well as
-the journal-rss-entry style, which both journal-rdf and
-journal-rss use."
-  :type '(repeat (list (string :tag "Markup tag")
-                       (boolean :tag "Expect closing tag" :value t)
-                       (boolean :tag "Parse attributes" :value nil)
-                       (boolean :tag "Nestable" :value nil)
-                       function))
-  :group 'muse-journal)
-
-;; FIXME: This doesn't appear to be used.
-(defun muse-journal-generate-pages ()
-  (let ((output-dir (muse-style-element :path)))
-    (goto-char (point-min))
-    (while (re-search-forward muse-journal-heading-regexp nil t)
-      (let* ((date (match-string 1))
-             (category (match-string 1))
-             (category-file (concat output-dir category "/index.html"))
-             (heading (match-string 1)))
-        t))))
-
-(defcustom muse-journal-rdf-extension ".rdf"
-  "Default file extension for publishing RDF (RSS 1.0) files."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rdf-base-url ""
-  "The base URL of the website referenced by the RDF file."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rdf-header
-  "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\";
-         xmlns=\"http://purl.org/rss/1.0/\";
-         xmlns:dc=\"http://purl.org/dc/elements/1.1/\";>
-  <channel rdf:about=\"<lisp>(concat (muse-style-element :base-url)
-                                     (muse-publish-link-name))</lisp>\">
-    <title><lisp>(muse-publishing-directive \"title\")</lisp></title>
-    <link><lisp>(concat (muse-style-element :base-url)
-                       (concat (muse-page-name)
-                               muse-html-extension))</lisp></link>
-    <description><lisp>(muse-publishing-directive 
\"desc\")</lisp></description>
-    <items>
-      <rdf:Seq>
-        <rdf:li resource=\"<lisp>
-          (concat (muse-style-element :base-url)
-                  (concat (muse-page-name)
-                          muse-html-extension))</lisp>\"/>
-      </rdf:Seq>
-    </items>
-  </channel>\n"
-  "Header used for publishing RDF (RSS 1.0) files.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rdf-footer
-  "</rdf:RDF>\n"
-  "Footer used for publishing RDF (RSS 1.0) files.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rdf-date-format
-  "%Y-%m-%dT%H:%M:%S"
-  "Date format to use for RDF entries."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rdf-entry-template
-  "\n  <item rdf:about=\"%link%#%anchor%\">
-    <title>%title%</title>
-    <description>
-      %desc%
-    </description>
-    <link>%link%#%anchor%</link>
-    <dc:date>%date%</dc:date>
-    <dc:creator>%maintainer%</dc:creator>
-  </item>\n"
-  "Template used to publish individual journal entries as RDF.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rdf-summarize-entries nil
-  "If non-nil, include only summaries in the RDF file, not the full data.
-
-The default is nil, because this annoys some subscribers."
-  :type 'boolean
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-extension ".xml"
-  "Default file extension for publishing RSS 2.0 files."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-base-url ""
-  "The base URL of the website referenced by the RSS file."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-header
-  "<\?xml version=\"1.0\" encoding=\"<lisp>
-  (muse-html-encoding)</lisp>\"?>
-<rss version=\"2.0\">
-  <channel>
-    <title><lisp>(muse-publishing-directive \"title\")</lisp></title>
-    <link><lisp>(concat (muse-style-element :base-url)
-                        (concat (muse-page-name)
-                                muse-html-extension))</lisp></link>
-    <description><lisp>(muse-publishing-directive 
\"desc\")</lisp></description>
-    <language>en-us</language>
-    <generator>Emacs Muse</generator>\n\n"
-  "Header used for publishing RSS 2.0 files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-footer
-  "\n\n  </channel>
-</rss>\n"
-  "Footer used for publishing RSS 2.0 files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-date-format
-  "%a, %d %b %Y %H:%M:%S %Z"
-  "Date format to use for RSS 2.0 entries."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-entry-template
-  "\n    <item>
-      <title>%title%</title>
-      <link>%link%#%anchor%</link>
-      <description>%desc%</description>
-      <author><lisp>(muse-publishing-directive \"author\")</lisp></author>
-      <pubDate>%date%</pubDate>
-      <guid>%link%#%anchor%</guid>
-      %enclosure%
-    </item>\n"
-  "Template used to publish individual journal entries as RSS 2.0.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-enclosure-types-alist
-  '(("mp3" . "audio/mpeg"))
-  "File types that are accepted as RSS enclosures.
-This is an alist that maps file extension to content type.
-Useful for podcasting."
-  :type '(alist :key-type string :value-type string)
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-summarize-entries nil
-  "If non-nil, include only summaries in the RSS file, not the full data.
-
-The default is nil, because this annoys some subscribers."
-  :type 'boolean
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-markup-regexps
-  '((10000 muse-explicit-link-regexp 0 "\\2"))
-  "List of markup rules for publishing a Muse journal page to RSS 2.0.
-For more information on the structure of this list, see
-`muse-publish-markup-regexps'."
-  :type '(repeat (choice
-                  (list :tag "Markup rule"
-                        integer
-                        (choice regexp symbol)
-                        integer
-                        (choice string function symbol))
-                  function))
-  :group 'muse-journal)
-
-(defcustom muse-journal-rss-markup-functions
-  '((email . ignore)
-    (link  . ignore)
-    (url   . ignore))
-  "An alist of style types to custom functions for that kind of text.
-For more on the structure of this list, see
-`muse-publish-markup-functions'."
-  :type '(alist :key-type symbol :value-type function)
-  :group 'muse-journal)
-
-(defun muse-journal-anchorize-title (title)
-  "This strips tags from TITLE, truncates TITLE at begin parenthesis,
-and escapes any remaining non-alphanumeric characters."
-  (save-match-data
-    (if (string-match "(" title)
-        (setq title (substring title 0 (match-beginning 0))))
-    (if (string-match "<[^>]+>" title)
-        (setq title (replace-match "" nil nil title)))
-    (let (pos code len ch)
-      (while (setq pos (string-match (concat "[^" muse-regexp-alnum "_]")
-                                     title pos))
-          (setq ch (aref title pos)
-                code (format "%%%02X" (cond ((fboundp 'char-to-ucs)
-                                             (char-to-ucs ch))
-                                            ((fboundp 'char-to-int)
-                                             (char-to-int ch))
-                                            (t ch)))
-                len (length code)
-                title (concat (substring title 0 pos)
-                              code
-                              (when (< pos (length title))
-                                (substring title (1+ pos) nil)))
-                pos (+ len pos)))
-        title)))
-
-(defun muse-journal-sort-entries (&optional direction)
-  (interactive "P")
-  (sort-subr
-   direction
-   (function
-    (lambda ()
-      (if (re-search-forward "^\\* [0-9]+" nil t)
-          (goto-char (match-beginning 0))
-        (goto-char (point-max)))))
-   (function
-    (lambda ()
-      (if (re-search-forward "^\\* [0-9]+" nil t)
-          (goto-char (1- (match-beginning 0)))
-        (goto-char (point-max)))))
-   (function
-    (lambda ()
-      (forward-char 2)))
-   (function
-    (lambda ()
-      (end-of-line)))))
-
-(defun muse-journal-qotd-tag (beg end)
-  (muse-publish-ensure-block beg end)
-  (muse-insert-markup (muse-markup-text 'begin-quote))
-  (muse-insert-markup (muse-markup-text 'begin-quote-item))
-  (goto-char end)
-  (muse-insert-markup (muse-markup-text 'end-quote-item))
-  (muse-insert-markup (muse-markup-text 'end-quote)))
-
-(defun muse-journal-html-munge-buffer ()
-  (goto-char (point-min))
-  (let ((heading-regexp muse-journal-html-heading-regexp)
-        (inhibit-read-only t))
-    (while (re-search-forward heading-regexp nil t)
-      (let* ((date (match-string 1))
-             (orig-date date)
-             (title (match-string 2))
-             (clean-title title)
-             datestamp qotd text)
-        (delete-region (match-beginning 0) (match-end 0))
-        (if clean-title
-            (save-match-data
-              (while (string-match "\\(^<[^>]+>\\|<[^>]+>$\\)" clean-title)
-                (setq clean-title (replace-match "" nil nil clean-title)))))
-        (save-match-data
-          (when (and date
-                     (string-match
-                      (concat "\\`\\([1-9][0-9][0-9][0-9]\\)[./]?"
-                              "\\([0-1][0-9]\\)[./]?\\([0-3][0-9]\\)") date))
-            (setq datestamp
-                  (encode-time
-                   0 0 0
-                   (string-to-number (match-string 3 date))
-                   (string-to-number (match-string 2 date))
-                   (string-to-number (match-string 1 date))
-                   nil)
-                  date (concat (format-time-string
-                                muse-journal-date-format datestamp)
-                               (substring date (match-end 0))))))
-        (save-restriction
-          (narrow-to-region
-           (point) (if (re-search-forward
-                        (concat "\\(^<hr>$\\|"
-                                heading-regexp "\\)") nil t)
-                       (match-beginning 0)
-                     (point-max)))
-          (goto-char (point-max))
-          (while (and (not (bobp))
-                      (eq ?\  (char-syntax (char-before))))
-            (delete-char -1))
-          (goto-char (point-min))
-          (while (and (not (eobp))
-                      (eq ?\  (char-syntax (char-after))))
-            (delete-char 1))
-          (save-excursion
-            (when (search-forward "<qotd>" nil t)
-              (let ((tag-beg (match-beginning 0))
-                    (beg (match-end 0))
-                    end)
-                (re-search-forward "</qotd>\n*")
-                (setq end (point-marker))
-                (save-restriction
-                  (narrow-to-region beg (match-beginning 0))
-                  (muse-publish-escape-specials (point-min) (point-max)
-                                                nil 'document)
-                  (setq qotd (buffer-substring-no-properties
-                              (point-min) (point-max))))
-                (delete-region tag-beg end)
-                (set-marker end nil))))
-          (setq text (buffer-string))
-          (delete-region (point-min) (point-max))
-          (let ((entry muse-journal-html-entry-template))
-            (muse-insert-file-or-string entry)
-            (muse-publish-mark-read-only (point-min) (point-max))
-            (goto-char (point-min))
-            (while (search-forward "%date%" nil t)
-              (remove-text-properties (match-beginning 0) (match-end 0)
-                                      '(read-only nil rear-nonsticky nil))
-              (replace-match (or date "") nil t))
-            (goto-char (point-min))
-            (while (search-forward "%title%" nil t)
-              (remove-text-properties (match-beginning 0) (match-end 0)
-                                      '(read-only nil rear-nonsticky nil))
-              (replace-match (or title "&nbsp;") nil t))
-            (goto-char (point-min))
-            (while (search-forward "%anchor%" nil t)
-              (replace-match (muse-journal-anchorize-title
-                              (or clean-title orig-date))
-                             nil t))
-            (goto-char (point-min))
-            (while (search-forward "%qotd%" nil t)
-              (save-restriction
-                (narrow-to-region (match-beginning 0) (match-end 0))
-                (delete-region (point-min) (point-max))
-                (when qotd (muse-insert-markup qotd))))
-            (goto-char (point-min))
-            (while (search-forward "%text%" nil t)
-              (remove-text-properties (match-beginning 0) (match-end 0)
-                                      '(read-only nil rear-nonsticky nil))
-              (replace-match text nil t))
-            (when (null qotd)
-              (goto-char (point-min))
-              (when (search-forward "<div class=\"entry-qotd\">" nil t)
-                (let ((beg (match-beginning 0)))
-                  (re-search-forward "</div>\n*" nil t)
-                  (delete-region beg (point))))))))))
-  ;; indicate that we are to continue the :before-end processing
-  nil)
-
-(defun muse-journal-latex-munge-buffer ()
-  (goto-char (point-min))
-  (let ((heading-regexp
-         (concat "^" (regexp-quote (muse-markup-text 'section))
-                 muse-journal-heading-regexp
-                 (regexp-quote (muse-markup-text 'section-end)) "$"))
-        (inhibit-read-only t))
-    (when (re-search-forward heading-regexp nil t)
-      (goto-char (match-beginning 0))
-      (sort-subr nil
-                 (function
-                  (lambda ()
-                    (if (re-search-forward heading-regexp nil t)
-                        (goto-char (match-beginning 0))
-                      (goto-char (point-max)))))
-                 (function
-                  (lambda ()
-                    (if (re-search-forward heading-regexp nil t)
-                        (goto-char (1- (match-beginning 0)))
-                      (goto-char (point-max)))))
-                 (function
-                  (lambda ()
-                    (forward-char 2)))
-                 (function
-                  (lambda ()
-                    (end-of-line)))))
-    (while (re-search-forward heading-regexp nil t)
-      (let ((date (match-string 1))
-            (title (match-string 2))
-            ;; FIXME: Nothing is done with qotd
-            qotd section)
-        (save-match-data
-          (when (and date
-                     (string-match
-                      (concat "\\([1-9][0-9][0-9][0-9]\\)[./]?"
-                              "\\([0-1][0-9]\\)[./]?\\([0-3][0-9]\\)") date))
-            (setq date (encode-time
-                        0 0 0
-                        (string-to-number (match-string 3 date))
-                        (string-to-number (match-string 2 date))
-                        (string-to-number (match-string 1 date))
-                        nil)
-                  date (format-time-string
-                        muse-journal-date-format date))))
-        (save-restriction
-          (narrow-to-region (match-beginning 0) (match-end 0))
-          (delete-region (point-min) (point-max))
-          (muse-insert-markup muse-journal-latex-section)
-          (goto-char (point-min))
-          (while (search-forward "%title%" nil t)
-            (replace-match (or title "Untitled") nil t))
-          (goto-char (point-min))
-          (while (search-forward "%date%" nil t)
-            (replace-match (or date "") nil t))))))
-  (goto-char (point-min))
-  (let ((subheading-regexp
-         (concat "^" (regexp-quote (muse-markup-text 'subsection))
-                 "\\([^\n}]+\\)"
-                 (regexp-quote (muse-markup-text 'subsection-end)) "$"))
-        (inhibit-read-only t))
-    (while (re-search-forward subheading-regexp nil t)
-      (let ((title (match-string 1)))
-        (save-restriction
-          (narrow-to-region (match-beginning 0) (match-end 0))
-          (delete-region (point-min) (point-max))
-          (muse-insert-markup muse-journal-latex-subsection)
-          (goto-char (point-min))
-          (while (search-forward "%title%" nil t)
-            (replace-match title nil t))))))
-  ;; indicate that we are to continue the :before-end processing
-  nil)
-
-(defun muse-journal-rss-munge-buffer ()
-  (goto-char (point-min))
-  (let ((heading-regexp muse-journal-rss-heading-regexp)
-        (inhibit-read-only t))
-    (while (re-search-forward heading-regexp nil t)
-      (let* ((date (match-string 1))
-             (orig-date date)
-             (title (match-string 2))
-             ;; FIXME: Nothing is done with qotd
-             enclosure qotd desc)
-        (if title
-            (save-match-data
-              (if (string-match muse-explicit-link-regexp title)
-                  (setq enclosure (muse-get-link title)
-                        title (muse-get-link-desc title)))))
-        (save-match-data
-          (when (and date
-                     (string-match
-                      (concat "\\([1-9][0-9][0-9][0-9]\\)[./]?"
-                              "\\([0-1][0-9]\\)[./]?\\([0-3][0-9]\\)") date))
-            (setq date (encode-time 0 0 0
-                                    (string-to-number (match-string 3 date))
-                                    (string-to-number (match-string 2 date))
-                                    (string-to-number (match-string 1 date))
-                                    nil)
-                  ;; make sure that date is in a format that RSS
-                  ;; readers can handle
-                  date (let ((system-time-locale "C"))
-                         (format-time-string
-                          (muse-style-element :date-format) date)))))
-        (save-restriction
-          (narrow-to-region
-           (match-beginning 0)
-           (if (re-search-forward heading-regexp nil t)
-               (match-beginning 0)
-             (if (re-search-forward "^Footnotes:" nil t)
-                 (match-beginning 0)
-               (point-max))))
-          (goto-char (point-min))
-          (delete-region (point) (muse-line-end-position))
-          (re-search-forward "</qotd>\n+" nil t)
-          (while (and (char-after)
-                      (eq ?\  (char-syntax (char-after))))
-            (delete-char 1))
-          (let ((beg (point)))
-            (if (muse-style-element :summarize)
-                (progn
-                  (forward-sentence 2)
-                  (setq desc (concat (buffer-substring beg (point)) "...")))
-              (save-restriction
-                (muse-publish-markup-buffer "rss-entry" "journal-rss-entry")
-                (goto-char (point-min))
-                (if (re-search-forward "Page published by Emacs Muse" nil t)
-                    (goto-char (muse-line-end-position))
-                  (muse-display-warning
-                   (concat
-                    "Cannot find 'Page published by Emacs Muse begins here'.\n"
-                    "You will probably need this text in your header."))
-                  (goto-char (point-min)))
-                (setq beg (point))
-                (if (re-search-forward "Page published by Emacs Muse" nil t)
-                    (goto-char (muse-line-beginning-position))
-                  (muse-display-warning
-                   (concat
-                    "Cannot find 'Page published by Emacs Muse ends here'.\n"
-                    "You will probably need this text in your footer."))
-                  (goto-char (point-max)))
-                (setq desc (buffer-substring beg (point))))))
-          (unless (string= desc "")
-            (setq desc (concat "<![CDATA[" desc "]]>")))
-          (delete-region (point-min) (point-max))
-          (let ((entry (muse-style-element :entry-template)))
-            (muse-insert-file-or-string entry)
-            (goto-char (point-min))
-            (while (search-forward "%date%" nil t)
-              (replace-match (or date "") nil t))
-            (goto-char (point-min))
-            (while (search-forward "%title%" nil t)
-              (replace-match "")
-              (save-restriction
-                (narrow-to-region (point) (point))
-                (insert (or title "Untitled"))
-                (remove-text-properties (match-beginning 0) (match-end 0)
-                                        '(read-only nil rear-nonsticky nil))
-                (let ((muse-publishing-current-style (muse-style "html")))
-                  (muse-publish-escape-specials (point-min) (point-max)
-                                                nil 'document))))
-            (goto-char (point-min))
-            (while (search-forward "%desc%" nil t)
-              (replace-match desc nil t))
-            (goto-char (point-min))
-            (while (search-forward "%enclosure%" nil t)
-              (replace-match
-               (if (null enclosure)
-                   ""
-                 (save-match-data
-                   (format
-                    "<enclosure url=\"%s\" %stype=\"%s\"/>"
-                    (if (string-match "//" enclosure)
-                        enclosure
-                      (concat (muse-style-element :base-url)
-                              enclosure))
-                    (let ((file
-                           (expand-file-name enclosure
-                                             (muse-style-element :path))))
-                      (if (file-readable-p file)
-                          (format "length=\"%d\" "
-                                  (nth 7 (file-attributes file)))
-                        ""))
-                    (if (string-match "\\.\\([^.]+\\)$" enclosure)
-                        (let* ((ext (match-string 1 enclosure))
-                               (type
-                                (assoc
-                                 ext muse-journal-rss-enclosure-types-alist)))
-                          (if type
-                              (cdr type)
-                            "application/octet-stream"))))))
-               nil t))
-            (goto-char (point-min))
-            (while (search-forward "%link%" nil t)
-              (replace-match
-               (concat (muse-style-element :base-url)
-                       (concat (muse-page-name)
-                               muse-html-extension))
-               nil t))
-            (goto-char (point-min))
-            (while (search-forward "%anchor%" nil t)
-              (replace-match
-               (muse-journal-anchorize-title (or title orig-date))
-               nil t))
-            (goto-char (point-min))
-            (while (search-forward "%maintainer%" nil t)
-              (replace-match
-               (or (muse-style-element :maintainer)
-                   (concat "webmaster@" (system-name)))
-               nil t)))))))
-  ;; indicate that we are to continue the :before-end processing
-  nil)
-
-
-;;; Register the Muse Journal Publishers
-
-(muse-derive-style "journal-html" "html"
-                   :before-end 'muse-journal-html-munge-buffer)
-
-(muse-derive-style "journal-xhtml" "xhtml"
-                   :before-end 'muse-journal-html-munge-buffer)
-
-(muse-derive-style "journal-latex" "latex"
-                   :tags 'muse-journal-markup-tags
-                   :before-end 'muse-journal-latex-munge-buffer)
-
-(muse-derive-style "journal-pdf" "pdf"
-                   :tags 'muse-journal-markup-tags
-                   :before-end 'muse-journal-latex-munge-buffer)
-
-(muse-derive-style "journal-book-latex" "book-latex"
-                   ;;:nochapters
-                   :tags 'muse-journal-markup-tags
-                   :before-end 'muse-journal-latex-munge-buffer)
-
-(muse-derive-style "journal-book-pdf" "book-pdf"
-                   ;;:nochapters
-                   :tags 'muse-journal-markup-tags
-                   :before-end 'muse-journal-latex-munge-buffer)
-
-(muse-define-style "journal-rdf"
-                   :suffix         'muse-journal-rdf-extension
-                   :regexps        'muse-journal-rss-markup-regexps
-                   :functions      'muse-journal-rss-markup-functions
-                   :before         'muse-journal-rss-munge-buffer
-                   :header         'muse-journal-rdf-header
-                   :footer         'muse-journal-rdf-footer
-                   :date-format    'muse-journal-rdf-date-format
-                   :entry-template 'muse-journal-rdf-entry-template
-                   :base-url       'muse-journal-rdf-base-url
-                   :summarize      'muse-journal-rdf-summarize-entries)
-
-(muse-define-style "journal-rss"
-                   :suffix         'muse-journal-rss-extension
-                   :regexps        'muse-journal-rss-markup-regexps
-                   :functions      'muse-journal-rss-markup-functions
-                   :before         'muse-journal-rss-munge-buffer
-                   :header         'muse-journal-rss-header
-                   :footer         'muse-journal-rss-footer
-                   :date-format    'muse-journal-rss-date-format
-                   :entry-template 'muse-journal-rss-entry-template
-                   :base-url       'muse-journal-rss-base-url
-                   :summarize      'muse-journal-rss-summarize-entries)
-
-;; Used by `muse-journal-rss-munge-buffer' to mark up individual entries
-(muse-derive-style "journal-rss-entry" "html"
-                   :tags 'muse-journal-markup-tags)
-
-(provide 'muse-journal)
-
-;;; muse-journal.el ends here
diff --git a/packages/muse/muse-latex.el b/packages/muse/muse-latex.el
deleted file mode 100644
index e416367..0000000
--- a/packages/muse/muse-latex.el
+++ /dev/null
@@ -1,669 +0,0 @@
-;;; muse-latex.el --- publish entries in LaTex or PDF format
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;; Li Daobing (lidaobing AT gmail DOT com) provided CJK support.
-
-;; Trent Buck (trentbuck AT gmail DOT com) gave valuable advice for
-;; how to treat LaTeX specials and the like.
-
-;; Matthias Kegelmann (mathias DOT kegelmann AT sdm DOT de) provided a
-;; scenario where we would need to respect the <contents> tag.
-
-;; Jean Magnan de Bornier (jean AT bornier DOT net) provided the
-;; markup string for link-and-anchor.
-
-;; Jim Ottaway (j DOT ottaway AT lse DOT ac DOT uk) implemented slides
-;; and lecture notes.
-
-;; Karl Berry (karl AT freefriends DOT org) suggested how to escape
-;; additional special characters in image filenames.
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse LaTeX Publishing
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-publish)
-
-(defgroup muse-latex nil
-  "Rules for marking up a Muse file as a LaTeX article."
-  :group 'muse-publish)
-
-(defcustom muse-latex-extension ".tex"
-  "Default file extension for publishing LaTeX files."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latex-pdf-extension ".pdf"
-  "Default file extension for publishing LaTeX files to PDF."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latex-pdf-browser "open %s"
-  "The program to use when browsing a published PDF file.
-This should be a format string."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latex-pdf-program "pdflatex"
-  "The program that is called to generate PDF content from LaTeX content."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latex-pdf-cruft
-  '(".aux" ".log" ".nav" ".out" ".snm" ".toc" ".vrb")
-  "Extensions of files to remove after generating PDF output successfully."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latex-header
-  "\\documentclass{article}
-
-\\usepackage[english]{babel}
-\\usepackage{ucs}
-\\usepackage[utf8x]{inputenc}
-\\usepackage[T1]{fontenc}
-\\usepackage{hyperref}
-\\usepackage[pdftex]{graphicx}
-
-\\def\\museincludegraphics{%
-  \\begingroup
-  \\catcode`\\|=0
-  \\catcode`\\\\=12
-  \\catcode`\\#=12
-  \\includegraphics[width=0.75\\textwidth]
-}
-
-\\begin{document}
-
-\\title{<lisp>(muse-publish-escape-specials-in-string
-  (muse-publishing-directive \"title\") 'document)</lisp>}
-\\author{<lisp>(muse-publishing-directive \"author\")</lisp>}
-\\date{<lisp>(muse-publishing-directive \"date\")</lisp>}
-
-\\maketitle
-
-<lisp>(and muse-publish-generate-contents
-           (not muse-latex-permit-contents-tag)
-           \"\\\\tableofcontents\n\\\\newpage\")</lisp>\n\n"
-  "Header used for publishing LaTeX files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latex-footer "<lisp>(muse-latex-bibliography)</lisp>
-\\end{document}\n"
-  "Footer used for publishing LaTeX files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latexcjk-header
-  "\\documentclass{article}
-
-\\usepackage{CJK}
-\\usepackage{indentfirst}
-\\usepackage[CJKbookmarks=true]{hyperref}
-\\usepackage[pdftex]{graphicx}
-
-\\begin{document}
-\\begin{CJK*}<lisp>(muse-latexcjk-encoding)</lisp>
-
-\\title{<lisp>(muse-publish-escape-specials-in-string
-  (muse-publishing-directive \"title\") 'document)</lisp>}
-\\author{<lisp>(muse-publishing-directive \"author\")</lisp>}
-\\date{<lisp>(muse-publishing-directive \"date\")</lisp>}
-
-\\maketitle
-
-<lisp>(and muse-publish-generate-contents
-           (not muse-latex-permit-contents-tag)
-           \"\\\\tableofcontents\n\\\\newpage\")</lisp>\n\n"
-  "Header used for publishing LaTeX files (CJK).  This may be text or a
-filename."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latexcjk-footer
-  "\n\\end{CJK*}
-\\end{document}\n"
-  "Footer used for publishing LaTeX files (CJK).  This may be text or a
-filename."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latex-slides-header
-  "\\documentclass[ignorenonframetext]{beamer}
-
-\\usepackage[english]{babel}
-\\usepackage{ucs}
-\\usepackage[utf8x]{inputenc}
-\\usepackage[T1]{fontenc}
-\\usepackage{hyperref}
-
-\\def\\museincludegraphics{%
-  \\begingroup
-  \\catcode`\\|=0
-  \\catcode`\\\\=12
-  \\catcode`\\#=12
-  \\includegraphics[width=0.50\\textwidth]
-}
-
-\\title{<lisp>(muse-publish-escape-specials-in-string
-  (muse-publishing-directive \"title\") 'document)</lisp>}
-\\author{<lisp>(muse-publishing-directive \"author\")</lisp>}
-\\date{<lisp>(muse-publishing-directive \"date\")</lisp>}
-
-\\begin{document}
-
-\\frame{\\titlepage}
-
-<lisp>(and muse-publish-generate-contents
-           \"\\\\frame{\\\\tableofcontents}\")</lisp>\n\n"
-  "Header for publishing of slides using LaTeX.
-This may be text or a filename.
-
-You must have the Beamer extension for LaTeX installed for this to work."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latex-lecture-notes-header
-  "\\documentclass{article}
-\\usepackage{beamerarticle}
-
-\\usepackage[english]{babel}
-\\usepackage{ucs}
-\\usepackage[utf8x]{inputenc}
-\\usepackage[T1]{fontenc}
-\\usepackage{hyperref}
-\\usepackage[pdftex]{graphicx}
-
-\\def\\museincludegraphics{%
-  \\begingroup
-  \\catcode`\\|=0
-  \\catcode`\\\\=12
-  \\catcode`\\#=12
-  \\includegraphics[width=0.50\\textwidth]
-}
-
-\\title{<lisp>(muse-publish-escape-specials-in-string
-  (muse-publishing-directive \"title\") 'document)</lisp>}
-\\author{<lisp>(muse-publishing-directive \"author\")</lisp>}
-\\date{<lisp>(muse-publishing-directive \"date\")</lisp>}
-
-\\begin{document}
-
-\\frame{\\titlepage}
-
-<lisp>(and muse-publish-generate-contents
-           \"\\\\frame{\\\\tableofcontents}\")</lisp>\n\n"
-  "Header for publishing of lecture notes using LaTeX.
-This may be text or a filename.
-
-You must have the Beamer extension for LaTeX installed for this to work."
-  :type 'string
-  :group 'muse-latex)
-
-(defcustom muse-latex-markup-regexps
-  `(;; numeric ranges
-    (10000 "\\([0-9]+\\)-\\([0-9]+\\)" 0 "\\1--\\2")
-
-    ;; be careful of closing quote pairs
-    (10100 "\"'" 0 "\"\\\\-'"))
-  "List of markup regexps for identifying regions in a Muse page.
-For more on the structure of this list, see `muse-publish-markup-regexps'."
-  :type '(repeat (choice
-                  (list :tag "Markup rule"
-                        integer
-                        (choice regexp symbol)
-                        integer
-                        (choice string function symbol))
-                  function))
-  :group 'muse-latex)
-
-(defcustom muse-latex-markup-functions
-  '((table . muse-latex-markup-table))
-  "An alist of style types to custom functions for that kind of text.
-For more on the structure of this list, see
-`muse-publish-markup-functions'."
-  :type '(alist :key-type symbol :value-type function)
-  :group 'muse-latex)
-
-(defcustom muse-latex-markup-strings
-  '((image-with-desc . "\\begin{figure}[h]
-\\centering\\museincludegraphics{%s.%s}|endgroup
-\\caption{%s}
-\\end{figure}")
-    (image           . "\\begin{figure}[h]
-\\centering\\museincludegraphics{%s.%s}|endgroup
-\\end{figure}")
-    (image-link      . "%% %s
-\\museincludegraphics{%s.%s}|endgroup")
-    (anchor-ref      . "\\ref{%s}")
-    (url             . "\\url{%s}")
-    (url-and-desc    . "\\href{%s}{%s}\\footnote{%1%}")
-    (link            . "\\href{%s}{%s}\\footnote{%1%}")
-    (link-and-anchor . "\\href{%1%}{%3%}\\footnote{%1%}")
-    (email-addr      . "\\verb|%s|")
-    (anchor          . "\\label{%s}")
-    (emdash          . "---")
-    (comment-begin   . "% ")
-    (rule            . "\\vspace{.5cm}\\hrule\\vspace{.5cm}")
-    (no-break-space  . "~")
-    (line-break      . "\\\\")
-    (enddots         . "\\ldots{}")
-    (dots            . "\\dots{}")
-    (part            . "\\part{")
-    (part-end        . "}")
-    (chapter         . "\\chapter{")
-    (chapter-end     . "}")
-    (section         . "\\section{")
-    (section-end     . "}")
-    (subsection      . "\\subsection{")
-    (subsection-end  . "}")
-    (subsubsection   . "\\subsubsection{")
-    (subsubsection-end . "}")
-    (section-other   . "\\paragraph{")
-    (section-other-end . "}")
-    (footnote        . "\\footnote{")
-    (footnote-end    . "}")
-    (footnotetext    . "\\footnotetext[%d]{")
-    (begin-underline . "\\underline{")
-    (end-underline   . "}")
-    (begin-literal   . "\\texttt{")
-    (end-literal     . "}")
-    (begin-emph      . "\\emph{")
-    (end-emph        . "}")
-    (begin-more-emph . "\\textbf{")
-    (end-more-emph   . "}")
-    (begin-most-emph . "\\textbf{\\emph{")
-    (end-most-emph   . "}}")
-    (begin-verse     . "\\begin{verse}\n")
-    (end-verse-line  . " \\\\")
-    (verse-space     . "~~~~")
-    (end-verse       . "\n\\end{verse}")
-    (begin-example   . "\\begin{quote}\n\\begin{verbatim}")
-    (end-example     . "\\end{verbatim}\n\\end{quote}")
-    (begin-center    . "\\begin{center}\n")
-    (end-center      . "\n\\end{center}")
-    (begin-quote     . "\\begin{quote}\n")
-    (end-quote       . "\n\\end{quote}")
-    (begin-cite     . "\\cite{")
-    (begin-cite-author . "\\citet{")
-    (begin-cite-year . "\\citet{")
-    (end-cite        . "}")
-    (begin-uli       . "\\begin{itemize}\n")
-    (end-uli         . "\n\\end{itemize}")
-    (begin-uli-item  . "\\item ")
-    (begin-oli       . "\\begin{enumerate}\n")
-    (end-oli         . "\n\\end{enumerate}")
-    (begin-oli-item  . "\\item ")
-    (begin-dl        . "\\begin{description}\n")
-    (end-dl          . "\n\\end{description}")
-    (begin-ddt       . "\\item[")
-    (end-ddt         . "] \\mbox{}\n"))
-  "Strings used for marking up text.
-These cover the most basic kinds of markup, the handling of which
-differs little between the various styles."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-latex)
-
-(defcustom muse-latex-slides-markup-tags
-  '(("slide" t t nil muse-latex-slide-tag))
- "A list of tag specifications, for specially marking up LaTeX slides."
-  :type '(repeat (list (string :tag "Markup tag")
-                       (boolean :tag "Expect closing tag" :value t)
-                       (boolean :tag "Parse attributes" :value nil)
-                       (boolean :tag "Nestable" :value nil)
-                       function))
-  :group 'muse-latex)
-
-(defcustom muse-latexcjk-encoding-map
-  '((utf-8              . "{UTF8}{song}")
-    (japanese-iso-8bit  . "[dnp]{JIS}{min}")
-    (chinese-big5       . "{Bg5}{bsmi}")
-    (mule-utf-8         . "{UTF8}{song}")
-    (chinese-iso-8bit   . "{GB}{song}")
-    (chinese-gbk        . "{GBK}{song}"))
-  "An alist mapping emacs coding systems to appropriate CJK codings.
-Use the base name of the coding system (ie, without the -unix)."
-  :type '(alist :key-type coding-system :value-type string)
-  :group 'muse-latex)
-
-(defcustom muse-latexcjk-encoding-default "{GB}{song}"
-  "The default Emacs buffer encoding to use in published files.
-This will be used if no special characters are found."
-  :type 'string
-  :group 'muse-latex)
-
-(defun muse-latexcjk-encoding ()
-  (when (boundp 'buffer-file-coding-system)
-    (muse-latexcjk-transform-content-type buffer-file-coding-system)))
-
-(defun muse-latexcjk-transform-content-type (content-type)
-  "Using `muse-cjklatex-encoding-map', try and resolve an emacs coding
-system to an associated CJK coding system."
-  (let ((match (and (fboundp 'coding-system-base)
-                    (assoc (coding-system-base content-type)
-                           muse-latexcjk-encoding-map))))
-    (if match
-        (cdr match)
-      muse-latexcjk-encoding-default)))
-
-(defcustom muse-latex-markup-specials-document
-  '((?\\ . "\\textbackslash{}")
-    (?\_ . "\\textunderscore{}")
-    (?\< . "\\textless{}")
-    (?\> . "\\textgreater{}")
-    (?^  . "\\^{}")
-    (?\~ . "\\~{}")
-    (?\@ . "\\@")
-    (?\$ . "\\$")
-    (?\% . "\\%")
-    (?\{ . "\\{")
-    (?\} . "\\}")
-    (?\& . "\\&")
-    (?\# . "\\#"))
-  "A table of characters which must be represented specially.
-These are applied to the entire document, sans already-escaped
-regions."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-latex)
-
-(defcustom muse-latex-markup-specials-example
-  '()
-  "A table of characters which must be represented specially.
-These are applied to <example> regions.
-
-With the default interpretation of <example> regions, no specials
-need to be escaped."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-latex)
-
-(defcustom muse-latex-markup-specials-literal
-  '((?\n . "\\\n")
-    (?\\ . "\\textbackslash{}")
-    (?_  . "\\textunderscore{}")
-    (?\< . "\\textless{}")
-    (?\> . "\\textgreater{}")
-    (?^  . "\\^{}")
-    (?\~ . "\\~{}")
-    (?\$ . "\\$")
-    (?\% . "\\%")
-    (?\{ . "\\{")
-    (?\} . "\\}")
-    (?\& . "\\&")
-    (?\# . "\\#"))
-  "A table of characters which must be represented specially.
-This applies to =monospaced text= and <code> regions."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-latex)
-
-(defcustom muse-latex-markup-specials-url
-  '((?\\ . "\\textbackslash{}")
-    (?\_ . "\\_")
-    (?\< . "\\<")
-    (?\> . "\\>")
-    (?\$ . "\\$")
-    (?\% . "\\%")
-    (?\{ . "\\{")
-    (?\} . "\\}")
-    (?\& . "\\&")
-    (?\# . "\\#"))
-  "A table of characters which must be represented specially.
-These are applied to URLs."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-latex)
-
-(defcustom muse-latex-markup-specials-image
-  '((?\\ . "\\\\")
-    (?\< . "\\<")
-    (?\> . "\\>")
-    (?\$ . "\\$")
-    (?\% . "\\%")
-    (?\{ . "\\{")
-    (?\} . "\\}")
-    (?\& . "\\&")
-    (?\# . "\\#")
-    (?\| . "\\|"))
-  "A table of characters which must be represented specially.
-These are applied to image filenames."
-  :type '(alist :key-type character :value-type string)
-  :group 'muse-latex)
-
-(defun muse-latex-decide-specials (context)
-  "Determine the specials to escape, depending on CONTEXT."
-  (cond ((memq context '(underline emphasis document url-desc verbatim
-                                   footnote))
-         muse-latex-markup-specials-document)
-        ((eq context 'image)
-         muse-latex-markup-specials-image)
-        ((memq context '(email url))
-         muse-latex-markup-specials-url)
-        ((eq context 'literal)
-         muse-latex-markup-specials-literal)
-        ((eq context 'example)
-         muse-latex-markup-specials-example)
-        (t (error "Invalid context '%s' in muse-latex" context))))
-
-(defcustom muse-latex-permit-contents-tag nil
-  "If nil, ignore <contents> tags.  Otherwise, insert table of contents.
-
-Most of the time, it is best to have a table of contents on the
-first page, with a new page immediately following.  To make this
-work with documents published in both HTML and LaTeX, we need to
-ignore the <contents> tag.
-
-If you don't agree with this, then set this option to non-nil,
-and it will do what you expect."
-  :type 'boolean
-  :group 'muse-latex)
-
-(defun muse-latex-markup-table ()
-  (let* ((table-info (muse-publish-table-fields (match-beginning 0)
-                                                (match-end 0)))
-         (row-len (car table-info))
-         (field-list (cdr table-info)))
-    (when table-info
-      (muse-insert-markup "\\begin{tabular}{" (make-string row-len ?l) "}\n")
-      (dolist (fields field-list)
-        (let ((type (car fields)))
-          (setq fields (cdr fields))
-          (if (eq type 'hline)
-              (muse-insert-markup "\\hline\n")
-            (when (= type 3)
-              (muse-insert-markup "\\hline\n"))
-            (insert (car fields))
-            (setq fields (cdr fields))
-            (dolist (field fields)
-              (muse-insert-markup " & ")
-              (insert field))
-            (muse-insert-markup " \\\\\n")
-            (when (= type 2)
-              (muse-insert-markup "\\hline\n")))))
-      (muse-insert-markup "\\end{tabular}"))))
-
-;;; Tags for LaTeX
-
-(defun muse-latex-slide-tag (beg end attrs)
-  "Publish the <slide> tag in LaTeX.
-This is used by the slides and lecture-notes publishing styles."
-  (let ((title (cdr (assoc "title" attrs))))
-    (goto-char beg)
-    (muse-insert-markup "\\begin{frame}[fragile]\n")
-    (when title
-      (muse-insert-markup "\\frametitle{")
-      (insert title)
-      (muse-insert-markup "}\n"))
-    (save-excursion
-      (goto-char end)
-      (muse-insert-markup "\n\\end{frame}"))))
-
-;;; Post-publishing functions
-
-(defun muse-latex-fixup-dquotes ()
-  "Fixup double quotes."
-  (goto-char (point-min))
-  (let ((open t))
-    (while (search-forward "\"" nil t)
-      (unless (get-text-property (match-beginning 0) 'read-only)
-        (when (or (bobp)
-                  (eq (char-before) ?\n))
-          (setq open t))
-        (if open
-            (progn
-              (replace-match "``")
-              (setq open nil))
-          (replace-match "''")
-          (setq open t))))))
-
-(defun muse-latex-fixup-citations ()
-  "Replace semicolons in multi-head citations with colons."
-  (goto-char (point-min))
-  (while (re-search-forward "\\\\cite.?{" nil t)
-    (let ((start (point))
-          (end (re-search-forward "}")))
-      (save-restriction
-        (narrow-to-region start end)
-        (goto-char (point-min))
-        (while (re-search-forward ";" nil t)
-          (replace-match ","))))))
-
-(defun muse-latex-fixup-headings ()
-  "Remove footnotes in headings, since LaTeX does not permit them to exist.
-
-This can happen if there is a link in a heading, because by
-default Muse will add a footnote for each link."
-  (goto-char (point-min))
-  (while (re-search-forward "^\\\\section.?{" nil t)
-    (save-restriction
-      (narrow-to-region (match-beginning 0) (muse-line-end-position))
-      (goto-char (point-min))
-      (while (re-search-forward "\\\\footnote{[^}\n]+}" nil t)
-        (replace-match ""))
-      (forward-line 1))))
-
-(defun muse-latex-munge-buffer ()
-  (muse-latex-fixup-dquotes)
-  (muse-latex-fixup-citations)
-  (muse-latex-fixup-headings)
-  (when (and muse-latex-permit-contents-tag
-             muse-publish-generate-contents)
-    (goto-char (car muse-publish-generate-contents))
-    (muse-insert-markup "\\tableofcontents")))
-
-(defun muse-latex-bibliography ()
-  (save-excursion
-    (goto-char (point-min))
-    (if (re-search-forward "\\\\cite.?{" nil t)
-        (concat
-         "\\bibliography{"
-         (muse-publishing-directive "bibsource")
-         "}\n")
-      "")))
-
-(defun muse-latex-pdf-browse-file (file)
-  (shell-command (format muse-latex-pdf-browser file)))
-
-(defun muse-latex-pdf-generate (file output-path final-target)
-  (apply
-   #'muse-publish-transform-output
-   file output-path final-target "PDF"
-   (function
-    (lambda (file output-path)
-      (let* ((fnd (file-name-directory output-path))
-             (command (format "%s \"%s\""
-                              muse-latex-pdf-program
-                              (file-relative-name file fnd)))
-             (times 0)
-             (default-directory fnd)
-             result)
-        ;; XEmacs can sometimes return a non-number result.  We'll err
-        ;; on the side of caution by continuing to attempt to generate
-        ;; the PDF if this happens and treat the final result as
-        ;; successful.
-        (while (and (< times 2)
-                    (or (not (numberp result))
-                        (not (eq result 0))
-                        ;; table of contents takes 2 passes
-                        (file-readable-p
-                         (muse-replace-regexp-in-string
-                          "\\.tex\\'" ".toc" file t t))))
-          (setq result (shell-command command)
-                times (1+ times)))
-        (if (or (not (numberp result))
-                (eq result 0))
-            t
-          nil))))
-   muse-latex-pdf-cruft))
-
-;;; Register the Muse LATEX Publishers
-
-(muse-define-style "latex"
-                   :suffix    'muse-latex-extension
-                   :regexps   'muse-latex-markup-regexps
-                   :functions 'muse-latex-markup-functions
-                   :strings   'muse-latex-markup-strings
-                   :specials  'muse-latex-decide-specials
-                   :before-end 'muse-latex-munge-buffer
-                   :header    'muse-latex-header
-                   :footer    'muse-latex-footer
-                   :browser   'find-file)
-
-(muse-derive-style "pdf" "latex"
-                   :final   'muse-latex-pdf-generate
-                   :browser 'muse-latex-pdf-browse-file
-                   :link-suffix 'muse-latex-pdf-extension
-                   :osuffix 'muse-latex-pdf-extension)
-
-(muse-derive-style "latexcjk" "latex"
-                   :header    'muse-latexcjk-header
-                   :footer    'muse-latexcjk-footer)
-
-(muse-derive-style "pdfcjk" "latexcjk"
-                   :final   'muse-latex-pdf-generate
-                   :browser 'muse-latex-pdf-browse-file
-                   :link-suffix 'muse-latex-pdf-extension
-                   :osuffix 'muse-latex-pdf-extension)
-
-(muse-derive-style "slides" "latex"
-                   :header 'muse-latex-slides-header
-                   :tags   'muse-latex-slides-markup-tags)
-
-(muse-derive-style "slides-pdf" "pdf"
-                   :header 'muse-latex-slides-header
-                   :tags   'muse-latex-slides-markup-tags)
-
-(muse-derive-style "lecture-notes" "slides"
-                   :header 'muse-latex-lecture-notes-header)
-
-(muse-derive-style "lecture-notes-pdf" "slides-pdf"
-                   :header 'muse-latex-lecture-notes-header)
-
-(provide 'muse-latex)
-
-;;; muse-latex.el ends here
diff --git a/packages/muse/muse-latex2png.el b/packages/muse/muse-latex2png.el
deleted file mode 100644
index 2b4373d..0000000
--- a/packages/muse/muse-latex2png.el
+++ /dev/null
@@ -1,277 +0,0 @@
-;; muse-latex2png.el --- generate PNG images from inline LaTeX code
-
-;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; Author: Michael Olson <mwolson@gnu.org>
-;; Created: 12-Oct-2005
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; This was taken from latex2png.el, by Ganesh Swami <ganesh AT
-;; iamganesh DOT com>, which was made for emacs-wiki.  It has since
-;; been extensively rewritten for Muse.
-
-;;; To do
-
-;; Remove stale image files.  This could be done by making a function
-;; for `muse-before-publish-hook' that deletes according to
-;; (muse-page-name).
-
-;;; Code
-
-(require 'muse-publish)
-
-(defgroup muse-latex2png nil
-  "Publishing LaTeX formulas as PNG files."
-  :group 'muse-publish)
-
-(defcustom muse-latex2png-img-dest "./latex"
-  "The folder where the generated images will be placed.
-This is relative to the current publishing directory."
-  :type 'string
-  :group 'muse-latex2png)
-
-(defcustom muse-latex2png-scale-factor 2.5
-  "The scale factor to be used for sizing the resulting LaTeX output."
-  :type 'number
-  :group 'muse-latex2png)
-
-(defcustom muse-latex2png-fg "Black"
-  "The foreground color."
-  :type 'string
-  :group 'muse-latex2png)
-
-(defcustom muse-latex2png-bg "Transparent"
-  "The background color."
-  :type 'string
-  :group 'muse-latex2png)
-
-(defcustom muse-latex2png-template
-  "\\documentclass{article}
-\\usepackage{fullpage}
-\\usepackage{amssymb}
-\\usepackage[usenames]{color}
-\\usepackage{amsmath}
-\\usepackage{latexsym}
-\\usepackage[mathscr]{eucal}
-%preamble%
-\\pagestyle{empty}
-\\begin{document}
-{%code%}
-\\end{document}\n"
-  "The LaTeX template to use."
-  :type 'string
-  :group 'muse-latex2png)
-
-(defun muse-latex2png-move2pubdir (file prefix pubdir)
-  "Move FILE to the PUBDIR folder.
-
-This is done so that the resulting images do not clutter your
-main publishing directory.
-
-Old files with PREFIX in the name are deleted."
-  (when file
-    (if (file-exists-p file)
-        (progn
-          (unless (file-directory-p pubdir)
-            (message "Creating latex directory %s" pubdir)
-            (make-directory pubdir))
-          (copy-file file (expand-file-name (file-name-nondirectory file)
-                                            pubdir)
-                     t)
-          (delete-file file)
-          (concat muse-latex2png-img-dest "/" (file-name-nondirectory file)))
-      (message "Cannot find %s!" file))))
-
-(defun muse-latex2png (code prefix preamble)
-  "Convert the LaTeX CODE into a png file beginning with PREFIX.
-PREAMBLE indicates extra packages and definitions to include."
-  (unless preamble
-    (setq preamble ""))
-  (unless prefix
-    (setq prefix "muse-latex2png"))
-  (let* ((tmpdir (cond ((boundp 'temporary-file-directory)
-                        temporary-file-directory)
-                       ((fboundp 'temp-directory)
-                        (temp-directory))
-                       (t "/tmp")))
-         (texfile (expand-file-name
-                   (concat prefix "__"  (format "%d" (abs (sxhash code))))
-                   tmpdir))
-         (defalt-directory default-directory))
-    (with-temp-file (concat texfile ".tex")
-      (insert muse-latex2png-template)
-      (goto-char (point-min))
-      (while (search-forward "%preamble%" nil t)
-        (replace-match preamble nil t))
-      (goto-char (point-min))
-      (while (search-forward "%code%" nil t)
-        (replace-match code nil t)))
-    (setq default-directory tmpdir)
-    (call-process "latex" nil nil nil texfile)
-    (if (file-exists-p (concat texfile ".dvi"))
-        (progn
-          (call-process
-           "dvipng" nil nil nil
-           "-E"
-           "-fg" muse-latex2png-fg
-           "-bg" muse-latex2png-bg
-           "-T" "tight"
-           "-x" (format  "%s" (* muse-latex2png-scale-factor 1000))
-           "-y" (format  "%s" (* muse-latex2png-scale-factor 1000))
-           "-o" (concat texfile ".png")
-           (concat texfile ".dvi"))
-          (if (file-exists-p (concat texfile ".png"))
-              (progn
-                (delete-file (concat texfile ".dvi"))
-                (delete-file (concat texfile ".tex"))
-                (delete-file (concat texfile ".aux"))
-                (delete-file (concat texfile ".log"))
-                (concat texfile ".png"))
-            (message "Failed to create png file")
-            nil))
-      (message (concat "Failed to create dvi file " texfile))
-      nil)))
-
-(defun muse-latex2png-region (beg end attrs)
-  "Generate an image for the Latex code between BEG and END.
-If a Muse page is currently being published, replace the given
-region with the appropriate markup that displays the image.
-Otherwise, just return the path of the generated image.
-
-Valid keys for the ATTRS alist are as follows.
-
-prefix: The prefix given to the image file.
-preamble: Extra text to add to the Latex preamble.
-inline: Display image as inline, instead of a block."
-  (let ((end-marker (set-marker (make-marker) (1+ end)))
-        (pubdir (expand-file-name
-                 muse-latex2png-img-dest
-                 (file-name-directory muse-publishing-current-output-path))))
-    (save-restriction
-      (narrow-to-region beg end)
-      (let* ((text (buffer-substring-no-properties beg end))
-             ;; the prefix given to the image file.
-             (prefix (cdr (assoc "prefix" attrs)))
-             ;; preamble (for extra options)
-             (preamble (cdr (assoc "preamble" attrs)))
-             ;; display inline or as a block
-             (display (car (assoc "inline" attrs))))
-        (when muse-publishing-p
-          (delete-region beg end)
-          (goto-char (point-min)))
-        (unless (file-directory-p pubdir)
-          (make-directory pubdir))
-        (let ((path (muse-latex2png-move2pubdir
-                     (muse-latex2png text prefix preamble)
-                     prefix pubdir)))
-          (when path
-            (when muse-publishing-p
-              (muse-insert-markup
-               (if (muse-style-derived-p "html")
-                   (concat "<img src=\"" path
-                           "\" alt=\"latex2png equation\" "
-                           (if display (concat "class=\"latex-inline\"")
-                             (concat "class=\"latex-display\""))
-                           (if (muse-style-derived-p "xhtml")
-                               " />"
-                             ">")
-                           (muse-insert-markup "<!-- " text "-->"))
-                 (let ((ext (or (file-name-extension path) ""))
-                       (path (muse-path-sans-extension path)))
-                   (muse-markup-text 'image path ext))))
-              (goto-char (point-max)))
-            path))))))
-
-(defun muse-publish-latex-tag (beg end attrs)
-  "If the current style is not Latex-based, generate an image for the
-given Latex code.  Otherwise, don't do anything to the region.
-See `muse-latex2png-region' for valid keys for ATTRS."
-  (unless (assoc "prefix" attrs)
-    (setq attrs (cons (cons "prefix"
-                            (concat "latex2png-" (muse-page-name)))
-                      attrs)))
-  (if (or (muse-style-derived-p "latex") (muse-style-derived-p "context"))
-      (muse-publish-mark-read-only beg end)
-    (muse-latex2png-region beg end attrs)))
-
-(put 'muse-publish-latex-tag 'muse-dangerous-tag t)
-
-(defun muse-publish-math-tag (beg end)
-  "Surround the given region with \"$\" characters.  Then, if the
-current style is not Latex-based, generate an image for the given
-Latex math code.
-
-If 6 or more spaces come before the tag, and the end of the tag
-is at the end of a line, then surround the region with the
-equivalent of \"$$\" instead.  This causes the region to be
-centered in the published output, among other things."
-  (let* ((centered (and (re-search-backward
-                         (concat "^[" muse-regexp-blank "]\\{6,\\}\\=")
-                         nil t)
-                        (save-excursion
-                          (save-match-data
-                            (goto-char end)
-                            (looking-at (concat "[" muse-regexp-blank "]*$"))))
-                        (prog1 t
-                          (replace-match "")
-                          (when (and (or (muse-style-derived-p "latex")
-                                         (muse-style-derived-p "context"))
-                                     (not (bobp)))
-                            (backward-char 1)
-                            (if (bolp)
-                                (delete-char 1)
-                              (forward-char 1)))
-                          (setq beg (point)))))
-         (tag-beg (if centered
-                      (if (muse-style-derived-p "context")
-                          "\\startformula " "\\[ ")
-                    "$"))
-         (tag-end (if centered
-                      (if (muse-style-derived-p "context")
-                          " \\stopformula" " \\]")
-                    "$"))
-         (attrs (nconc (list (cons "prefix"
-                                   (concat "latex2png-" (muse-page-name))))
-                       (if centered nil
-                         '(("inline" . t))))))
-    (goto-char beg)
-    (muse-insert-markup tag-beg)
-    (goto-char end)
-    (muse-insert-markup tag-end)
-    (if (or (muse-style-derived-p "latex") (muse-style-derived-p "context"))
-        (muse-publish-mark-read-only beg (point))
-      (muse-latex2png-region beg (point) attrs))))
-
-(put 'muse-publish-math-tag 'muse-dangerous-tag t)
-
-;;; Insinuate with muse-publish
-
-(add-to-list 'muse-publish-markup-tags
-             '("latex" t t nil muse-publish-latex-tag)
-             t)
-
-(add-to-list 'muse-publish-markup-tags
-             '("math" t nil nil muse-publish-math-tag)
-             t)
-
-(provide 'muse-latex2png)
-;;; muse-latex2png.el ends here
diff --git a/packages/muse/muse-mode.el b/packages/muse/muse-mode.el
deleted file mode 100644
index 75b1db3..0000000
--- a/packages/muse/muse-mode.el
+++ /dev/null
@@ -1,1012 +0,0 @@
-;;; muse-mode.el --- mode for editing Muse files; has font-lock support
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; The Emacs Muse major mode is basically a hyped-up text-mode which
-;; knows a lot more about the apparent structure of the document.
-
-;;; Contributors:
-
-;; Andrea Riciputi (ariciputi AT pito DOT com) gave an initial
-;; implementation for tag completion by means of the `muse-insert-tag'
-;; function.
-
-;; Per B. Sederberg (per AT med DOT upenn DOT edu) contributed the
-;; insertion of relative links and list items, backlink searching, and
-;; other things as well.
-
-;; Stefan Schlee (stefan_schlee AT yahoo DOT com) fixed a bug in
-;; muse-next-reference and muse-previous-reference involving links
-;; that begin at point 1.
-
-;; Gregory Collins (greg AT gregorycollins DOT net) fixed a bug with
-;; paragraph separation and headings when filling.
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Emacs Muse Major Mode
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(provide 'muse-mode)
-
-(require 'muse)
-(require 'muse-regexps)
-(require 'muse-project)
-
-(autoload 'muse-use-font-lock "muse-colors")
-(autoload 'muse-publish-this-file "muse-publish")
-(autoload 'muse-publish-get-style "muse-publish")
-(autoload 'muse-publish-output-file "muse-publish")
-
-(require 'derived)
-(eval-when-compile
-  (condition-case nil
-      (require 'pcomplete)              ; load if available
-    (error nil)))
-
-;;; Options:
-
-(defgroup muse-mode nil
-  "Options controlling the behavior of the Muse editing Mode."
-  :group 'muse)
-
-(defcustom muse-mode-highlight-p t
-  "If non-nil, highlight the content of Muse buffers."
-  :type 'boolean
-  :require 'muse-colors
-  :group 'muse-mode)
-
-(defcustom muse-mode-auto-p nil
-  "If non-nil, automagically determine when Muse mode should be activated."
-  :type 'boolean
-  :set (function
-        (lambda (sym value)
-          (if value
-              (add-hook 'find-file-hook 'muse-mode-maybe)
-            (remove-hook 'find-file-hook 'muse-mode-maybe))
-          (set sym value)))
-  :group 'muse-mode)
-
-(defun muse-mode-maybe-after-init ()
-  (when muse-mode-auto-p
-    (add-hook 'find-file-hook 'muse-mode-maybe)))
-
-;; If the user sets this value in their init file, make sure that
-;; it takes effect
-(add-hook 'after-init-hook 'muse-mode-maybe-after-init)
-
-(defcustom muse-mode-intangible-links nil
-  "If non-nil, use the intangible property on links.
-This can cause problems with flyspell (and potentially fill-mode),
-so only enable this if you don't use either of these."
-  :type 'boolean
-  :group 'muse-mode)
-
-(defcustom muse-mode-hook nil
-  "A hook that is run when Muse mode is entered."
-  :type 'hook
-  :options '(flyspell-mode footnote-mode turn-on-auto-fill
-             highlight-changes-mode)
-  :group 'muse-mode)
-
-(defcustom muse-grep-command
-  "find %D -type f ! -name '*~' | xargs -I {} echo \\\"{}\\\" | xargs egrep -n 
-e \"%W\""
-  "The command to use when grepping for backlinks and other
-searches through the muse projects.  The string %D is replaced by
-the directories from muse-project-alist, space-separated.  The
-string %W is replaced with the name of the muse page or whatever
-else you are searching for.  This command has been modified to
-handle spaces in filenames, which were giving egrep a problem.
-
-Note: We highly recommend using glimpse to search large projects.
-To use glimpse, install and edit a file called .glimpse_exclude
-in your home directory.  Put a list of glob patterns in that file
-to exclude Emacs backup files, etc.  Then, run the indexer using:
-
-  glimpseindex -o <list of Wiki directories>
-
-Once that's completed, customize this variable to have the
-following value:
-
-  glimpse -nyi \"%W\"
-
-Your searches will go much, much faster, especially for very
-large projects.  Don't forget to add a user cronjob to update the
-index at intervals."
-  :type 'string
-  :group 'muse-mode)
-
-(defvar muse-insert-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "l" 'muse-insert-relative-link-to-file)
-    (define-key map "t" 'muse-insert-tag)
-    (define-key map "u" 'muse-insert-url)
-
-    map))
-
-;;; Muse mode
-
-(defvar muse-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [(control ?c) (control ?a)] 'muse-index)
-    (define-key map [(control ?c) (control ?e)] 'muse-edit-link-at-point)
-    (define-key map [(control ?c) (control ?l)] 'font-lock-mode)
-    (define-key map [(control ?c) (control ?t)]
-      'muse-project-publish-this-file)
-    (define-key map [(control ?c) (control ?T)] 'muse-publish-this-file)
-    (define-key map [(control ?c) (meta control ?t)] 'muse-publish-this-file)
-    (define-key map [(control ?c) (control ?v)] 'muse-browse-result)
-
-    (define-key map [(control ?c) ?=]           'muse-what-changed)
-
-    (define-key map [tab] 'muse-next-reference)
-    (define-key map [(control ?i)] 'muse-next-reference)
-
-    (if (featurep 'xemacs)
-        (progn
-          (define-key map [(button2)] 'muse-follow-name-at-mouse)
-          (define-key map [(shift button2)]
-            'muse-follow-name-at-mouse-other-window))
-      (define-key map [(shift control ?m)]
-        'muse-follow-name-at-point-other-window)
-      (define-key map [mouse-2] 'muse-follow-name-at-mouse)
-      (define-key map [(shift mouse-2)]
-        'muse-follow-name-at-mouse-other-window))
-
-    (define-key map [(shift tab)] 'muse-previous-reference)
-    (unless (featurep 'xemacs)
-      (define-key map [(shift iso-lefttab)] 'muse-previous-reference)
-      (define-key map [(shift control ?i)] 'muse-previous-reference))
-
-    (define-key map [(control ?c) (control ?f)] 'muse-project-find-file)
-    (define-key map [(control ?c) (control ?p)] 'muse-project-publish)
-
-    (define-key map [(control ?c) (control ?i)] 'muse-insert-thing)
-    (define-key map [(control ?c) tab] 'muse-insert-thing)
-
-    ;; Searching functions
-    (define-key map [(control ?c) (control ?b)] 'muse-find-backlinks)
-    (define-key map [(control ?c) (control ?s)] 'muse-search)
-
-    ;; Enhanced list functions
-    (define-key map [(meta return)] 'muse-insert-list-item)
-    (define-key map [(control ?>)] 'muse-increase-list-item-indentation)
-    (define-key map [(control ?<)] 'muse-decrease-list-item-indentation)
-
-    (when (featurep 'pcomplete)
-      (define-key map [(meta tab)] 'pcomplete)
-      (define-key map [(meta control ?i)] 'pcomplete))
-
-    map)
-  "Keymap used by Emacs Muse mode.")
-
-;;;###autoload
-(define-derived-mode muse-mode text-mode "Muse"
-  "Muse is an Emacs mode for authoring and publishing documents.
-\\{muse-mode-map}"
-  ;; Since we're not inheriting from normal-mode, we need to
-  ;; explicitly run file variables.
-  (condition-case err
-      (hack-local-variables)
-    (error (message "File local-variables error: %s"
-                    (prin1-to-string err))))
-  ;; Avoid lock-up caused by use of the 'intangible' text property
-  ;; with flyspell.
-  (unless muse-mode-intangible-links
-    (set (make-local-variable 'inhibit-point-motion-hooks) t))
-  (setq muse-current-project (muse-project-of-file))
-  (muse-project-set-variables)
-  ;; Make fill not split up links
-  (when (boundp 'fill-nobreak-predicate)
-    (make-local-variable 'fill-nobreak-predicate)
-    ;; Work around annoying inconsistency in fill handling between
-    ;; Emacs 21 and 22.
-    (if (< emacs-major-version 22)
-        (setq fill-nobreak-predicate 'muse-mode-fill-nobreak-p)
-      (add-to-list 'fill-nobreak-predicate
-                   'muse-mode-fill-nobreak-p)))
-  ;; Make fill work nicely with item lists
-  (let ((regexp (concat "\\s-+\\(-\\|[0-9]+\\.\\)\\s-+"
-                        "\\|\\[[0-9]+\\]\\s-*"
-                        "\\|.*\\s-*::\\s-+"
-                        "\\|\\*+\\s-+")))
-    (set (make-local-variable 'adaptive-fill-regexp)
-         (concat regexp "\\|\\s-*"))
-    (set (make-local-variable 'paragraph-start)
-         (concat paragraph-start "\\|" regexp))
-    (set (make-local-variable 'paragraph-separate)
-         (concat paragraph-separate "\\|\\*+\\s-+")))
-  (set (make-local-variable 'fill-paragraph-function)
-       'muse-mode-fill-paragraph)
-
-  ;; Comment syntax is `; comment'
-  (set (make-local-variable 'comment-start)
-       "; ")
-  (set (make-local-variable 'comment-start-skip)
-       "^;\\s-+")
-  (set (make-local-variable 'indent-line-function)
-       #'ignore)
-  ;; If we're using Emacs21, this makes flyspell work like it should
-  (when (boundp 'flyspell-generic-check-word-p)
-    (set (make-local-variable 'flyspell-generic-check-word-p)
-         'muse-mode-flyspell-p))
-  ;; If pcomplete is available, set it up
-  (when (featurep 'pcomplete)
-    (set (make-local-variable 'pcomplete-default-completion-function)
-         'muse-mode-completions)
-    (set (make-local-variable 'pcomplete-command-completion-function)
-         'muse-mode-completions)
-    (set (make-local-variable 'pcomplete-parse-arguments-function)
-         'muse-mode-current-word))
-  ;; Initialize any auto-generated variables
-  (run-hooks 'muse-update-values-hook)
-  (when muse-mode-highlight-p
-    (muse-use-font-lock)))
-
-(put 'muse-mode
-     'flyspell-mode-predicate
-     'muse-mode-flyspell-p)
-
-(defun muse-mode-fill-nobreak-p ()
-  "Return nil if we should allow a fill to occur at point.
-Otherwise return non-nil.
-
-This is used to keep long explicit links from being mangled by
-fill mode."
-  (save-excursion
-    (save-match-data
-      (and (re-search-backward "\\[\\[\\|\\]\\]"
-                               (line-beginning-position) t)
-           (string= (or (match-string 0) "")
-                    "[[")))))
-
-(defun muse-mode-fill-paragraph (arg)
-  "If a definition list is at point, use special filling rules for it.
-Otherwise return nil to let the normal filling function take care
-of things.
-
-ARG is passed to `fill-paragraph'."
-  (let ((count 2))
-    (and (not (muse-mode-fill-nobreak-p))
-         (save-excursion
-           (beginning-of-line)
-           (and (looking-at muse-dl-term-regexp)
-                (prog1 t
-                  ;; Take initial whitespace into account
-                  (when (looking-at (concat "[" muse-regexp-blank "]+"))
-                    (setq count (+ count (length (match-string 0))))))))
-         (let ((fill-prefix (make-string count ?\ ))
-               (fill-paragraph-function nil))
-           (prog1 t
-             (fill-paragraph arg))))))
-
-(defun muse-mode-flyspell-p ()
-  "Return non-nil if we should allow spell-checking to occur at point.
-Otherwise return nil.
-
-This is used to keep links from being improperly colorized by flyspell."
-  (let ((pos (if (bobp) (point) (1- (point)))))
-    (and (not (get-text-property pos 'muse-no-flyspell))
-         (not (get-text-property pos 'muse-link))
-         (save-match-data
-           (null (muse-link-at-point))))))
-
-;;;###autoload
-(defun muse-mode-choose-mode ()
-  "Turn the proper Emacs Muse related mode on for this file."
-  (let ((project (muse-project-of-file)))
-    (funcall (or (and project (muse-get-keyword :major-mode (cadr project) t))
-                 'muse-mode))))
-
-(defun muse-mode-maybe ()
-  "Maybe turn Emacs Muse mode on for this file."
-  (let ((project (muse-project-of-file)))
-    (and project
-         (funcall (or (muse-get-keyword :major-mode (cadr project) t)
-                      'muse-mode)))))
-
-;;; Enhanced list editing
-
-(defun muse-on-blank-line ()
-  "See if point is on a blank line"
-  (save-excursion
-    (beginning-of-line)
-    (looking-at (concat "[" muse-regexp-blank "]*$"))))
-
-(defun muse-get-paragraph-start ()
-  "Return the start of the current paragraph. This function will
-return nil if there are no prior paragraphs and the beginning of
-the line if point is on a blank line."
-  (let ((para-start (concat "^[" muse-regexp-blank "]*$")))
-    ;; search back to start of paragraph
-    (save-excursion
-      (save-match-data
-        (if (not (muse-on-blank-line))
-            (re-search-backward para-start nil t)
-          (line-beginning-position))))))
-
-(defun muse-insert-thing ()
-  "Prompt for something to insert into the current buffer."
-  (interactive)
-  (message "Insert:\nl  link\nt  Muse tag\nu  URL")
-  (let (key cmd)
-    (let ((overriding-local-map muse-insert-map))
-      (setq key (read-key-sequence nil)))
-    (if (commandp (setq cmd (lookup-key muse-insert-map key)))
-        (progn (message "")
-               (call-interactively cmd))
-      (message "Not inserting anything"))))
-
-;;;###autoload
-(defun muse-insert-list-item ()
-  "Insert a list item at the current point, taking into account
-your current list type and indentation level."
-  (interactive)
-  (let ((newitem " - ")
-        (itemno nil)
-        (pstart (muse-get-paragraph-start))
-        (list-item (format muse-list-item-regexp
-                           (concat "[" muse-regexp-blank "]*"))))
-    ;; search backwards for start of current item
-    (save-excursion
-      (when (re-search-backward list-item pstart t)
-        ;; save the matching item
-        (setq newitem (match-string 0))
-        ;; see what type it is
-        (if (string-match "::" (match-string 0))
-            ;; is a definition, replace the term
-            (setq newitem (concat " "
-                                  (read-string "Term: ")
-                                  " :: "))
-          ;; see if it's a numbered list
-          (when (string-match "[0-9]+" newitem)
-            ;; is numbered, so increment
-            (setq itemno (1+
-                          (string-to-number
-                           (match-string 0 newitem))))
-            (setq newitem (replace-match
-                           (number-to-string itemno)
-                           nil nil newitem))))))
-    ;; insert the new item
-    (insert (concat "\n" newitem))))
-
-(defun muse-alter-list-item-indentation (operation)
-  "Alter the indentation of the current list item.
-Valid values of OPERATION are `increase' and `decrease'."
-  (let ((pstart (muse-get-paragraph-start))
-        (list-item (format muse-list-item-regexp
-                           (concat "[" muse-regexp-blank "]*")))
-        beg move-func indent)
-    ;; search backwards until start of paragraph to see if we are on a
-    ;; current item
-    (save-excursion
-      (if (or (progn (goto-char (muse-line-beginning-position))
-                     ;; we are on an item
-                     (looking-at list-item))
-              ;; not on item, so search backwards
-              (re-search-backward list-item pstart t))
-          (let ((beg (point)))
-            ;; we are on an item
-            (setq indent (buffer-substring (match-beginning 0)
-                                           (match-beginning 1)))
-            (muse-forward-list-item (muse-list-item-type (match-string 1))
-                                    (concat "[" muse-regexp-blank "]*")
-                                    t)
-            (save-restriction
-              (narrow-to-region beg (point))
-              (goto-char (point-min))
-              (let ((halt nil))
-                (while (< (point) (point-max))
-                  ;; increase or decrease the indentation
-                  (unless halt
-                    (cond ((eq operation 'increase)
-                           (insert "  "))
-                          ((eq operation 'decrease)
-                           (if (looking-at "  ")
-                               ;; we have enough space, so delete it
-                               (delete-region (match-beginning 0)
-                                              (match-end 0))
-                             (setq halt t)))))
-                  (forward-line 1)))))
-        ;; we are not on an item, so warn
-        (message "You are not on a list item.")))))
-
-;;;###autoload
-(defun muse-increase-list-item-indentation ()
-  "Increase the indentation of the current list item."
-  (interactive)
-  (muse-alter-list-item-indentation 'increase))
-
-;;;###autoload
-(defun muse-decrease-list-item-indentation ()
-  "Decrease the indentation of the current list item."
-  (interactive)
-  (muse-alter-list-item-indentation 'decrease))
-
-;;; Support page name completion using pcomplete
-
-(defun muse-mode-completions ()
-  "Return a list of possible completions names for this buffer."
-  (let ((project (muse-project-of-file)))
-    (if project
-        (while (pcomplete-here
-                (mapcar 'car (muse-project-file-alist project)))))))
-
-(defun muse-mode-current-word ()
-  (let ((end (point)))
-    (save-excursion
-      (save-restriction
-        (skip-chars-backward (concat "^\\[\n" muse-regexp-blank))
-        (narrow-to-region (point) end))
-      (pcomplete-parse-buffer-arguments))))
-
-;;; Navigate/visit links or URLs.  Use TAB, S-TAB and RET (or mouse-2).
-
-(defun muse-link-at-point (&optional pos)
-  "Return link text if a URL or link is at point."
-  (let ((case-fold-search nil)
-        (inhibit-point-motion-hooks t)
-        (here (or pos (point))))
-    ;; if we are using muse-colors, we can just use link properties to
-    ;; determine whether we are on a link
-    (if (featurep 'muse-colors)
-        (when (get-text-property here 'muse-link)
-          (save-excursion
-            (when (and (not (bobp))
-                       (get-text-property (1- here) 'muse-link))
-              (goto-char (or (previous-single-property-change here 'muse-link)
-                             (point-min))))
-            (if (looking-at muse-explicit-link-regexp)
-                (progn
-                  (goto-char (match-beginning 1))
-                  (muse-handle-explicit-link))
-              (muse-handle-implicit-link))))
-      ;; use fallback method to find a link
-      (when (or (null pos)
-                (and (char-after pos)
-                     (not (eq (char-syntax (char-after pos)) ?\ ))))
-        (save-excursion
-          (goto-char here)
-          ;; check for explicit link here or before point
-          (if (or (looking-at muse-explicit-link-regexp)
-                  (and
-                   (re-search-backward "\\[\\[\\|\\]\\]"
-                                       (muse-line-beginning-position)
-                                       t)
-                   (string= (or (match-string 0) "") "[[")
-                   (looking-at muse-explicit-link-regexp)))
-              (progn
-                (goto-char (match-beginning 1))
-                (muse-handle-explicit-link))
-            (goto-char here)
-            ;; check for bare URL or other link type
-            (skip-chars-backward (concat "^'\"<>{}(\n" muse-regexp-blank))
-            (and (looking-at muse-implicit-link-regexp)
-                 (muse-handle-implicit-link))))))))
-
-(defun muse-make-link (link &optional desc)
-  "Return a link to LINK with DESC as the description."
-  (when (string-match muse-explicit-link-regexp link)
-    (unless desc (setq desc (muse-get-link-desc link)))
-    (setq link (muse-get-link link)))
-  (if (and desc
-           link
-           (not (string= desc ""))
-           (not (string= link desc)))
-      (concat "[[" (muse-link-escape link) "][" (muse-link-escape desc) "]]")
-    (concat "[[" (or (muse-link-escape link) "") "]]")))
-
-;;;###autoload
-(defun muse-insert-relative-link-to-file ()
-  "Insert a relative link to a file, with optional description, at point."
-  ;; Perhaps the relative location should be configurable, so that the
-  ;; file search would start in the publishing directory and then
-  ;; insert the link relative to the publishing directory
-  (interactive)
-  (insert
-   (muse-make-link (file-relative-name (read-file-name "Link: "))
-                   (read-string "Text: "))))
-
-(defcustom muse-insert-url-initial-input "http://";
-  "The string to insert before reading a URL interactively.
-This is used by the `muse-insert-url' command."
-  :type 'string
-  :group 'muse-mode)
-
-(defun muse-insert-url ()
-  "Insert a URL, with optional description, at point."
-  (interactive)
-  (insert
-   (muse-make-link (read-string "URL: " muse-insert-url-initial-input)
-                   (read-string "Text: "))))
-
-;;;###autoload
-(defun muse-edit-link-at-point ()
-  "Edit the current link.
-Do not rename the page originally referred to."
-  (interactive)
-  (if (muse-link-at-point)
-      (let ((link (muse-link-unescape (muse-get-link)))
-            (desc (muse-link-unescape (muse-get-link-desc))))
-        (replace-match
-         (save-match-data
-           (muse-make-link
-            (read-string "Link: " link)
-            (read-string "Text: " desc)))
-         t t))
-    (error "There is no valid link at point")))
-
-(defun muse-visit-link-default (link &optional other-window)
-  "Visit the URL or link named by LINK.
-If ANCHOR is specified, search for it after opening LINK.
-
-This is the default function to call when visiting links; it is
-used by `muse-visit-link' if you have not specified :visit-link
-in `muse-project-alist'."
-  (if (string-match muse-url-regexp link)
-      (muse-browse-url link)
-    (let (anchor
-          base-buffer)
-      (when (string-match "#" link)
-        (setq anchor (substring link (match-beginning 0))
-              link (if (= (match-beginning 0) 0)
-                       ;; If there is an anchor but no link, default
-                       ;; to the current page.
-                       nil
-                     (substring link 0 (match-beginning 0)))))
-      (when link
-        (setq base-buffer (get-buffer link))
-        (if (and base-buffer (not (buffer-file-name base-buffer)))
-            ;; If file is temporary (no associated file), just switch to
-            ;; the buffer
-            (if other-window
-                (switch-to-buffer-other-window base-buffer)
-              (switch-to-buffer base-buffer))
-          (let ((project (muse-project-of-file)))
-            (if project
-                (muse-project-find-file link project
-                                        (and other-window
-                                             'find-file-other-window))
-              (if other-window
-                  (find-file-other-window link)
-                (find-file link))))))
-      (when anchor
-        (let ((pos (point))
-              (regexp (concat "^\\W*" (regexp-quote anchor) "\\b"))
-              last)
-          (goto-char (point-min))
-          (while (and (setq last (re-search-forward regexp nil t))
-                      (muse-link-at-point)))
-          (unless last
-            (goto-char pos)
-            (message "Could not find anchor `%s'" anchor)))))))
-
-(defun muse-visit-link (link &optional other-window)
-  "Visit the URL or link named by LINK."
-  (let ((visit-link-function
-         (muse-get-keyword :visit-link (cadr (muse-project-of-file)) t)))
-    (if visit-link-function
-        (funcall visit-link-function link other-window)
-      (muse-visit-link-default link other-window))))
-
-;;;###autoload
-(defun muse-browse-result (style &optional other-window)
-  "Visit the current page's published result."
-  (interactive
-   (list (muse-project-get-applicable-style buffer-file-name
-                                            (cddr muse-current-project))
-         current-prefix-arg))
-  (setq style (muse-style style))
-  (muse-project-publish-this-file nil style)
-  (let* ((output-dir (muse-style-element :path style))
-         (output-suffix (muse-style-element :osuffix style))
-         (output-path (muse-publish-output-file buffer-file-name output-dir
-                                                style))
-         (target (if output-suffix
-                     (concat (muse-path-sans-extension output-path)
-                             output-suffix)
-                   output-path))
-         (muse-current-output-style (list :base (car style)
-                                          :path output-dir)))
-    (if (not (file-readable-p target))
-        (error "Cannot open output file '%s'" target)
-      (if other-window
-          (find-file-other-window target)
-        (let ((func (muse-style-element :browser style t)))
-          (if func
-              (funcall func target)
-            (message "The %s publishing style does not support browsing."
-                     style)))))))
-
-;;;###autoload
-(defun muse-follow-name-at-point (&optional other-window)
-  "Visit the link at point."
-  (interactive "P")
-  (let ((link (muse-link-at-point)))
-    (if link
-        (muse-visit-link link other-window)
-      (error "There is no valid link at point"))))
-
-;;;###autoload
-(defun muse-follow-name-at-point-other-window ()
-  "Visit the link at point in other window."
-  (interactive)
-  (muse-follow-name-at-point t))
-
-(defun muse-follow-name-at-mouse (event &optional other-window)
-  "Visit the link at point, or yank text if none is found."
-  (interactive "eN")
-  (unless
-      (save-excursion
-        (cond ((fboundp 'event-window)      ; XEmacs
-               (set-buffer (window-buffer (event-window event)))
-               (and (funcall (symbol-function 'event-point) event)
-                    (goto-char (funcall (symbol-function 'event-point)
-                                        event))))
-              ((fboundp 'posn-window)       ; Emacs
-               (set-buffer (window-buffer (posn-window (event-start event))))
-               (goto-char (posn-point (event-start event)))))
-        (let ((link (muse-link-at-point)))
-          (when link
-            (muse-visit-link link other-window)
-            t)))
-    ;; Fall back to normal binding for this event
-    (call-interactively
-     (lookup-key (current-global-map) (this-command-keys)))))
-
-(defun muse-follow-name-at-mouse-other-window (event)
-  "Visit the link at point"
-  (interactive "e")
-  ;; throw away the old window position, since other-window will
-  ;; change it anyway
-  (select-window (car (cadr event)))
-  (muse-follow-name-at-mouse event t))
-
-;;;###autoload
-(defun muse-next-reference ()
-  "Move forward to next Muse link or URL, cycling if necessary."
-  (interactive)
-  (let ((pos))
-    (save-excursion
-      (when (get-text-property (point) 'muse-link)
-        (goto-char (or (next-single-property-change (point) 'muse-link)
-                       (point-max))))
-
-      (setq pos (next-single-property-change (point) 'muse-link))
-
-      (when (not pos)
-        (if (get-text-property (point-min) 'muse-link)
-            (setq pos (point-min))
-          (setq pos (next-single-property-change (point-min) 'muse-link)))))
-
-    (when pos
-      (goto-char pos))))
-
-;;;###autoload
-(defun muse-previous-reference ()
-  "Move backward to the next Muse link or URL, cycling if necessary.
-In case of Emacs x <= 21 and ignoring of intangible properties (see
-`muse-mode-intangible-links').
-
-This function is not entirely accurate, but it's close enough."
-  (interactive)
-  (let ((pos))
-    (save-excursion
-
-      ;; Hack: The user perceives the two cases of point ("|")
-      ;; position (1) "|[[" and (2) "[[|" or "][|" as "point is at
-      ;; start of link".  But in the sense of the function
-      ;; "previous-single-property-change" these two cases are
-      ;; different.  The following code aligns these two cases.  Emacs
-      ;; 21: If the intangible property is ignored case (2) is more
-      ;; complicate and this hack only solves the problem partially.
-      ;;
-      (when (and (get-text-property (point) 'muse-link)
-                 (muse-looking-back "\\[\\|\\]"))
-        (goto-char (or (previous-single-property-change (point) 'muse-link)
-                       (point-min))))
-
-      (when (eq (point) (point-min))
-        (goto-char (point-max)))
-
-      (setq pos (previous-single-property-change (point) 'muse-link))
-
-      (when (not pos)
-        (if (get-text-property (point-min) 'muse-link)
-            (setq pos (point-min))
-          (setq pos (previous-single-property-change (point-max)
-                                                     'muse-link)))))
-
-    (when pos
-      (if (get-text-property pos 'muse-link)
-          (goto-char pos)
-        (goto-char (or (previous-single-property-change pos 'muse-link)
-                       (point-min)))))))
-
-;;;###autoload
-(defun muse-what-changed ()
-  "Show the unsaved changes that have been made to the current file."
-  (interactive)
-  (diff-backup buffer-file-name))
-
-
-;;; Find text in project pages, or pages referring to the current page
-
-(defvar muse-search-history nil)
-
-(defun muse-grep (string &optional grep-command-no-shadow)
-  "Grep for STRING in the project directories.
-GREP-COMMAND if passed will supplant `muse-grep-command'."
-  ;; careful - grep-command leaks into compile, so we call it
-  ;; -no-shadow instead
-  (require 'compile)
-  (let* ((str (or grep-command-no-shadow muse-grep-command))
-         (muse-directories (mapcar
-                            (lambda (thing)
-                              (car (cadr thing)))
-                            muse-project-alist))
-         (dirs (mapconcat (lambda (dir)
-                            (shell-quote-argument
-                             (expand-file-name dir)))
-                          muse-directories " ")))
-    (if (string= dirs "")
-        (muse-display-warning
-         "No directories were found in the current project; aborting search")
-      (while (string-match "%W" str)
-        (setq str (replace-match string t t str)))
-      (while (string-match "%D" str)
-        (setq str (replace-match dirs t t str)))
-      (if (fboundp 'compilation-start)
-          (compilation-start str nil (lambda (&rest args) "*search*")
-                             grep-regexp-alist)
-        (and (fboundp 'compile-internal)
-             (compile-internal str "No more search hits" "search"
-                               nil grep-regexp-alist))))))
-
-;;;###autoload
-(defun muse-search-with-command (text)
-  "Search for the given TEXT string in the project directories
-using the specified command."
-  (interactive
-   (list (let ((str (concat muse-grep-command)) pos)
-           (when (string-match "%W" str)
-             (setq pos (match-beginning 0))
-             (unless (featurep 'xemacs)
-               (setq pos (1+ pos)))
-             (setq str (replace-match "" t t str)))
-           (read-from-minibuffer "Search command: "
-                                 (cons str pos) nil nil
-                                 'muse-search-history))))
-  (muse-grep nil text))
-
-;;;###autoload
-(defun muse-search ()
-  "Search for the given TEXT using the default grep command."
-  (interactive)
-  (muse-grep (read-string "Search: ")))
-
-;;;###autoload
-(defun muse-find-backlinks ()
-  "Grep for the current pagename in all the project directories."
-  (interactive)
-  (muse-grep (muse-page-name)))
-
-
-;;; Generate an index of all known Muse pages
-
-(defun muse-generate-index (&optional as-list exclude-private)
-  "Generate an index of all Muse pages."
-  (let ((index (muse-index-as-string as-list exclude-private)))
-    (with-current-buffer (get-buffer-create "*Muse Index*")
-      (erase-buffer)
-      (insert index)
-      (current-buffer))))
-
-;;;###autoload
-(defun muse-index ()
-  "Display an index of all known Muse pages."
-  (interactive)
-  (message "Generating Muse index...")
-  (let ((project (muse-project)))
-    (with-current-buffer (muse-generate-index)
-      (goto-char (point-min))
-      (muse-mode)
-      (setq muse-current-project project)
-      (pop-to-buffer (current-buffer))))
-  (message "Generating Muse index...done"))
-
-(defun muse-index-as-string (&optional as-list exclude-private exclude-current)
-  "Generate an index of all Muse pages.
-If AS-LIST is non-nil, insert a dash and spaces before each item.
-If EXCLUDE-PRIVATE is non-nil, exclude files that have private permissions.
-If EXCLUDE-CURRENT is non-nil, exclude the current file from the output."
-  (let ((files (sort (copy-alist (muse-project-file-alist))
-                     (function
-                      (lambda (l r)
-                        (string-lessp (car l) (car r)))))))
-    (when (and exclude-current (muse-page-name))
-      (setq files (delete (assoc (muse-page-name) files) files)))
-    (with-temp-buffer
-      (while files
-        (unless (and exclude-private
-                     (muse-project-private-p (cdar files)))
-          (insert (if as-list " - " "") "[[" (caar files) "]]\n"))
-        (setq files (cdr files)))
-      (buffer-string))))
-
-;;; Insert tags interactively on C-c TAB t
-
-(defvar muse-tag-history nil
-  "List of recently-entered tags; used by `muse-insert-tag'.
-If you want a tag to start as the default, you may manually set
-this variable to a list.")
-
-(defvar muse-custom-tags nil
-  "Keep track of any new tags entered in `muse-insert-tag'.
-If there are (X)HTML tags that you use frequently with that
-function, you might want to set this manually.")
-
-;;;###autoload
-(defun muse-insert-tag (tag)
-  "Insert a tag interactively with a blank line after it."
-  (interactive
-   (list
-    (funcall
-     muse-completing-read-function
-     (concat "Tag: "
-             (when muse-tag-history
-               (concat "(default: " (car muse-tag-history) ") ")))
-     (progn
-       (require 'muse-publish)
-       (mapcar 'list (nconc (mapcar 'car muse-publish-markup-tags)
-                            muse-custom-tags)))
-     nil nil nil 'muse-tag-history
-     (car muse-tag-history))))
-  (when (equal tag "")
-    (setq tag (car muse-tag-history)))
-  (require 'muse-publish)
-  (let ((tag-entry (assoc tag muse-publish-markup-tags))
-        (options ""))
-    ;; Add to custom list if no entry exists
-    (unless tag-entry
-      (add-to-list 'muse-custom-tags tag))
-    ;; Get option
-    (when (nth 2 tag-entry)
-      (setq options (read-string "Option: ")))
-    (unless (equal options "")
-      (setq options (concat " " options)))
-    ;; Insert the tag, closing if necessary
-    (when tag (insert (concat "<" tag options ">")))
-    (when (nth 1 tag-entry)
-      (insert (concat "\n\n</" tag ">\n"))
-      (forward-line -2))))
-
-;;; Muse list edit minor mode
-
-(defvar muse-list-edit-minor-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [(meta return)] 'muse-l-e-m-m-insert-list-item)
-    (define-key map [(control ?>)] 'muse-l-e-m-m-increase-list-item-indent)
-    (define-key map [(control ?<)] 'muse-l-e-m-m-decrease-list-item-indent)
-
-    map)
-  "Keymap used by Muse list edit minor mode.")
-
-(defvar muse-l-e-m-m-list-item-regexp
-  (concat "^%s\\(\\([^\n" muse-regexp-blank "].*?\\)?::"
-          "\\(?:[" muse-regexp-blank "]+\\|$\\)"
-          "\\|[" muse-regexp-blank "]?[-*+][" muse-regexp-blank "]*"
-          "\\|[" muse-regexp-blank "][0-9]+\\.[" muse-regexp-blank "]*\\)")
-  "Regexp used to match the beginning of a list item.
-This is used by `muse-list-edit-minor-mode'.
-The `%s' will be replaced with a whitespace regexp when publishing.")
-
-(defun muse-l-e-m-m-insert-list-item ()
-  "Insert a list item at the current point, taking into account
-your current list type and indentation level."
-  (interactive)
-  (let ((muse-list-item-regexp muse-l-e-m-m-list-item-regexp))
-    (call-interactively 'muse-insert-list-item)))
-
-(defun muse-l-e-m-m-increase-list-item-indent ()
-  "Increase the indentation of the current list item."
-  (interactive)
-  (let ((muse-list-item-regexp muse-l-e-m-m-list-item-regexp))
-    (call-interactively 'muse-increase-list-item-indentation)))
-
-(defun muse-l-e-m-m-decrease-list-item-indent ()
-  "Decrease the indentation of the current list item."
-  (interactive)
-  (let ((muse-list-item-regexp muse-l-e-m-m-list-item-regexp))
-    (call-interactively 'muse-decrease-list-item-indentation)))
-
-(defvar muse-l-e-m-m-data nil
-  "A list of data that was changed by Muse list edit minor mode.")
-(make-variable-buffer-local 'muse-l-e-m-m-data)
-
-;;;###autoload
-(define-minor-mode muse-list-edit-minor-mode
-  "This is a global minor mode for editing files with lists.
-It is meant to be used with other major modes, and not with Muse mode.
-
-Interactively, with no prefix argument, toggle the mode.
-With universal prefix ARG turn mode on.
-With zero or negative ARG turn mode off.
-
-This minor mode provides the Muse keybindings for editing lists,
-and support for filling lists properly.
-
-It recognizes not only Muse-style lists, which use the \"-\"
-character or numbers, but also lists that use asterisks or plus
-signs.  This should make the minor mode generally useful.
-
-Definition lists and footnotes are also recognized.
-
-Note that list items may omit leading spaces, for compatibility
-with modes that set `left-margin', such as
-`debian-changelog-mode'.
-
-\\{muse-list-edit-minor-mode-map}"
-  :init-value nil
-  :lighter ""
-  :keymap muse-list-edit-minor-mode-map
-  :global nil
-  :group 'muse-mode
-  (if (not muse-list-edit-minor-mode)
-      ;; deactivate
-      (when muse-l-e-m-m-data
-        (setq adaptive-fill-regexp (cdr (assoc "a-f-r" muse-l-e-m-m-data))
-              paragraph-start (cdr (assoc "p-s" muse-l-e-m-m-data))
-              fill-prefix (cdr (assoc "f-p" muse-l-e-m-m-data)))
-        (setq muse-l-e-m-m-data nil))
-    ;; activate
-    (unless muse-l-e-m-m-data
-      ;; save previous fill-related data so we can restore it later
-      (setq muse-l-e-m-m-data
-            (list (cons "a-f-r" adaptive-fill-regexp)
-                  (cons "p-s" paragraph-start)
-                  (cons "f-p" fill-prefix))))
-    ;; make fill work nicely with item lists
-    (let ((regexp (concat "\\s-*\\([-*+]\\|[0-9]+\\.\\)\\s-+"
-                          "\\|\\[[0-9]+\\]\\s-*"
-                          "\\|.*\\s-*::\\s-+")))
-      (set (make-local-variable 'adaptive-fill-regexp)
-           (concat regexp "\\|\\s-*"))
-      (set (make-local-variable 'paragraph-start)
-           (concat paragraph-start "\\|" regexp)))
-    ;; force fill-prefix to be nil, because if it is a string that has
-    ;; initial spaces, it messes up fill-paragraph's algorithm
-    (set (make-local-variable 'fill-prefix) nil)))
-
-(defun turn-on-muse-list-edit-minor-mode ()
-  "Unconditionally turn on Muse list edit minor mode."
-  (muse-list-edit-minor-mode 1))
-
-(defun turn-off-muse-list-edit-minor-mode ()
-  "Unconditionally turn off Muse list edit minor mode."
-  (muse-list-edit-minor-mode -1))
-
-;;; muse-mode.el ends here
diff --git a/packages/muse/muse-poem.el b/packages/muse/muse-poem.el
deleted file mode 100644
index bd08b7e..0000000
--- a/packages/muse/muse-poem.el
+++ /dev/null
@@ -1,263 +0,0 @@
-;;; muse-poem.el --- publish a poem to LaTex or PDF
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; This file specifies a form for recording poetry.  It is as follows.
-;;
-;;   Title
-;;
-;;
-;;   Body of poem
-;;
-;;
-;;   Annotations, history, notes, etc.
-;;
-;; The `muse-poem' module makes it easy to attractively publish and
-;; reference poems in this format, using the "memoir" module for LaTeX
-;; publishing.  It will also markup poems for every other output
-;; style, though none are nearly as pretty.
-;;
-;; Once a poem is written in this format, just publish it to PDF using
-;; the "poem-pdf" style.  To make an inlined reference to a poem that
-;; you've written -- for example, from a blog page -- there is a
-;; "poem" tag defined by this module:
-;;
-;;   <poem title="name.of.poem.page">
-;;
-;; Let's assume the template above was called "name.of.poem.page";
-;; then the above tag would result in this inclusion:
-;;
-;;   ** Title
-;;
-;;   > Body of poem
-;;
-;; I use this module for publishing all of the poems on my website,
-;; which are at: http://www.newartisans.com/johnw/poems.html.
-
-;;; Contributors:
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse Poem Publishing
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'muse-latex)
-(require 'muse-project)
-
-(defgroup muse-poem nil
-  "Rules for marking up a Muse file as a LaTeX article."
-  :group 'muse-latex)
-
-(defcustom muse-poem-latex-header
-  "\\documentclass[14pt,oneside]{memoir}
-
-\\usepackage[english]{babel}
-\\usepackage[latin1]{inputenc}
-\\usepackage[T1]{fontenc}
-
-\\setlength{\\beforepoemtitleskip}{-5.0ex}
-
-\\begin{document}
-
-\\pagestyle{empty}
-
-\\renewcommand{\\poemtoc}{section}
-\\settocdepth{section}
-
-\\mbox{}
-\\vfill
-
-\\poemtitle{<lisp>(muse-publishing-directive \"title\")</lisp>}
-
-\\settowidth{\\versewidth}{<lisp>muse-poem-longest-line</lisp>}\n\n"
-  "Header used for publishing LaTeX poems.  This may be text or a filename."
-  :type 'string
-  :group 'muse-poem)
-
-(defcustom muse-poem-latex-footer "\n\\vfill
-\\mbox{}
-
-\\end{document}"
-  "Footer used for publishing LaTeX files.  This may be text or a filename."
-  :type 'string
-  :group 'muse-poem)
-
-(defcustom muse-poem-markup-strings
-  '((begin-verse . "\\begin{verse}[\\versewidth]\n")
-    (verse-space . "\\vin "))
-  "Strings used for marking up poems.
-These cover the most basic kinds of markup, the handling of which
-differs little between the various styles."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-poem)
-
-(defcustom muse-chapbook-latex-header
-  "\\documentclass{book}
-
-\\usepackage[english]{babel}
-\\usepackage[latin1]{inputenc}
-\\usepackage[T1]{fontenc}
-
-\\setlength{\\beforepoemtitleskip}{-5.0ex}
-
-\\begin{document}
-
-\\title{<lisp>(muse-publishing-directive \"title\")</lisp>}
-\\author{<lisp>(muse-publishing-directive \"author\")</lisp>}
-\\date{<lisp>(muse-publishing-directive \"date\")</lisp>}
-
-\\maketitle
-
-\\tableofcontents
-
-\\renewcommand{\\poemtoc}{section}
-\\settocdepth{section}\n"
-  "Header used for publishing a book of poems in LaTeX form.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-poem)
-
-(defcustom muse-chapbook-latex-footer "\n\\end{document}"
-  "Footer used for publishing a book of poems in LaTeX form.
-This may be text or a filename."
-  :type 'string
-  :group 'muse-poem)
-
-(defvar muse-poem-longest-line "")
-
-(defcustom muse-poem-chapbook-strings
-  '((begin-verse . "\\newpage
-\\mbox{}
-\\vfill
-
-\\poemtitle{<lisp>(muse-publishing-directive \"title\")</lisp>}
-
-\\settowidth{\\versewidth}{<lisp>muse-poem-longest-line</lisp>}
-
-\\begin{verse}[\\versewidth]\n")
-    (end-verse   . "\n\\end{verse}\n\\vfill\n\\mbox{}")
-    (verse-space . "\\vin "))
-  "Strings used for marking up books of poems.
-These cover the most basic kinds of markup, the handling of which
-differs little between the various styles."
-  :type '(alist :key-type symbol :value-type string)
-  :group 'muse-poem)
-
-(defun muse-poem-prepare-buffer ()
-  (goto-char (point-min))
-  (insert "#title ")
-  (forward-line 1)
-  (delete-region (point) (1+ (muse-line-end-position)))
-  (insert "\n<verse>")
-  (let ((beg (point)) end line)
-    (if (search-forward "\n\n\n" nil t)
-        (progn
-          (setq end (copy-marker (match-beginning 0) t))
-          (replace-match "\n</verse>\n")
-          (delete-region (point) (point-max)))
-      (goto-char (point-max))
-      (setq end (point))
-      (insert "</verse>\n"))
-    (goto-char (1+ beg))
-    (set (make-local-variable 'muse-poem-longest-line) "")
-    (while (< (point) end)
-      (setq line (buffer-substring-no-properties (point)
-                                                 (muse-line-end-position)))
-      (if (> (length line) (length muse-poem-longest-line))
-          (setq muse-poem-longest-line line))
-      (forward-line 1))
-    nil))
-
-(defvar muse-poem-tag '("poem" nil t nil muse-poem-markup-tag))
-
-(defun muse-poem-markup-tag (beg end attrs)
-  "This markup tag allows a poem to be included from another project page.
-The form of usage is:
-  <poem title=\"page.name\">"
-  (let ((page (cdr (assoc (cdr (assoc "title" attrs))
-                          (muse-project-file-alist))))
-        beg end)
-    (if (null page)
-        (insert "  *Reference to\n  unknown poem \""
-                (cdr (assoc "title" attrs)) "\".*\n")
-      (setq beg (point))
-      (insert
-       (muse-with-temp-buffer
-         (muse-insert-file-contents page)
-         (goto-char (point-min))
-         (if (assoc "nohead" attrs)
-             (progn
-               (forward-line 3)
-               (delete-region (point-min) (point)))
-           (insert "** ")
-           (search-forward "\n\n\n")
-           (replace-match "\n\n"))
-         (if (search-forward "\n\n\n" nil t)
-             (setq end (match-beginning 0))
-           (setq end (point-max)))
-         (buffer-substring-no-properties (point-min) end)))
-      (setq end (point-marker))
-      (goto-char beg)
-      (unless (assoc "nohead" attrs)
-        (forward-line 2))
-      (while (< (point) end)
-        (insert "> ")
-        (forward-line 1))
-      (set-marker end nil))))
-
-(put 'muse-poem-markup-tag 'muse-dangerous-tag t)
-
-(add-to-list 'muse-publish-markup-tags muse-poem-tag)
-
-;;; Register the Muse POEM Publishers
-
-(muse-derive-style "poem-latex" "latex"
-                   :before  'muse-poem-prepare-buffer
-                   :strings 'muse-poem-markup-strings
-                   :header  'muse-poem-latex-header
-                   :footer  'muse-poem-latex-footer)
-
-(muse-derive-style "poem-pdf" "pdf"
-                   :before  'muse-poem-prepare-buffer
-                   :strings 'muse-poem-markup-strings
-                   :header  'muse-poem-latex-header
-                   :footer  'muse-poem-latex-footer)
-
-(muse-derive-style "chapbook-latex" "latex"
-                   :before  'muse-poem-prepare-buffer
-                   :strings 'muse-poem-chapbook-strings
-                   :header  'muse-chapbook-latex-header
-                   :footer  'muse-chapbook-latex-footer)
-
-(muse-derive-style "chapbook-pdf" "pdf"
-                   :before  'muse-poem-prepare-buffer
-                   :strings 'muse-poem-chapbook-strings
-                   :header  'muse-chapbook-latex-header
-                   :footer  'muse-chapbook-latex-footer)
-
-(provide 'muse-poem)
-
-;;; muse-poem.el ends here
diff --git a/packages/muse/muse-project.el b/packages/muse/muse-project.el
deleted file mode 100644
index 57b0f32..0000000
--- a/packages/muse/muse-project.el
+++ /dev/null
@@ -1,979 +0,0 @@
-;;; muse-project.el --- handle Muse projects
-
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2014
-;;   Free Software Foundation, Inc.
-
-;; This file is part of Emacs Muse.  It is not part of GNU Emacs.
-
-;; Emacs Muse 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 3, or (at your
-;; option) any later version.
-
-;; Emacs Muse 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 Emacs Muse; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Contributors:
-
-;;; Code:
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; Muse Project Maintainance
-;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(provide 'muse-project)
-
-(require 'muse)
-(require 'muse-publish)
-(require 'cus-edit)
-
-(defgroup muse-project nil
-  "Options controlling the behavior of Muse project handling."
-  :group 'muse)
-
-(defcustom muse-before-project-publish-hook nil
-  "A hook run before a project is published.
-Each function is passed the project object, a cons with the format
-  (PROJNAME . SETTINGS)"
-  :type 'hook
-  :group 'muse-project)
-
-(defcustom muse-after-project-publish-hook nil
-  "A hook run after a project is published.
-Each function is passed the project object, a cons with the format
-  (PROJNAME . SETTINGS)"
-  :type 'hook
-  :group 'muse-project)
-
-(defvar muse-project-alist-using-customize nil
-  "Used internally by Muse to indicate whether `muse-project-alist'
-has been modified via the customize interface.")
-(make-variable-buffer-local 'muse-project-alist-using-customize)
-
-(defmacro with-muse-project (project &rest body)
-  `(progn
-     (unless (muse-project ,project)
-       (error "Can't find project %s" ,project))
-     (with-temp-buffer
-       (muse-mode)
-       (setq muse-current-project (muse-project ,project))
-       (muse-project-set-variables)
-       ,@body)))
-
-(put 'with-muse-project 'lisp-indent-function 0)
-(put 'with-muse-project 'edebug-form-spec '(sexp body))
-
-(defun muse-project-alist-get (sym)
-  "Turn `muse-project-alist' into something we can customize easily."
-  (when (boundp sym)
-    (setq muse-project-alist-using-customize t)
-    (let* ((val (copy-alist (symbol-value sym)))
-           (head val))
-      (while val
-        (let ((head (car (cdar val)))
-              res)
-          ;; Turn settings of first part into cons cells, symbol->string
-          (while head
-            (cond ((stringp (car head))
-                   (unless (member (car head) res)
-                     (setq res (append res (list (car head)))))
-                   (setq head (cdr head)))
-                  ((symbolp (car head))
-                   (let ((x (list (symbol-name (car head)) (cadr head))))
-                     (unless (member x res)
-                       (setq res (append res (list x)))))
-                   (setq head (cddr head)))
-                  (t
-                   (setq head (cdr head)))))
-          (setcdr (car val) (cons res (cdr (cdar val)))))
-        (let ((styles (cdar val)))
-          ;; Symbol->string in every style
-          (while (cdr styles)
-            (let ((head (cadr styles))
-                  res)
-              (while (consp head)
-                (setq res (plist-put res (symbol-name (car head))
-                                     (cadr head)))
-                (setq head (cddr head)))
-              (setcdr styles (cons res (cddr styles))))
-            (setq styles (cdr styles))))
-        (setq val (cdr val)))
-      head)))
-
-(defun muse-project-alist-set (sym val)
-  "Turn customized version of `muse-project-alist' into something
-Muse can make use of."
-  (set sym val)
-  (when muse-project-alist-using-customize
-    ;; Make sure the unescaped version is written to .emacs
-    (put sym 'saved-value (list (custom-quote val)))
-    ;; Perform unescaping
-    (while val
-      (let ((head (car (cdar val)))
-            res)
-        ;; Turn cons cells into flat list, string->symbol
-        (while head
-          (cond ((stringp (car head))
-                 (unless (member (car head) res)
-                   (setq res (append res (list (car head))))))
-                ((consp (car head))
-                 (let ((x (intern (caar head)))
-                       (y (car (cdar head))))
-                   (unless (member x res) (setq res (append res (list x))))
-                   (unless (member y res) (setq res (append res (list y)))))))
-          (setq head (cdr head)))
-        (setcdr (car val) (cons res (cdr (cdar val)))))
-      (let ((styles (cdar val)))
-        ;; String->symbol in every style
-        (while (cdr styles)
-          (let ((head (cadr styles))
-                res)
-            (while (consp head)
-              (setq res (plist-put res (intern (car head))
-                                   (cadr head)))
-              (setq head (cddr head)))
-            (setcdr styles (cons res (cddr styles))))
-          (setq styles (cdr styles))))
-      (setq val (cdr val)))))
-
-(define-widget 'muse-project 'default
-  "A widget that defines a Muse project."
-  :format "\n%v"
-  :value-create 'muse-widget-type-value-create
-  :value-get 'muse-widget-child-value-get
-  :value-delete 'ignore
-  :match 'muse-widget-type-match
-  :type '(cons :format "    %v"
-               (repeat :tag "Settings" :format "%{%t%}:\n%v%i\n\n"
-                       (choice
-                        (string :tag "Directory")
-                        (list :tag "Book function"
-                              (const :tag ":book-funcall" ":book-funcall")
-                              (choice (function)
-                                      (sexp :tag "Unknown")))
-                        (list :tag "Book part"
-                              (const :tag ":book-part" ":book-part")
-                              (string :tag "Name"))
-                        (list :tag "Book style"
-                              (const :tag ":book-style" ":book-style")
-                              (string :tag "Style"))
-                        (list :tag "Default file"
-                              (const :tag ":default" ":default")
-                              (string :tag "File"))
-                        (list :tag "End of book"
-                              (const :tag ":book-end" ":book-end")
-                              (const t))
-                        (list :tag "Force publishing"
-                              (const :tag ":force-publish" ":force-publish")
-                              (repeat (string :tag "File")))
-                        (list :tag "Major mode"
-                              (const :tag ":major-mode" ":major-mode")
-                              (choice (function :tag "Mode")
-                                      (sexp :tag "Unknown")))
-                        (list :tag "New chapter"
-                              (const :tag ":book-chapter" ":book-chapter")
-                              (string :tag "Name"))
-                        (list :tag "No chapters"
-                              (const :tag ":nochapters" ":nochapters")
-                              (const t))
-                        (list :tag "Project-level publishing function"
-                              (const :tag ":publish-project"
-                                     ":publish-project")
-                              (choice (function :tag "Function")
-                                      (sexp :tag "Unknown")))
-                        (list :tag "Set variables"
-                              (const :tag ":set" ":set")
-                              (repeat (list :inline t
-                                            (symbol :tag "Variable")
-                                            (sexp :tag "Setting"))))
-                        (list :tag "Visit links using"
-                              (const :tag ":visit-link" ":visit-link")
-                              (choice (function)
-                                      (sexp :tag "Unknown")))))
-               (repeat :tag "Output styles" :format "%{%t%}:\n%v%i\n\n"
-                       (set :tag "Style"
-                            (list :inline t
-                                  :tag "Publishing style"
-                                  (const :tag ":base" ":base")
-                                  (string :tag "Style"))
-                            (list :inline t
-                                  :tag "Base URL"
-                                  (const :tag ":base-url" ":base-url")
-                                  (string :tag "URL"))
-                            (list :inline t
-                                  :tag "Exclude matching"
-                                  (const :tag ":exclude" ":exclude")
-                                  (regexp))
-                            (list :inline t
-                                  :tag "Include matching"
-                                  (const :tag ":include" ":include")
-                                  (regexp))
-                            (list :inline t
-                                  :tag "Timestamps file"
-                                  (const :tag ":timestamps" ":timestamps")
-                                  (file))
-                            (list :inline t
-                                  :tag "Path"
-                                  (const :tag ":path" ":path")
-                                  (string :tag "Path"))))))
-
-(defcustom muse-project-alist nil
-  "An alist of Muse projects.
-A project defines a fileset, and a list of custom attributes for use
-when publishing files in that project."
-  :type '(choice (const :tag "No projects defined." nil)
-                 (repeat (cons :format "%{%t%}:\n\n%v"
-                               :tag "Project" :indent 4
-                               (string :tag "Project name")
-                               muse-project))
-                 (sexp :tag "Cannot parse expression"))
-  :get 'muse-project-alist-get
-  :set 'muse-project-alist-set
-  :group 'muse-project)
-
-;; Make it easier to specify a muse-project-alist entry
-
-(defcustom muse-project-ignore-regexp
-  (concat "\\`\\(#.*#\\|.*,v\\|.*~\\|\\.\\.?\\|\\.#.*\\|,.*\\)\\'\\|"
-          "/\\(CVS\\|RCS\\|\\.arch-ids\\|{arch}\\|,.*\\|\\.svn\\|"
-          "\\.hg\\|\\.git\\|\\.bzr\\|_darcs\\)\\(/\\|\\'\\)")
-  "A regexp matching files to be ignored in Muse directories.
-
-You should set `case-fold-search' to nil before using this regexp
-in code."
-  :type 'regexp
-  :group 'muse-regexp)
-
-(defcustom muse-project-publish-private-files t
-  "If this is non-nil, files will be published even if their permissions
-are set so that no one else on the filesystem can read them.
-
-Set this to nil if you would like to indicate that some files
-should not be published by manually doing \"chmod o-rwx\" on
-them.
-
-This setting has no effect under Windows (that is, all files are
-published regardless of permissions) because Windows lacks the
-needed filesystem attributes."
-  :type 'boolean
-  :group 'muse-project)
-
-(defun muse-project-recurse-directory (base)
-  "Recusively retrieve all of the directories underneath BASE.
-A list of these directories is returned.
-
-Directories starting with \".\" will be ignored, as well as those
-which match `muse-project-ignore-regexp'."
-  (let ((case-fold-search nil)
-        list dir)
-    (when (and (file-directory-p base)
-               (not (string-match muse-project-ignore-regexp base)))
-      (dolist (file (directory-files base t "^[^.]"))
-        (when (and (file-directory-p file)
-                   (not (string-match muse-project-ignore-regexp file)))
-          (setq dir (file-name-nondirectory file))
-          (push dir list)
-          (nconc list (mapcar #'(lambda (item)
-                                  (concat dir "/" item))
-                              (muse-project-recurse-directory file)))))
-      list)))
-
-(defun muse-project-alist-styles (entry-dir output-dir style &rest other)
-  "Return a list of styles to use in a `muse-project-alist' entry.
-ENTRY-DIR is the top-level directory of the project.
-OUTPUT-DIR is where Muse files are published, keeping directory structure.
-STYLE is the publishing style to use.
-
-OTHER contains other definitions to add to each style.  It is optional.
-
-For an example of the use of this function, see
-`examples/mwolson/muse-init.el' from the Muse distribution."
-  (let ((fnd (file-name-nondirectory entry-dir)))
-    (when (string= fnd "")
-      ;; deal with cases like "foo/" that have a trailing slash
-      (setq fnd (file-name-nondirectory (substring entry-dir 0 -1))))
-    (cons `(:base ,style :path ,(if (muse-file-remote-p output-dir)
-                                    output-dir
-                                  (expand-file-name output-dir))
-                  :include ,(concat "/" fnd "/[^/]+$")
-                  ,@other)
-          (mapcar (lambda (dir)
-                    `(:base ,style
-                            :path ,(expand-file-name dir output-dir)
-                            :include ,(concat "/" dir "/[^/]+$")
-                            ,@other))
-                  (muse-project-recurse-directory entry-dir)))))
-
-(defun muse-project-alist-dirs (entry-dir)
-  "Return a list of directories to use in a `muse-project-alist' entry.
-ENTRY-DIR is the top-level directory of the project.
-
-For an example of the use of this function, see
-`examples/mwolson/muse-init.el' from the Muse distribution."
-  (cons (expand-file-name entry-dir)
-        (mapcar (lambda (dir) (expand-file-name dir entry-dir))
-                (muse-project-recurse-directory entry-dir))))
-
-;; Constructing the file-alist
-
-(defvar muse-project-file-alist nil
-  "This variable is automagically constructed as needed.")
-
-(defvar muse-project-file-alist-hook nil
-  "Functions that are to be exectuted immediately after updating
-`muse-project-file-alist'.")
-
-(defvar muse-current-project nil
-  "Project we are currently visiting.")
-(make-variable-buffer-local 'muse-current-project)
-(defvar muse-current-project-global nil
-  "Project we are currently visiting.  This is used to propagate the value
-of `muse-current-project' into a new buffer during publishing.")
-
-(defvar muse-current-output-style nil
-  "The output style that we are currently using for publishing files.")
-
-(defsubst muse-project (&optional project)
-  "Resolve the given PROJECT into a full Muse project, if it is a string."
-  (if (null project)
-      (or muse-current-project
-          (muse-project-of-file))
-    (if (stringp project)
-        (assoc project muse-project-alist)
-      (muse-assert (consp project))
-      project)))
-
-(defun muse-project-page-file (page project &optional no-check-p)
-  "Return a filename if PAGE exists within the given Muse PROJECT."
-  (setq project (muse-project project))
-  (if (null page)
-      ;; if no