Move to more guix centric package management (e.g. not elpa)
authorJames Richardson <james@jamestechnotes.com>
Tue, 4 Apr 2017 10:44:53 +0000 (06:44 -0400)
committerJames Richardson <james@jamestechnotes.com>
Tue, 4 Apr 2017 10:44:53 +0000 (06:44 -0400)
Tweek mu4e

.emacs.d/config/lisp.el
.emacs.d/config/load-paths.el
.emacs.d/config/main.el
.emacs.d/config/mu4e.el
.emacs.d/config/org.el
.emacs.d/init.el
.emacs.d/site-lisp/ikiwiki-org-plugin.el [deleted file]
.emacs.d/site-lisp/mediawiki.el [deleted file]

index d2e5533e08c643222baf9bdd4057297910e46c50..4af79f89a8477b149fa47d0b3d1cc36e435a61fd 100644 (file)
@@ -3,11 +3,11 @@
 ;;; let's configure slime
 
 ;; really need to refactor this.
-(mapc
- (lambda (package)
-   (or (package-installed-p package)
-       (package-install package)))
- '(slime slime-company geiser))
+;; (mapc
+;;  (lambda (package)
+;;    (or (package-installed-p package)
+;;        (package-install package)))
+;;  '(slime slime-company geiser))
 
 (require 'slime-autoloads)
 (slime-setup '(slime-fancy))
index 1a312a7a2576a8e5ab3f50f9e4ddd6c87798a7cf..a15d7c4928cbcf6a75336e84e2122fc13ed88371 100644 (file)
@@ -53,3 +53,7 @@
 ;;; org-weather
 (when (file-directory-p "~/src/org-weather")
   (add-to-list 'load-path (file-truename "~/src/org-weather")))
+
+;;; org-jira
+(when (file-directory-p "~/src/org-jira")
+  (add-to-list 'load-path (file-truename "~/src/org-jira")))
index 64bc477e579621c77a4ff6579ae083a47d0c9fdf..033feee290d412c5e4accd4b138a9c0d71b4b4a3 100644 (file)
@@ -1,31 +1,32 @@
 ;;; main config
-;;; packages
-(require 'package)
-(add-to-list 'package-archives
-            '("melpa" . "https://melpa.org/packages/"))
-(add-to-list 'package-archives
-            '("org" . "http://orgmode.org/elpa/"))
-(when (< emacs-major-version 24)
-  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
-
-(package-initialize)
-
-(unless (file-exists-p "~/.emacs.d/elpa")
-  (package-refresh-contents))
+;;; Handle packages via guix or git checkout.
+;; ;;; packages
+;; (require 'package)
+;; (add-to-list 'package-archives
+;;          '("melpa" . "https://melpa.org/packages/"))
+;; (add-to-list 'package-archives
+;;          '("org" . "http://orgmode.org/elpa/"))
+;; (when (< emacs-major-version 24)
+;;   (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
+
+;; (package-initialize)
+
+;; (unless (file-exists-p "~/.emacs.d/elpa")
+;;   (package-refresh-contents))
+
+;; ;; (mapc
+;; ;;  (lambda (package)
+;; ;;    (or (package-installed-p package)
+;; ;;        (package-install package)))
+;; ;;  '(cider clojure-mode epl markdown-mode org org-plus-contrib
+;; ;;          paredit restclient slime edit-server
+;; ;;   edit-server-htmlize company lacarte icicles magit magit-annex magit-popup))
 
 ;; (mapc
 ;;  (lambda (package)
 ;;    (or (package-installed-p package)
 ;;        (package-install package)))
-;;  '(cider clojure-mode epl markdown-mode org org-plus-contrib
-;;          paredit restclient slime edit-server
-;;      edit-server-htmlize company lacarte icicles magit magit-annex magit-popup))
-
-(mapc
- (lambda (package)
-   (or (package-installed-p package)
-       (package-install package)))
- '(icicles org-plus-contrib))
+;;  '(icicles org-plus-contrib))
  
 (transient-mark-mode t)
 (global-set-key [remap kill-ring-save]
 ;; ;; ido ends here
 ;; [[file:~/.emacs.d/emacs-init.org::*Minibuffer][mini-buffer]]
 ;; Icicles
-(require 'icicles)
-(icy-mode 1)
-(setq icicle-show-Completions-initially-flag nil
-      icicle-incremental-completion 1
-      icicle-top-level-when-sole-completion-flag t
-      icicle-default-value t)
+;; (require 'icicles)
+;; (icy-mode 1)
+;; (setq icicle-show-Completions-initially-flag nil
+;;       icicle-incremental-completion 1
+;;       icicle-top-level-when-sole-completion-flag t
+;;       icicle-default-value t)
 
 
 (setq enable-recursive-minibuffers nil
 ;; in the event chrome is installed, etc.
 ;; i guess I could call sensible-browser here, but I am not always on debian.
 ;; let's browse with chrome.
-(setq browse-url-browser-function 'browse-url-generic
-      browse-url-generic-program "google-chrome")
+;; (setq browse-url-browser-function 'browse-url-generic
+;;       browse-url-generic-program "google-chrome")
   
 ;; modes
 (add-hook 'text-mode-hook 'turn-on-flyspell 'append)
 (autoload 'edit-server-maybe-htmlize-buffer "edit-server-htmlize" "edit-server-htmlize" t)
 (add-hook 'edit-server-start-hook 'edit-server-maybe-dehtmlize-buffer)
 (add-hook 'edit-server-done-hook 'edit-server-maybe-htmlize-buffer)
+
+;; mode line
+(setq display-time-24hr-format t
+      display-time-mail-file t)
+(display-time-mode t)
+(display-battery-mode t)
index 4e10f1ebd3b76e69b810784dae465db11d0459b1..e7662ea922be467d6db403703c190eea3cefdc8c 100644 (file)
 
 ;; set bookmarks
 (add-to-list 'mu4e-bookmarks
-            '("m:/acct-8/INBOX" "Work" ?w))
+            '("m:/acct-8/INBOX" "Work" ?W))
 (add-to-list 'mu4e-bookmarks
             '("flag:unread and not flag:trashed and not flag:list" "New (no lists)" ?n))
 (add-to-list 'mu4e-bookmarks
 ;;          '("m:/ or m:/acct-1/INBOX or m:/acct-2/INBOX or m:/acct-2/acct-3.INBOX or m:/acct-2/acct-3.[Gmail].Important or m:/acct-2/acct-4/INBOX.james or m:/acct-2/acct-4.INBOX.Archive or m:/acct-3/INBOX or m:/acct-3/[Gmail].Important or m:/acct-4/INBOX.james or m:/acct-4/INBOX.Archive"  "Inbox (All)" ?I))
 ;; (add-to-list 'mu4e-bookmarks
 ;;          '("m:/ or m:/acct-1/INBOX" "Inbox" ?i))
+
+;; set unread mail in mode line
+(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display)
+
+;; update mail 300 seconds
+(setq mu4e-update-interval 300)
+
+
+;; start mu4e
+(mu4e t)
index 1f32763a21d48e6e0382dc3601c9cf69045d9778..fd1ca5371f3d11795fb202bea13e8bfa2664819e 100644 (file)
 ;;       (setq org-mobile-directory "~/tmp")
 ;;       (setq org-mobile-inbox-for-pull "~/tmp/MobileInbox.org")))
 
-(setq org-file-apps org-file-apps-defaults-gnu)
-(delete '("\\.pdf\\'" . default) org-file-apps)
-(add-to-list 'org-file-apps '(("\\.pdf\\'" . "evince \"%s\"")))
+;;(setq org-file-apps org-file-apps-defaults-gnu)
+;;(delete '("\\.pdf\\'" . default) org-file-apps)
+;;(add-to-list 'org-file-apps '(("\\.pdf\\'" . "evince \"%s\"")))
 
 ;; setup todo things.
 (setq org-todo-keywords
       '((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!/!)")
+       (sequence "NEW" "IN-PROGRESS" "|" "DONE") ;; jira
         (sequence "WAITING(w@/!)" "HOLD(h@/!)" "|" "CANCELLED(c@/!)" "PHONE")))
 
 (setq org-use-fast-todo-selection t)
 (add-hook 'org-after-todo-state-change-hook 'bh/mark-next-parent-tasks-todo 'append)
 (add-hook 'org-clock-in-hook 'bh/mark-next-parent-tasks-todo 'append)
 (run-at-time "00:59" 3600 'org-save-all-org-buffers)
-(display-time-mode 1)
 
 (defun bh/find-project-task ()
   "Move point to the parent (project) task if any"
@@ -1127,3 +1127,13 @@ Late deadlines first, then scheduled, then non-late deadlines"
 ; global STYLE property values for completion
 (setq org-global-properties (quote (("Effort_ALL" . "0:15 0:30 0:45 1:00 2:00 3:00 4:00 5:00 6:00 8:00")
                                     ("STYLE_ALL" . "habit"))))
+
+
+;; org-jira
+;; set defcustom before loading
+(setq jiralib-url "https://tools.lowes.com/jira"
+      jiralib-wsdl-descriptor-url "https://tools.lowes.com/jira/rpc/soap/jirasoapservice-v2?wsdl"
+      org-jira-working-dir "~/doc/org/lowes"
+      org-jira-use-status-as-todo t)
+(require 'org-jira nil 'noerror)
+
index 14f5aa846cbb5ee179304afbb509423567c2f2c8..d0732ded0e37cec888434062e1e5b35106367c5f 100644 (file)
@@ -7,7 +7,7 @@
 ;; installed packages.  Don't delete this line.  If you don't want it,
 ;; just comment it out by adding a semicolon to the start of the line.
 ;; You may delete these explanatory comments.
-(package-initialize)
+;; (package-initialize)
 
 (setq org-agenda-include-diary t)
 ;; load paths
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(icicle-command-abbrev-alist (quote ((cider-restart ## 1))))
- '(package-selected-packages (quote (geiser slime-company slime icicles)))
+ '(org-file-apps
+   (quote
+    ((auto-mode . emacs)
+     ("\\.mm\\'" . default)
+     ("\\.x?html?\\'" . default)
+     ("\\.pdf\\'" . "evince %s"))))
+ '(package-selected-packages
+   (quote
+    (xml-rpc restclient geiser slime-company slime icicles)))
+ '(safe-local-variable-values
+   (quote
+    ((eval modify-syntax-entry 43 "'")
+     (eval modify-syntax-entry 36 "'")
+     (eval modify-syntax-entry 126 "'")
+     (bug-reference-bug-regexp . "<https?://\\(debbugs\\|bugs\\)\\.gnu\\.org/\\([0-9]+\\)>"))))
  '(smtpmail-smtp-server "localhost")
  '(smtpmail-smtp-service 25))
 (custom-set-faces
diff --git a/.emacs.d/site-lisp/ikiwiki-org-plugin.el b/.emacs.d/site-lisp/ikiwiki-org-plugin.el
deleted file mode 100644 (file)
index 72fefa4..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-
-;;(require 'org-exp)
-(add-to-list 'load-path "/home/james/src/org-mode/contrib/lisp")
-(add-to-list 'load-path "/home/james/src/org-mode/lisp")
-
-(require 'org)
-
-(defun ikiwiki-org-correct-link (best-link destpage)
-  ;; best-link is always the same -- something like "posts/processing"
-  ;; destpage can change depending on whether the page is being
-  ;; inlined.  It might be something like "index" or "posts/test".  If
-  ;; it's the former, then we need to keep "posts/processing", but if
-  ;; it's the latter, then it needs to be "../processing".  So the
-  ;; strategy is to find the directories in destpage that are prefixes
-  ;; of best-link.  These can be removed from both
-  ;; (non-destructively).  The path that is returned is a number of
-  ;; ".."s that is the number of directories that is different between
-  ;; the new destpage and best-link followed by the new best-link.  So
-  ;; if we had best-link = "foo/bar/baz" and destpage =
-  ;; "foo/bar/quux/test" then we would reset best-link to "baz" and
-  ;; destpage to "quux/test".  We would return "../../baz".
-  (if (string= destpage "index")
-      best-link
-   (let* ((subdirs-match-index 0)
-         (best-link (concat "/" (replace-regexp-in-string "//" "/" best-link)))
-         (destpage (concat "/"  (replace-regexp-in-string "//" "/" destpage)))
-         (best-link-len (length best-link))
-         (destpage-len (length destpage))
-         (matching-subdirs-index 0)
-         (matching-subdirs-index
-          (progn
-            (while (and subdirs-match-index (< subdirs-match-index best-link-len) (< subdirs-match-index destpage-len)
-                        (string= (substring best-link 0 subdirs-match-index) (substring destpage 0 subdirs-match-index)))
-              (setq matching-subdirs-index subdirs-match-index)
-              (setq subdirs-match-index (string-match "/" destpage (1+ subdirs-match-index))))
-            matching-subdirs-index))
-         (link-prefix "")
-         (subdirs-match-index matching-subdirs-index)
-         (link-prefix
-          (progn
-            (while (and subdirs-match-index (< subdirs-match-index destpage-len))
-              (setq subdirs-match-index (string-match "/" destpage (1+ subdirs-match-index)))
-              (setq link-prefix (concat "../" link-prefix)))
-            link-prefix)))
-     (concat link-prefix (substring best-link (1+ matching-subdirs-index))))))
-
-(defun ikiwiki-org-remove-link-prefix (url-part)
-  "Removes `file:' or `./' prefixes from Org links."
-  (save-match-data
-    (cond ((string-match "\\(^file:\\|\\./\\)" url-part) (replace-match "" nil nil url-part))
-         (url-part))))
-
-
-(defun ikiwiki-org-linkify (infile outfile destpage link-hash)
-  (with-temp-buffer
-    (insert-file-contents infile)
-    (goto-char (point-min))
-    (while (re-search-forward org-bracket-link-regexp (point-max) t)
-      (let* ((url-part (ikiwiki-org-remove-link-prefix (match-string-no-properties 1)))
-            (text-part (match-string-no-properties 3))
-            (best-link (gethash url-part link-hash))
-            (image? (save-match-data (string-match (org-image-file-name-regexp) url-part))))
-       (message "%s" url-part)
-       (when best-link (message "%s" best-link))
-       (if best-link
-           ;; internal page
-           (let* ((corrected-link (save-match-data
-                                    (ikiwiki-org-correct-link best-link destpage))))
-             (replace-match (concat "[[./" corrected-link "][" (or (when image? corrected-link) text-part url-part) "]]") t t))
-         ;; external page -- put a slash in front if no text part
-         ;; otherwise, leave the same
-         (when (not text-part)
-           (replace-match (concat "\\[[" url-part "]]") t t)))))
-    (append-to-file (point-min) (point-max) outfile)))
-
-(defun ikiwiki-org-scan (infile outfile)
-  (with-temp-buffer
-    (insert-file-contents infile)
-    (org-mode)
-    (let ((org-info1 (org-infile-export-plist)))
-      (when (plist-get org-info1 :title)
-       (save-excursion
-         (with-temp-buffer
-          (insert "#+TITLE: ")
-          (insert (plist-get org-info1 :title))
-          (insert "\n")
-          (append-to-file (point-min) (point-max) outfile))))
-      (when (plist-get org-info1 :author)
-       (save-excursion
-         (with-temp-buffer
-           (insert "#+AUTHOR: ")
-           (insert (plist-get org-info1 :author))
-           (insert "\n")
-           (append-to-file (point-min) (point-max) outfile)))))
-    (goto-char (point-min))
-    (while (re-search-forward org-bracket-link-regexp (point-max) t)
-      (let ((url (ikiwiki-org-remove-link-prefix (match-string-no-properties 1))))
-       (save-excursion
-        (with-temp-buffer
-           (let ((buffer-file-coding-system 'utf-8))
-            (insert url)
-            (insert "\n")
-            (append-to-file (point-min) (point-max) outfile))))))))
-
-(defun ikiwiki-org-htmlize (infile outfile)
-  (let* ((org-export-html-preamble nil)
-        (org-export-html-postamble nil)
-        (org-export-with-sub-superscripts nil)
-        (org-export-with-TeX-macros nil) ; let mathjax take care of it
-        (org-export-with-LaTeX-fragments 'mathjax)
-        (org-export-babel-evaluate nil)
-        (org-export-with-toc nil)
-        (org-info1
-         (with-temp-buffer
-           (insert-file-contents infile)
-           (org-mode)
-           (list (org-infile-export-plist)
-                 ;(org-html-export-as-html 3 t nil 'string t))))
-                 (org-html-export-as-html nil t nil 'string t))))
-        (ret-html (cadr org-info1))
-        (title (plist-get (car org-info1) :title)))
-    (with-temp-buffer
-      (let ((buffer-file-coding-system 'utf-8))
-       (insert ret-html)
-       (append-to-file (point-min) (point-max) outfile)))))
-
-(provide 'ikiwiki-org-plugin)
-
diff --git a/.emacs.d/site-lisp/mediawiki.el b/.emacs.d/site-lisp/mediawiki.el
deleted file mode 100644 (file)
index 9d0be29..0000000
+++ /dev/null
@@ -1,2154 +0,0 @@
-;;; mediawiki.el --- mediawiki frontend
-
-;; Copyright (C) 2008, 2009, 2010, 2011 Mark A. Hershberger
-
-;; Original Authors: Jerry <unidevel@yahoo.com.cn>,
-;;      Chong Yidong <cyd at stupidchicken com> for wikipedia.el,
-;;      Uwe Brauer <oub at mat.ucm.es> for wikimedia.el
-;; Author: Mark A. Hershberger <mah@everybody.org>
-;; Version: 2.2.3
-;; Created: Sep 17 2004
-;; Keywords: mediawiki wikipedia network wiki
-;; URL: http://launchpad.net/mediawiki-el
-;; Last Modified: <2011-11-28 22:55:57 mah>
-
-(defconst mediawiki-version "2.2.3"
-  "Current version of mediawiki.el")
-
-;; This file is NOT (yet) part of GNU Emacs.
-
-;; 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 version of mediawiki.el represents a merging of
-;; wikipedia-mode.el (maintained by Uwe Brauer <oub at mat.ucm.es>)
-;; from http://www.emacswiki.org/emacs/wikipedia-mode.el for its
-;; font-lock code, menu, draft mode, replying and convenience
-;; functions to produce mediawiki.el 2.0.
-
-;;; Installation
-
-;; If you use ELPA (http://tromey.com/elpa), you can install via the
-;; M-x package-list-packages interface. This is preferrable as you
-;; will have access to updates automatically.
-
-;; Otherwise, just make sure this file is in your load-path (usually
-;; ~/.emacs.d is included) and put (require 'mediawiki.el) in your
-;; ~/.emacs or ~/.emacs.d/init.el file.
-
-;;; Howto:
-;;  M-x customize-group RET mediawiki RET
-;;  *dink* *dink*
-;;  M-x mediawiki-site RET Wikipedia RET
-;;
-;; Open a wiki file:    M-x mediawiki-open
-;; Save a wiki buffer:  C-x C-s
-;; Save a wiki buffer with a different name:  C-x C-w
-
-;;; TODO:
-;;  * Optionally use org-mode formatting for editing and translate
-;;    that to mw
-;;  * Move url-* methods to url-http
-;;  * Use the MW API to support searching, etc.
-;;  * Clean up and thoroughly test imported wikimedia.el code
-;;  * Improve language support.  Currently there is a toggle for
-;;    English or German.  This should probably just be replaced with
-;;    customizable words given MediaWiki's wide language support.
-
-;;; History
-
-;; From the News section of wikipedia.el comes this bit, kept here for
-;; reference later.
-;;     (4) "Draft", "send" and "reply" (for discussion pages)
-;;         abilities `based' on ideas of John Wigleys remember.el: see
-;;         the functions wikipedia-draft-*
-;;         RATIONALE: This comes handy in 2 situations
-;;            1. You are editing articles which various authors (this I
-;;               think is the usual case), you then want not to submit
-;;               your edit immediately but want to copy it somewhere and
-;;               to continue later. You can use the following functions
-;;               for doing that:
-;;               wikipedia-draft-buffer \C-c\C-b
-;;               wikipedia-draft-region \C-c\C-r
-;;               then the buffer/region will be appended to the
-;;               wikipedia-draft-data-file (default is
-;;               "~/Wiki/discussions/draft.wiki", which you can visit via
-;;               wikipedia-draft-view-draft) and it will be
-;;               surrounded by the ^L marks in order to set a page.
-;;               moreover on top on that a section header == will be
-;;               inserted, which consists of the Word Draft, a subject
-;;               you are asked for and a date stamp.
-;;
-;;               Another possibility consists in using the function
-;;               wikipedia-draft, bound to \C-c \C-m then a new buffer
-;;               will opened already in wikipedia mode. You edit and then
-;;               either can send the content of the buffer to the
-;;               wikipedia-draft-data-file in the same manner as
-;;               described above using the function
-;;               wikipedia-draft-buffer (bound to \C-c\C-k)
-;;
-;;               BACK: In order to copy/send the content of temporary
-;;               buffer or of a page in the wikipedia-draft-data-file
-;;               back in to your wikipedia file, use the function
-;;               wikipedia-send-draft-to-mozex bound to "\C-c\C-c". You
-;;               will be asked to which buffer to copy your text!
-;;
-;;
-;;            2. You want to reply  in a discussion page to a specific
-;;               contribution, you can use either the function
-;;
-;;               \\[wikipedia-reply-at-point-simple] bound to [(meta shift r)]
-;;               which inserts a newline, a hline, and the signature of
-;;               the author. Or can use
-;;               \\[wikipedia-draft-reply] bound  [(meta r)]
-;;               which does the same as wikipedia-reply-at-point-simple
-;;               but in a temporary draft buffer.
-;;
-;;               BACK: In order to copy/send the content of that buffer
-;;               back in to your wikipedia file, use the function
-;;               \\[wikipedia-send-draft-to-mozex] bound to "\C-c\C-c". You
-;;               will be asked to which buffer to copy your text! If
-;;               you want a copy to be send to your draft file, use
-;;               the variable  wikipedia-draft-send-archive
-;;
-
-;;; Code:
-
-(require 'url-http)
-(require 'mml)
-(require 'mm-url)
-(require 'ring)
-(eval-when-compile (progn
-                     (require 'cl)
-                     ;; Below copied from url-http to avoid compilation warnings
-                     (defvar url-http-extra-headers)
-                     (defvar url-http-target-url)
-                     (defvar url-http-proxy)
-                     (defvar url-http-connection-opened)
-                     ;; This should only be used in xemacs, anyway
-                     (setq byte-compile-not-obsolete-funcs (list 'assoc-ignore-case))))
-
-;; As of 2010-06-22, these functions are in Emacs
-(unless (fboundp 'url-bit-for-url)
-  (defun url-bit-for-url (method lookfor url)
-    (when (fboundp 'auth-source-user-or-password)
-      (let* ((urlobj (url-generic-parse-url url))
-             (bit (funcall method urlobj))
-             (methods (list 'url-recreate-url
-                            'url-host)))
-        (if (and (not bit) (> (length methods) 0))
-            (auth-source-user-or-password
-             lookfor (funcall (pop methods) urlobj) (url-type urlobj))
-          bit)))))
-
-(unless (fboundp 'url-url-for-url)
-  (defun url-user-for-url (url)
-    "Attempt to use .authinfo to find a user for this URL."
-    (url-bit-for-url 'url-user "login" url)))
-
-(unless (fboundp 'url-password-for-url)
-  (defun url-password-for-url (url)
-    "Attempt to use .authinfo to find a password for this URL."
-    (url-bit-for-url 'url-password "password" url)))
-
-(when (fboundp 'url-http-create-request)
-  (if (string= "GET / HTTP/1.0
-\nMIME-Version: 1.0
-\nConnection: close
-\nHost: example.com
-\nAccept: */*
-\nUser-Agent: URL/Emacs
-\nContent-length: 4
-\n
-\ntest"
-               (let ((url-http-target-url (url-generic-parse-url "http://example.com/"))
-                     (url-http-data "test") (url-http-version "1.0")
-                     url-http-method url-http-attempt-keepalives url-extensions-header
-                     url-http-extra-headers url-http-proxy url-mime-charset-string)
-                 (url-http-create-request)))
-      (defun url-http-create-request (&optional ref-url)
-        "Create an HTTP request for `url-http-target-url', referred to by REF-URL."
-        (declare (special proxy-info
-                          url-http-method url-http-data
-                          url-http-extra-headers))
-        (let* ((extra-headers)
-               (request nil)
-               (no-cache (cdr-safe (assoc "Pragma" url-http-extra-headers)))
-               (using-proxy url-http-proxy)
-               (proxy-auth (if (or (cdr-safe (assoc "Proxy-Authorization"
-                                                    url-http-extra-headers))
-                                   (not using-proxy))
-                               nil
-                             (let ((url-basic-auth-storage
-                                    'url-http-proxy-basic-auth-storage))
-                               (url-get-authentication url-http-target-url nil 'any nil))))
-               (real-fname (concat (url-filename url-http-target-url)
-                                   (url-recreate-url-attributes url-http-target-url)))
-               (host (url-host url-http-target-url))
-               (auth (if (cdr-safe (assoc "Authorization" url-http-extra-headers))
-                         nil
-                       (url-get-authentication (or
-                                                (and (boundp 'proxy-info)
-                                                     proxy-info)
-                                                url-http-target-url) nil 'any nil))))
-          (if (equal "" real-fname)
-              (setq real-fname "/"))
-          (setq no-cache (and no-cache (string-match "no-cache" no-cache)))
-          (if auth
-              (setq auth (concat "Authorization: " auth "\r\n")))
-          (if proxy-auth
-              (setq proxy-auth (concat "Proxy-Authorization: " proxy-auth "\r\n")))
-
-          ;; Protection against stupid values in the referer
-          (if (and ref-url (stringp ref-url) (or (string= ref-url "file:nil")
-                                                 (string= ref-url "")))
-              (setq ref-url nil))
-
-          ;; We do not want to expose the referer if the user is paranoid.
-          (if (or (memq url-privacy-level '(low high paranoid))
-                  (and (listp url-privacy-level)
-                       (memq 'lastloc url-privacy-level)))
-              (setq ref-url nil))
-
-          ;; url-http-extra-headers contains an assoc-list of
-          ;; header/value pairs that we need to put into the request.
-          (setq extra-headers (mapconcat
-                               (lambda (x)
-                                 (concat (car x) ": " (cdr x)))
-                               url-http-extra-headers "\r\n"))
-          (if (not (equal extra-headers ""))
-              (setq extra-headers (concat extra-headers "\r\n")))
-
-          ;; This was done with a call to `format'.  Concatting parts has
-          ;; the advantage of keeping the parts of each header together and
-          ;; allows us to elide null lines directly, at the cost of making
-          ;; the layout less clear.
-          (setq request
-                ;; We used to concat directly, but if one of the strings happens
-                ;; to being multibyte (even if it only contains pure ASCII) then
-                ;; every string gets converted with `string-MAKE-multibyte' which
-                ;; turns the 127-255 codes into things like latin-1 accented chars
-                ;; (it would work right if it used `string-TO-multibyte' instead).
-                ;; So to avoid the problem we force every string to be unibyte.
-                (mapconcat
-                 ;; FIXME: Instead of `string-AS-unibyte' we'd want
-                 ;; `string-to-unibyte', so as to properly signal an error if one
-                 ;; of the strings contains a multibyte char.
-                 'string-as-unibyte
-                 (delq nil
-                       (list
-                        ;; The request
-                        (or url-http-method "GET") " "
-                        (if using-proxy (url-recreate-url url-http-target-url) real-fname)
-                        " HTTP/" url-http-version "\r\n"
-                        ;; Version of MIME we speak
-                        "MIME-Version: 1.0\r\n"
-                        ;; (maybe) Try to keep the connection open
-                        "Connection: " (if (or using-proxy
-                                               (not url-http-attempt-keepalives))
-                                           "close" "keep-alive") "\r\n"
-                                           ;; HTTP extensions we support
-                        (if url-extensions-header
-                            (format
-                             "Extension: %s\r\n" url-extensions-header))
-                        ;; Who we want to talk to
-                        (if (/= (url-port url-http-target-url)
-                                (url-scheme-get-property
-                                 (url-type url-http-target-url) 'default-port))
-                            (format
-                             "Host: %s:%d\r\n" host (url-port url-http-target-url))
-                          (format "Host: %s\r\n" host))
-                        ;; Who its from
-                        (if url-personal-mail-address
-                            (concat
-                             "From: " url-personal-mail-address "\r\n"))
-                        ;; Encodings we understand
-                        (if url-mime-encoding-string
-                            (concat
-                             "Accept-encoding: " url-mime-encoding-string "\r\n"))
-                        (if url-mime-charset-string
-                            (concat
-                             "Accept-charset: " url-mime-charset-string "\r\n"))
-                        ;; Languages we understand
-                        (if url-mime-language-string
-                            (concat
-                             "Accept-language: " url-mime-language-string "\r\n"))
-                        ;; Types we understand
-                        "Accept: " (or url-mime-accept-string "*/*") "\r\n"
-                        ;; User agent
-                        (url-http-user-agent-string)
-                        ;; Proxy Authorization
-                        proxy-auth
-                        ;; Authorization
-                        auth
-                        ;; Cookies
-                        (url-cookie-generate-header-lines host real-fname
-                                                          (equal "https" (url-type url-http-target-url)))
-                        ;; If-modified-since
-                        (if (and (not no-cache)
-                                 (member url-http-method '("GET" nil)))
-                            (let ((tm (url-is-cached url-http-target-url)))
-                              (if tm
-                                  (concat "If-modified-since: "
-                                          (url-get-normalized-date tm) "\r\n"))))
-                        ;; Whence we came
-                        (if ref-url (concat
-                                     "Referer: " ref-url "\r\n"))
-                        extra-headers
-                        ;; Length of data
-                        (if url-http-data
-                            (concat
-                             "Content-length: " (number-to-string
-                                                 (length url-http-data))
-                             "\r\n"))
-                        ;; End request
-                        "\r\n"
-                        ;; Any data
-                        url-http-data "\r\n"))
-                 ""))
-          (url-http-debug "Request is: \n%s" request)
-          request))))
-
-(unless (fboundp 'mm-url-encode-multipart-form-data)
-  (defun mm-url-encode-multipart-form-data (pairs &optional boundary)
-    "Return PAIRS encoded in multipart/form-data."
-    ;; RFC1867
-
-    ;; Get a good boundary
-    (unless boundary
-      (setq boundary (mml-compute-boundary '())))
-
-    (concat
-
-     ;; Start with the boundary
-     "--" boundary "\r\n"
-
-     ;; Create name value pairs
-     (mapconcat
-      'identity
-      ;; Delete any returned items that are empty
-      (delq nil
-            (mapcar (lambda (data)
-
-                      (cond
-                       ((consp (car data))
-                        (let ((fieldname (cadar data))
-                              (filename  (caadar data))
-                              (mimetype  (car (caadar data)))
-                              (content   (caar (caadar data))))
-
-                          (concat
-                           ;; Encode the name
-                           "Content-Disposition: form-data; name=\"" fieldname "\"\r\n"
-                           "Content-Type: " mimetype "\r\n"
-                           "Content-Transfer-Encoding: binary\r\n\r\n"
-                           content
-                           "\r\n")))
-
-                       ((stringp (car data))
-                                ;; For each pair
-
-                        (concat
-                         ;; Encode the name
-                         "Content-Disposition: form-data; name=\""
-                         (car data) "\"\r\n"
-                         "Content-Type: text/plain; charset=utf-8\r\n"
-                         "Content-Transfer-Encoding: binary\r\n\r\n"
-
-                         (cond ((stringp (cdr data))
-                                (cdr data))
-                               ((integerp (cdr data))
-                                (int-to-string (cdr data))))
-
-                         "\r\n"))
-                       (t (error "I don't handle this."))))
-                    pairs))
-      ;; use the boundary as a separator
-      (concat "--" boundary "\r\n"))
-
-     ;; put a boundary at the end.
-     "--" boundary "--\r\n")))
-
-;; Not defined in my Xemacs
-(unless (fboundp 'assoc-string)
-  (defun assoc-string (key list &optional case-fold)
-    (if case-fold
-        (assoc-ignore-case key list)
-      (assoc key list))))
-
-(defun url-compat-retrieve (url post-process bufname callback cbargs)
-  (cond ((boundp 'url-be-asynchronous) ; Sniff w3 lib capability
-         (if callback
-             (setq url-be-asynchronous t)
-           (setq url-be-asynchronous nil))
-         (url-retrieve url t)
-         (when (not url-be-asynchronous)
-           (let ((result (funcall post-process bufname)))
-             result)))
-        (t (if callback
-               (url-retrieve url post-process
-                             (list bufname callback cbargs))
-             (with-current-buffer (url-retrieve-synchronously url)
-               (funcall post-process bufname))))))
-
-(defvar url-http-get-post-process 'url-http-response-post-process)
-(defun url-http-get (url &optional headers bufname callback cbargs)
-  "Convenience method to use method 'GET' to retrieve URL"
-  (let* ((url-request-extra-headers (if headers headers
-                                      (if url-request-extra-headers
-                                          url-request-extra-headers
-                                        (cons nil nil))))
-         (url-request-method "GET"))
-
-    (when (url-basic-auth url)
-      (add-to-list 'url-request-extra-headers
-                   (cons "Authorization" (url-basic-auth url))))
-    (url-compat-retrieve url url-http-get-post-process
-                         bufname callback cbargs)))
-
-(defvar url-http-post-post-process 'url-http-response-post-process)
-(defun url-http-post (url parameters &optional multipart headers bufname
-                          callback cbargs)
-  "Convenience method to use method 'POST' to retrieve URL"
-
-  (let* ((url-request-extra-headers
-          (if headers headers
-            (when url-request-extra-headers url-request-extra-headers)))
-         (boundary (int-to-string (random)))
-         (cs 'utf-8)
-         (content-type
-          (if multipart
-              (concat "multipart/form-data, boundary=" boundary)
-            (format "application/x-www-form-urlencoded; charset=%s" cs)))
-         (url-request-method "POST")
-         (url-request-coding-system cs)
-         (url-request-data
-          (if multipart
-              (mm-url-encode-multipart-form-data
-               parameters boundary)
-      &n