Function: gnus-uu-binhex-article

gnus-uu-binhex-article is a byte-compiled function defined in gnus-uu.el.gz.

Signature

(gnus-uu-binhex-article BUFFER IN-STATE)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-uu.el.gz
(defun gnus-uu-binhex-article (buffer _in-state)
  (let (state start-char)
    (with-current-buffer buffer
      (widen)
      (goto-char (point-min))
      (when (not (re-search-forward gnus-uu-binhex-begin-line nil t))
	(when (not (re-search-forward gnus-uu-binhex-body-line nil t))
	  (setq state (list 'wrong-type))))

      (if (memq 'wrong-type state)
	  ()
	(beginning-of-line)
	(setq start-char (point))
	(if (looking-at gnus-uu-binhex-begin-line)
	    (progn
	      (setq state (list 'begin))
	      (write-region (point-min) (point-min)
			    gnus-uu-binhex-article-name))
	  (setq state (list 'middle)))
	(goto-char (point-max))
	(re-search-backward (concat gnus-uu-binhex-body-line "\\|"
				    gnus-uu-binhex-end-line)
			    nil t)
	(when (looking-at gnus-uu-binhex-end-line)
	  (setq state (if (memq 'begin state)
			  (cons 'end state)
			(list 'end))))
	(beginning-of-line)
	(forward-line 1)
	(when (file-exists-p gnus-uu-binhex-article-name)
	  (mm-append-to-file start-char (point) gnus-uu-binhex-article-name))))
    (if (memq 'begin state)
	(cons gnus-uu-binhex-article-name state)
      state)))