Function: nneething-from-line

nneething-from-line is a byte-compiled function defined in nneething.el.gz.

Signature

(nneething-from-line UID &optional FILE)

Documentation

Return a From header based of UID.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nneething.el.gz
(defun nneething-from-line (uid &optional file)
  "Return a From header based of UID."
  (let* ((login (condition-case nil
		    (user-login-name uid)
		  (error
		   (cond ((= uid (user-uid)) (user-login-name))
			 ((zerop uid) "root")
			 (t (int-to-string uid))))))
	 (name (condition-case nil
		   (user-full-name uid)
		 (error
		  (cond ((= uid (user-uid)) (user-full-name))
			((zerop uid) "Ms. Root")))))
	 (host (if  (string-match "\\`/[^/@]*@\\([^:/]+\\):" file)
		   (prog1
		       (substring file
				  (match-beginning 1)
				  (match-end 1))
		     (when (string-match
			    "/\\(users\\|home\\)/\\([^/]+\\)/" file)
		       (setq login (substring file
					      (match-beginning 2)
					      (match-end 2))
			     name nil)))
		 (system-name))))
    (concat "From: " login "@" host
	    (if name (concat " (" name ")") "") "\n")))