Function: nneething-make-head
nneething-make-head is a byte-compiled function defined in
nneething.el.gz.
Signature
(nneething-make-head FILE &optional BUFFER EXTRA-MSG MIME-TYPE MIME-CHARSET MIME-ENCODING)
Documentation
Create a head by looking at the file attributes of FILE.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/nneething.el.gz
(defun nneething-make-head (file &optional buffer extra-msg
mime-type mime-charset mime-encoding)
"Create a head by looking at the file attributes of FILE."
(let ((atts (file-attributes file)))
(insert
"Subject: " (file-name-nondirectory file) (or extra-msg "") "\n"
"Message-ID: <nneething-" (nneething-encode-file-name file)
"@" (system-name) ">\n"
(if (time-equal-p 0 (file-attribute-modification-time atts)) ""
(concat "Date: "
(current-time-string (file-attribute-modification-time atts))
"\n"))
(or (when buffer
(with-current-buffer buffer
(when (re-search-forward "<[a-zA-Z0-9_]@[-a-zA-Z0-9_]>" 1000 t)
(concat "From: " (match-string 0) "\n"))))
(nneething-from-line (file-attribute-user-id atts) file))
(if (> (file-attribute-size atts) 0)
(concat "Chars: " (int-to-string (file-attribute-size atts)) "\n")
"")
(if buffer
(with-current-buffer buffer
(concat "Lines: " (int-to-string
(count-lines (point-min) (point-max)))
"\n"))
"")
(if mime-type
(concat "Content-Type: " mime-type
(if mime-charset
(concat "; charset="
(if (stringp mime-charset)
mime-charset
(symbol-name mime-charset)))
"")
(if mime-encoding
(concat "\nContent-Transfer-Encoding: " mime-encoding)
"")
"\nMIME-Version: 1.0\n")
""))))