From 30d276a40295e56768cd6328317900751f8fceb1 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Fri, 10 Nov 2000 11:56:26 +0000 Subject: [PATCH] *** empty log message *** --- lisp/gnus/ChangeLog | 11 +++++++ lisp/md5.el | 79 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 lisp/md5.el diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c53be3a0352..f1f480ca3de 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,14 @@ +2000-11-10 Dave Love + + * pop3.el (pop3-version): Deleted. + (pop3-make-date): New function, avoiding message-make-date. + (pop3-munge-message-separator): Use it. + +2000-11-10 ShengHuo ZHU + + * pop3.el (pop3-munge-message-separator): A message may have an + empty body. + 2000-11-09 Dave Love * gnus-group.el (gnus-group-make-directory-group) diff --git a/lisp/md5.el b/lisp/md5.el new file mode 100644 index 00000000000..3064e974a3a --- /dev/null +++ b/lisp/md5.el @@ -0,0 +1,79 @@ +;;; md5.el --- MD5 message digest calculation (RFC 1321) + +;; Copyright (C) 2000 Free Software Foundation, Inc. + +;; Author: Dave Love +;; Keywords: mail, processes, tools + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; Provides the `md5' function for computing the MD5 `message +;; digest'/`fingerprint'/`checksum' for a string or buffer. This is +;; compatible with the XEmacs version. We expect to have primitive +;; MD5 support in a future version of Emacs. + +;; MD5 is defined in RFC 1321. + +;;; Code: + +;; Not worth customizing? Will go away anyhow with primitive support. +(defvar md5-program "md5sum" + "Name of a program to calculate MD5 (message digest) checksums. +This should read standard input and output the MD5 checksum in the +first 32 bytes of standard output. `md5sum' is in GNU Textutils. An +alternative is `md5', present in the SSLeay distribution.") + +;;;###autoload +(defun md5 (object &optional start end encoding noerror) + "Return the MD5 message digest (checksum or fingerprint) of OBJECT. +OBJECT is a buffer or a atring. Optional arguments START and END +specify a region of the object to use, where the first character is 1 +for both buffers and strings. + +Optional argument ENCODING specifies a coding system with which to +encode the text for computing the digest. If omitted, the normal +rules will be used to find a coding system for output to +`md5-program'. It probably makes most sense to use unibyte data and +`binary' encoding. Optional argument NOERROR is for XEmacs +compatibility and is ignored. + +In this implementation, the program named by `md5-program' is run to +do the calculation. + +MD5 is defined in RFC 1321." + (with-temp-buffer + (let ((in-buffer (current-buffer)) + (out-buffer (current-buffer))) + (if (stringp object) + (insert object) + (setq in-buffer object)) + (goto-char (point-min)) + (unless encoding + (setq encoding coding-system-for-write)) + (with-current-buffer in-buffer + (let ((coding-system-for-write encoding)) + (unless (eq 0 (call-process-region (or start (point-min)) + (or end (point-max)) + md5-program nil out-buffer)) + (error "Running MD5 command %s failed" + (cons md5-program md5-program-args))))) + ;; The meaningful output is the first 32 characters. + ;; Don't return the newline that follows them! + (buffer-substring 1 33)))) + +;;; md5.el ends here -- 2.39.5