Mercurial > emacs
comparison lisp/mail/mailheader.el @ 111494:af2f491b6b27
mailheader.el comments.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Wed, 10 Nov 2010 20:10:38 -0800 |
parents | 280c8ae2476d |
children | 417b1e4d63cd |
comparison
equal
deleted
inserted
replaced
111493:751b60021ab0 | 111494:af2f491b6b27 |
---|---|
1 ;;; mailheader.el --- mail header parsing, merging, formatting | 1 ;;; mailheader.el --- mail header parsing, merging, formatting |
2 | 2 |
3 ;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005, | 3 ;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
4 ;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 4 ;; 2009, 2010 Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Erik Naggum <erik@naggum.no> | 6 ;; Author: Erik Naggum <erik@naggum.no> |
7 ;; Keywords: tools, mail, news | 7 ;; Keywords: tools, mail, news |
8 ;; Package: mail-utils | 8 ;; Package: mail-utils |
9 | 9 |
46 | 46 |
47 ;;; Code: | 47 ;;; Code: |
48 | 48 |
49 (eval-when-compile | 49 (eval-when-compile |
50 (require 'cl)) | 50 (require 'cl)) |
51 | |
52 ;; Make the byte-compiler shut up. | |
53 (defvar headers) | |
54 | 51 |
55 (defun mail-header-extract () | 52 (defun mail-header-extract () |
56 "Extract headers from current buffer after point. | 53 "Extract headers from current buffer after point. |
57 Returns a header alist, where each element is a cons cell (name . value), | 54 Returns a header alist, where each element is a cons cell (name . value), |
58 where NAME is a symbol, and VALUE is the string value of the header having | 55 where NAME is a symbol, and VALUE is the string value of the header having |
102 (if (consp (cdr header)) | 99 (if (consp (cdr header)) |
103 (setf (cddr header) (funcall (cdr rule) (cadr header))) | 100 (setf (cddr header) (funcall (cdr rule) (cadr header))) |
104 (setf (cdr header) | 101 (setf (cdr header) |
105 (cons (cdr header) (funcall (cdr rule) (cdr header)))))))) | 102 (cons (cdr header) (funcall (cdr rule) (cdr header)))))))) |
106 headers) | 103 headers) |
104 | |
105 ;; Advertized part of the interface; see mail-header, mail-header-set. | |
106 (defvar headers) | |
107 | 107 |
108 (defsubst mail-header (header &optional header-alist) | 108 (defsubst mail-header (header &optional header-alist) |
109 "Return the value associated with header HEADER in HEADER-ALIST. | 109 "Return the value associated with header HEADER in HEADER-ALIST. |
110 If the value is a string, it is the original value of the header. If the | 110 If the value is a string, it is the original value of the header. If the |
111 value is a list, its first element is the original value of the header, | 111 value is a list, its first element is the original value of the header, |
189 (funcall mail-header-format-function header value)))))) | 189 (funcall mail-header-format-function header value)))))) |
190 (insert "\n"))) | 190 (insert "\n"))) |
191 | 191 |
192 (provide 'mailheader) | 192 (provide 'mailheader) |
193 | 193 |
194 ;; arch-tag: 6e7aa221-80b5-4b3d-b46f-fd66ab567be0 | |
195 ;;; mailheader.el ends here | 194 ;;; mailheader.el ends here |