]> code.delx.au - gnu-emacs/blobdiff - lisp/mail/mailheader.el
Update copyright year to 2016
[gnu-emacs] / lisp / mail / mailheader.el
index 960d3c6548783a543d99e5334504e0c36ace1cbf..cf410b5c18286709009fbf9f2035c99a190ac121 100644 (file)
@@ -1,7 +1,6 @@
 ;;; mailheader.el --- mail header parsing, merging, formatting
 
-;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2016 Free Software Foundation, Inc.
 
 ;; Author: Erik Naggum <erik@naggum.no>
 ;; Keywords: tools, mail, news
 
 ;;; Code:
 
-(eval-when-compile
-  (require 'cl))
-
-;; Make the byte-compiler shut up.
-(defvar headers)
-
 (defun mail-header-extract ()
   "Extract headers from current buffer after point.
 Returns a header alist, where each element is a cons cell (name . value),
@@ -105,12 +98,17 @@ value."
                (cons (cdr header) (funcall (cdr rule) (cdr header))))))))
   headers)
 
+;; Advertised part of the interface; see mail-header, mail-header-set.
+(defvar headers)
+
 (defsubst mail-header (header &optional header-alist)
   "Return the value associated with header HEADER in HEADER-ALIST.
 If the value is a string, it is the original value of the header.  If the
 value is a list, its first element is the original value of the header,
 with any subsequent elements being the result of parsing the value.
 If HEADER-ALIST is nil, the dynamically bound variable `headers' is used."
+  (declare (gv-setter (lambda (value)
+                        `(mail-header-set ,header ,value ,header-alist))))
   (cdr (assq header (or header-alist headers))))
 
 (defun mail-header-set (header value &optional header-alist)
@@ -124,9 +122,6 @@ See `mail-header' for the semantics of VALUE."
        (nconc alist (list (cons header value)))))
   value)
 
-(defsetf mail-header (header &optional header-alist) (value)
-  `(mail-header-set ,header ,value ,header-alist))
-
 (defun mail-header-merge (merge-rules headers)
   "Return a new header alist with MERGE-RULES applied to HEADERS.
 MERGE-RULES is an alist whose keys are header names (symbols) and whose
@@ -191,5 +186,4 @@ A key of nil has as its value a list of defaulted headers to ignore."
 
 (provide 'mailheader)
 
-;; arch-tag: 6e7aa221-80b5-4b3d-b46f-fd66ab567be0
 ;;; mailheader.el ends here