(defun unfill-paragraph-azou ()
  "Transform the individual lines of a paragraph into one long one.
Eliminate any indent."
  (interactive)
  (let ((before (point))
	(paragraph-start "")
	(fill-column (point-max))
        (sentence-end-double-space nil)
        (colon-double-space nil)
        (fill-individual-varying-indent t))
    (save-excursion
        (backward-paragraph)
	  (forward-char 1)
	    (while (looking-at "[ \t]")
	          (delete-char))
	      (forward-paragraph)
	        (or (bolp) (newline 1))
		  (let ((end (point))
			(start (progn (backward-paragraph) (point)))
			(fill-individual-varying-indent t))
		        (goto-char before)
			    (fill-individual-paragraphs start end)))))

(defun unfill-paragraph-mush ()
  "Transform the individual lines of a paragraph into one long one using
'unfill-paragraph-azou', eliminating any indent. Put the result into the
cut-and-paste buffer, with an extra \\\\ in front and a newline at the end
for easy pasting into a MUSH or MUX. Add empty line after paragraph unless
there already is one. Place point there. Runs font-lock-fontify-buffer to
highlight quoted speech."
  (interactive)
  (unfill-paragraph-azou)
  (let ((before (point))
	(selection-sets-clipboard t))
    (save-excursion
        (beginning-of-line)
	  (setq start (point))
	    (end-of-line)
	      (setq my-clip (concat "\\\\" (buffer-substring-no-properties start (point)) "\n"))
	        (own-selection my-clip)
;  (message (concat (number-to-string start) " - " (number-to-string (point)) ": " my-clip))
;  (goto-char before)
		  (forward-paragraph)
		    (if (not (looking-at "\n"))
			      (insert "\n")))
    (forward-paragraph)
    (forward-char 1)
    (font-lock-fontify-buffer)))

;(global-set-key "\M-Q" 'unfill-paragraph-mush)

