From 3f8fa98a7f95d561bf1f2707fbbbd48e12de65d6 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 26 Nov 2001 01:34:15 +0000 Subject: [PATCH] Synch with Oort Gnus. --- contrib/ChangeLog | 5 + contrib/sha1.el | 397 ---------------------------------------------------- lisp/ChangeLog | 37 +++++ lisp/canlock.el | 29 ++-- lisp/gnus-score.el | 2 +- lisp/gnus-sum.el | 58 +++++--- lisp/gnus-util.el | 5 + lisp/message.el | 16 +-- lisp/mm-bodies.el | 2 + lisp/mm-encode.el | 2 +- lisp/mm-util.el | 2 +- texi/ChangeLog | 4 + texi/gnus-ja.texi | 9 +- texi/gnus.texi | 9 +- todo | 10 ++ 15 files changed, 140 insertions(+), 447 deletions(-) delete mode 100644 contrib/sha1.el diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 77c02d2..533ec11 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2001-11-22 Simon Josefsson + + * sha1.el: Removed. (A FSF copyrighted sha1-el.el file is in + ../lisp/). + 2001-10-30 21:00:00 ShengHuo ZHU * canlock.el, hex-util.el, sha1-el.el: Move to lisp. diff --git a/contrib/sha1.el b/contrib/sha1.el deleted file mode 100644 index f4706b8..0000000 --- a/contrib/sha1.el +++ /dev/null @@ -1,397 +0,0 @@ -;;; sha1.el --- SHA1 Message Digest Algorithm. -;; Copyright (C) 1998,1999 Keiichi Suzuki. - -;; Author: Keiichi Suzuki -;; Author: Katsumi Yamaoka -;; Created: 1998-12-25 -;; Revised: 1999-01-13 -;; Keywords: sha1, news, cancel-lock, hmac, rfc2104 - -;; This program 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 program 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. - -;;; A copy of the GNU General Public License can be obtained from this -;;; program's author (send electronic mail to kyle@uunet.uu.net) or from -;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA -;;; 02139, USA. - -;;; Commentary: - -;; This is a direct translation into Emacs LISP of the reference C -;; implementation of the SHA1 message digest algorithm. - -;;; Usage: - -;; To compute the SHA1 message digest for a message M (represented as -;; a string), call -;; -;; (sha1-encode M) -;; -;; which returns the message digest as a hexadecimal string of 20 bytes. -;; If you need to supply the message in pieces M1, M2, ... Mn, then call -;; -;; (sha1-init) -;; (sha1-update M1) -;; (sha1-update M2) -;; ... -;; (sha1-update Mn) -;; (sha1-final) - -;;; Notes: - -;; The C algorithm uses 32-bit integers; because GNU Emacs -;; implementations provide 28-bit integers (with 24-bit integers on -;; versions prior to 19.29), the code represents a 32-bit integer as the -;; cons of two 16-bit integers. The most significant word is stored in -;; the car and the least significant in the cdr. The algorithm requires -;; at least 19 bits of integer representation in order to represent the -;; carry from a 16-bit addition. (see sha1-add()) - -;;; Code: - -(defmacro sha1-f1 (x y z) - `(cons - (logior (logand (car ,x) (car ,y)) (logand (lognot (car ,x)) (car ,z))) - (logior (logand (cdr ,x) (cdr ,y)) (logand (lognot (cdr ,x)) (cdr ,z))) - )) - -(defmacro sha1-f2 (x y z) - `(cons - (logxor (car ,x) (car ,y) (car ,z)) - (logxor (cdr ,x) (cdr ,y) (cdr ,z)) - )) - -(defmacro sha1-f3 (x y z) - `(cons - (logior (logand (car ,x) (car ,y)) (logand (car ,x) (car ,z)) - (logand (car ,y) (car ,z))) - (logior (logand (cdr ,x) (cdr ,y)) (logand (cdr ,x) (cdr ,z)) - (logand (cdr ,y) (cdr ,z))) - )) - -(defmacro sha1-f4 (x y z) - `(cons - (logxor (car ,x) (car ,y) (car ,z)) - (logxor (cdr ,x) (cdr ,y) (cdr ,z)) - )) - -(defconst sha1-const1 '(23170 . 31129) - "SHA constants 1 \(0x5a827999\)") -(defconst sha1-const2 '(28377 . 60321) - "SHA constants 2 \(0x6ed9eba1\)") -(defconst sha1-const3 '(36635 . 48348) - "SHA constants 3 \(0x8f1bbcdc\)") -(defconst sha1-const4 '(51810 . 49622) - "SHA constants 4 \(0xca62c1d6\)") - -(defvar sha1-digest (make-vector 5 nil)) -(defvar sha1-count-lo nil) -(defvar sha1-count-hi nil) -(defvar sha1-data nil) -(defvar sha1-local nil) -(defconst SHA1-BLOCKSIZE 64) - -(defun sha1-init () - "Initialize the state of the SHA1 message digest routines." - (aset sha1-digest 0 (cons 26437 8961)) - (aset sha1-digest 1 (cons 61389 43913)) - (aset sha1-digest 2 (cons 39098 56574)) - (aset sha1-digest 3 (cons 4146 21622)) - (aset sha1-digest 4 (cons 50130 57840)) - (setq sha1-count-lo (cons 0 0) - sha1-count-hi (cons 0 0) - sha1-local 0 - sha1-data nil) - ) - -(defmacro sha1-32-make (v) - "Return 32bits internal value from normal integer." - `(cons (lsh ,v -16) (logand 65535 ,v))) - -(defun sha1-add (to &rest vals) - "Set sum of all the arguments to the first one." - (let (val) - (while (setq val (car vals)) - (setcar to (+ (car to) (car val))) - (setcdr to (+ (cdr to) (cdr val))) - (setq vals (cdr vals)) - ) - (setcar to (logand 65535 (+ (car to) (lsh (cdr to) -16)))) - (setcdr to (logand 65535 (cdr to))) - to - )) - -(defun sha1-xor (to &rest vals) - "Set bitwise-exclusive-or of all the arguments to the first one." - (let (val) - (while (setq val (car vals)) - (setcar to (logxor (car to) (car val))) - (setcdr to (logxor (cdr to) (cdr val))) - (setq vals (cdr vals))) - )) - -(defmacro sha1-rot (val c1 c2) - "Internal macro for sha1-rot-*." - `(cons - (logand 65535 (logior (lsh (car ,val) ,c1) (lsh (cdr ,val) ,c2))) - (logand 65535 (logior (lsh (cdr ,val) ,c1) (lsh (car ,val) ,c2))) - )) - -(defmacro sha1-rot-1 (val) - "Return VAL with its bits rotated left by 1." - `(sha1-rot ,val 1 -15) - ) - -(defmacro sha1-rot-5 (val) - "Return VAL with its bits rotated left by 5." - `(sha1-rot ,val 5 -11) - ) - -(defmacro sha1-rot-30 (val) - "Return VAL with its bits rotated left by 30." - `(sha1-rot ,val -2 14) - ) - -(defun sha1-inc (to) - "Set TO pulus one to TO." - (setcdr to (1+ (cdr to))) - (when (> (cdr to) 65535) - (setcdr to (logand 65535 (cdr to))) - (setcar to (logand 65535 (1+ (car to)))))) - -(defun sha1-lsh (to v count) - "Set TO with its bits shifted left by COUNT to TO." - (setcar to (logand 65535 - (logior (lsh (car v) count) (lsh (cdr v) (- count 16))))) - (setcdr to (logand 65535 (lsh (cdr v) count))) - to - ) - -(defun sha1-rsh (to v count) - "Set TO with its bits shifted right by COUNT to TO." - (setq count (- 0 count)) - (setcdr to (logand 65535 - (logior (lsh (cdr v) count) (lsh (car v) (- count 16))))) - (setcar to (logand 65535 (lsh (car v) count))) - to - ) - -(defun sha1-< (v1 v2) - "Return t if firast argment is less then second argument." - (or (< (car v1) (car v2)) - (and (eq (car v1) (car v2)) - (< (cdr v1) (cdr v2)))) - ) - -(unless (fboundp 'string-as-unibyte) - (defsubst string-as-unibyte (string) - string) - ) - -(defun sha1-update (bytes) - "Update the current SHA1 state with BYTES (an string of uni-bytes)." - (setq bytes (string-as-unibyte bytes)) - (let* ((len (length bytes)) - (len32 (sha1-32-make len)) - (tmp32 (cons 0 0)) - (top 0) - (clo (cons 0 0)) - i done) - (sha1-add clo sha1-count-lo (sha1-lsh tmp32 len32 3)) - (when (sha1-< clo sha1-count-lo) - (sha1-inc sha1-count-hi)) - (setq sha1-count-lo clo) - (sha1-add sha1-count-hi (sha1-rsh tmp32 len32 29)) - (when (> (length sha1-data) 0) - (setq i (- SHA1-BLOCKSIZE (length sha1-data))) - (when (> i len) - (setq i len)) - (setq sha1-data (concat sha1-data (substring bytes 0 i))) - (setq len (- len i) - top i) - (if (eq (length sha1-data) SHA1-BLOCKSIZE) - (sha1-transform) - (setq done t))) - (when (not done) - (while (and (not done) - (>= len SHA1-BLOCKSIZE)) - (setq sha1-data (substring bytes top (+ top SHA1-BLOCKSIZE)) - top (+ top SHA1-BLOCKSIZE) - len (- len SHA1-BLOCKSIZE)) - (sha1-transform)) - (setq sha1-data (substring bytes top (+ top len)))) - )) - -(defmacro sha1-FA (n) - (let ((func (intern (format "sha1-f%d" n))) - (const (intern (format "sha1-const%d" n)))) - `(setq T (sha1-add (cons 0 0) (sha1-rot-5 A) (,func B C D) E (aref W WIDX) - ,const) - WIDX (1+ WIDX) - B (sha1-rot-30 B)))) - -(defmacro sha1-FB (n) - (let ((func (intern (format "sha1-f%d" n))) - (const (intern (format "sha1-const%d" n)))) - `(setq E (sha1-add (cons 0 0) (sha1-rot-5 T) (,func A B C) D (aref W WIDX) - ,const) - WIDX (1+ WIDX) - A (sha1-rot-30 A)))) - -(defmacro sha1-FC (n) - (let ((func (intern (format "sha1-f%d" n))) - (const (intern (format "sha1-const%d" n)))) - `(setq D (sha1-add (cons 0 0) (sha1-rot-5 E) (,func T A B) C (aref W WIDX) - ,const) - WIDX (1+ WIDX) - T (sha1-rot-30 T)))) - -(defmacro sha1-FD (n) - (let ((func (intern (format "sha1-f%d" n))) - (const (intern (format "sha1-const%d" n)))) - `(setq C (sha1-add (cons 0 0) (sha1-rot-5 D) (,func E T A) B (aref W WIDX) - ,const) - WIDX (1+ WIDX) - E (sha1-rot-30 E)))) - -(defmacro sha1-FE (n) - (let ((func (intern (format "sha1-f%d" n))) - (const (intern (format "sha1-const%d" n)))) - `(setq B (sha1-add (cons 0 0) (sha1-rot-5 C) (,func D E T) A (aref W WIDX) - ,const) - WIDX (1+ WIDX) - D (sha1-rot-30 D)))) - -(defmacro sha1-FT (n) - (let ((func (intern (format "sha1-f%d" n))) - (const (intern (format "sha1-const%d" n)))) - `(setq A (sha1-add (cons 0 0) (sha1-rot-5 B) (,func C D E) T (aref W WIDX) - ,const) - WIDX (1+ WIDX) - C (sha1-rot-30 C)))) - -(defun sha1-transform () - "Basic SHA1 step. Transform sha1-digest based on sha1-data." - (let ((W (make-vector 80 nil)) - (WIDX 0) - (bidx 0) - T A B C D E) - (while (< WIDX 16) - (aset W WIDX - (cons (logior (lsh (aref sha1-data bidx) 8) - (aref sha1-data (setq bidx (1+ bidx)))) - (logior (lsh (aref sha1-data (setq bidx (1+ bidx))) 8) - (aref sha1-data (setq bidx (1+ bidx)))))) - (setq bidx (1+ bidx) - WIDX (1+ WIDX))) - (while (< WIDX 80) - (aset W WIDX (cons 0 0)) - (sha1-xor (aref W WIDX) - (aref W (- WIDX 3)) (aref W (- WIDX 8)) - (aref W (- WIDX 14)) (aref W (- WIDX 16))) - (aset W WIDX (sha1-rot-1 (aref W WIDX))) - (setq WIDX (1+ WIDX))) - (setq A (cons (car (aref sha1-digest 0)) (cdr (aref sha1-digest 0))) - B (cons (car (aref sha1-digest 1)) (cdr (aref sha1-digest 1))) - C (cons (car (aref sha1-digest 2)) (cdr (aref sha1-digest 2))) - D (cons (car (aref sha1-digest 3)) (cdr (aref sha1-digest 3))) - E (cons (car (aref sha1-digest 4)) (cdr (aref sha1-digest 4))) - WIDX 0) - - (sha1-FA 1) (sha1-FB 1) (sha1-FC 1) (sha1-FD 1) (sha1-FE 1) (sha1-FT 1) - (sha1-FA 1) (sha1-FB 1) (sha1-FC 1) (sha1-FD 1) (sha1-FE 1) (sha1-FT 1) - (sha1-FA 1) (sha1-FB 1) (sha1-FC 1) (sha1-FD 1) (sha1-FE 1) (sha1-FT 1) - (sha1-FA 1) (sha1-FB 1) (sha1-FC 2) (sha1-FD 2) (sha1-FE 2) (sha1-FT 2) - (sha1-FA 2) (sha1-FB 2) (sha1-FC 2) (sha1-FD 2) (sha1-FE 2) (sha1-FT 2) - (sha1-FA 2) (sha1-FB 2) (sha1-FC 2) (sha1-FD 2) (sha1-FE 2) (sha1-FT 2) - (sha1-FA 2) (sha1-FB 2) (sha1-FC 2) (sha1-FD 2) (sha1-FE 3) (sha1-FT 3) - (sha1-FA 3) (sha1-FB 3) (sha1-FC 3) (sha1-FD 3) (sha1-FE 3) (sha1-FT 3) - (sha1-FA 3) (sha1-FB 3) (sha1-FC 3) (sha1-FD 3) (sha1-FE 3) (sha1-FT 3) - (sha1-FA 3) (sha1-FB 3) (sha1-FC 3) (sha1-FD 3) (sha1-FE 3) (sha1-FT 3) - (sha1-FA 4) (sha1-FB 4) (sha1-FC 4) (sha1-FD 4) (sha1-FE 4) (sha1-FT 4) - (sha1-FA 4) (sha1-FB 4) (sha1-FC 4) (sha1-FD 4) (sha1-FE 4) (sha1-FT 4) - (sha1-FA 4) (sha1-FB 4) (sha1-FC 4) (sha1-FD 4) (sha1-FE 4) (sha1-FT 4) - (sha1-FA 4) (sha1-FB 4) - - (sha1-add (aref sha1-digest 0) E) - (sha1-add (aref sha1-digest 1) T) - (sha1-add (aref sha1-digest 2) A) - (sha1-add (aref sha1-digest 3) B) - (sha1-add (aref sha1-digest 4) C) - )) - -(defun sha1-final (&optional binary) - "Transform buffered sha1-data and return SHA1 message digest. -If optional argument BINARY is non-nil, then return binary formed -string of message digest." - (let ((count (logand (lsh (cdr sha1-count-lo) -3) 63))) - (when (< (length sha1-data) SHA1-BLOCKSIZE) - (setq sha1-data - (concat sha1-data - (make-string (- SHA1-BLOCKSIZE (length sha1-data)) 0)))) - (aset sha1-data count 128) - (setq count (1+ count)) - (if (> count (- SHA1-BLOCKSIZE 8)) - (progn - (setq sha1-data (concat (substring sha1-data 0 count) - (make-string (- SHA1-BLOCKSIZE count) 0))) - (sha1-transform) - (setq sha1-data (concat (make-string (- SHA1-BLOCKSIZE 8) 0) - (substring sha1-data -8)))) - (setq sha1-data (concat (substring sha1-data 0 count) - (make-string (- SHA1-BLOCKSIZE 8 count) 0) - (substring sha1-data -8)))) - (aset sha1-data 56 (lsh (car sha1-count-hi) -8)) - (aset sha1-data 57 (logand 255 (car sha1-count-hi))) - (aset sha1-data 58 (lsh (cdr sha1-count-hi) -8)) - (aset sha1-data 59 (logand 255 (cdr sha1-count-hi))) - (aset sha1-data 60 (lsh (car sha1-count-lo) -8)) - (aset sha1-data 61 (logand 255 (car sha1-count-lo))) - (aset sha1-data 62 (lsh (cdr sha1-count-lo) -8)) - (aset sha1-data 63 (logand 255 (cdr sha1-count-lo))) - (sha1-transform) - (if binary - (mapconcat - (lambda (elem) - (concat (char-to-string (/ (car elem) 256)) - (char-to-string (% (car elem) 256)) - (char-to-string (/ (cdr elem) 256)) - (char-to-string (% (cdr elem) 256)))) - (list (aref sha1-digest 0) (aref sha1-digest 1) (aref sha1-digest 2) - (aref sha1-digest 3) (aref sha1-digest 4)) - "") - (format "%04x%04x%04x%04x%04x%04x%04x%04x%04x%04x" - (car (aref sha1-digest 0)) (cdr (aref sha1-digest 0)) - (car (aref sha1-digest 1)) (cdr (aref sha1-digest 1)) - (car (aref sha1-digest 2)) (cdr (aref sha1-digest 2)) - (car (aref sha1-digest 3)) (cdr (aref sha1-digest 3)) - (car (aref sha1-digest 4)) (cdr (aref sha1-digest 4))) - ))) - -(defun sha1-encode (message &optional binary) - "Encodes MESSAGE using the SHA1 message digest algorithm. -MESSAGE must be a unibyte-string. -By default, return a string which formed hex-decimal charcters -from message digest. -If optional argument BINARY is non-nil, then return binary formed -string of message digest." - (sha1-init) - (sha1-update message) - (sha1-final binary)) - -(defun sha1-encode-binary (message) - "Encodes MESSAGE using the SHA1 message digest algorithm. -MESSAGE must be a unibyte-string. -Return binary formed string of message digest." - (sha1-encode message 'binary)) - -(provide 'sha1) - -;;; sha1.el ends here diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8a6a5fd..9c77bd7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,40 @@ +2001-11-25 15:00:00 ShengHuo ZHU + + * mm-util.el (mm-coding-system-priorities): Add backslash in the doc. + + * message.el (message-setup-1): Clean up mc-*. + +2001-11-25 09:00:00 ShengHuo ZHU + + * gnus-util.el (gnus-directory-sep-char-regexp): New. + * gnus-score.el (gnus-score-find-bnews): Use it. + + * gnus-sum.el (gnus-summary-limit-to-subject): An exclusion version. + (gnus-summary-limit-to-author): Ditto. + (gnus-summary-limit-to-extra): Ditto. + (gnus-summary-find-matching): Support not-matching argument. + +2001-11-25 Kai Gro,A_(Bjohann + + * message.el (message-wash-subject): Use `insert' rather than + `insert-string', which is deprecated. + +2001-11-24 Simon Josefsson + + * mm-encode.el (mm-encode-content-transfer-encoding): Fix error + message. (Gnus does not "default" to using 8bit for the message, + it default to use 8bit encoding and the user-supplied CTE + value. Calling this behaviour "treating it as 8bit" is perhaps + better.) + + * mm-bodies.el (mm-body-encoding): Intern encoding if needed + (compare mm-charset-to-coding-system). + +2001-11-23 02:00:00 ShengHuo ZHU + + * canlock.el (canlock-sha1-with-openssl): Use unibyte + buffer. Correctly decode hex. + 2001-11-21 01:00:00 ShengHuo ZHU * gnus-agent.el (gnus-category-insert-line): Convert category diff --git a/lisp/canlock.el b/lisp/canlock.el index 89673be..f1d5b6a 100644 --- a/lisp/canlock.el +++ b/lisp/canlock.el @@ -101,18 +101,23 @@ buffer does not look like a news message." (defun canlock-sha1-with-openssl (message) "Make a SHA-1 digest of MESSAGE using OpenSSL." - (with-temp-buffer - (let ((coding-system-for-read 'binary) - (coding-system-for-write 'binary) - selective-display - (case-fold-search t)) - (insert message) - (apply 'call-process-region (point-min) (point-max) - canlock-openssl-program t t nil canlock-openssl-args) - (goto-char (point-min)) - (while (re-search-forward "[0-9a-f][0-9a-f]" nil t) - (replace-match (read (concat "\"\\x" (match-string 0) "\"")))) - (buffer-substring (point-min) (point))))) + (let (default-enable-multibyte-characters) + (with-temp-buffer + (let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary) + selective-display + (case-fold-search t) + (str "")) + (insert message) + (apply 'call-process-region (point-min) (point-max) + canlock-openssl-program t t nil canlock-openssl-args) + (goto-char (point-min)) + (insert "\"") + (while (re-search-forward "[0-9a-f][0-9a-f]" nil t) + (replace-match (concat "\\\\x" (match-string 0)))) + (insert "\"") + (goto-char (point-min)) + (read (current-buffer)))))) (defvar canlock-read-passwd nil) (defun canlock-read-passwd (prompt &rest args) diff --git a/lisp/gnus-score.el b/lisp/gnus-score.el index ba7bd65..260dbce 100644 --- a/lisp/gnus-score.el +++ b/lisp/gnus-score.el @@ -2602,7 +2602,7 @@ GROUP using BNews sys file syntax." ;; too much. (delete-char (min (1- (point-max)) klen)) (goto-char (point-max)) - (if (search-backward (string directory-sep-char) nil t) + (if (re-search-backward gnus-directory-sep-char-regexp nil t) (delete-region (1+ (point)) (point-min)) (gnus-message 1 "Can't find directory separator in %s" (car sfiles)))) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 20e597f..0075f1f 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -1329,9 +1329,9 @@ These variables can be used to set variables in the group parameters while still allowing them to affect operations done in other buffers. For example: -(setq gnus-newsgroup-variables +(setq gnus-newsgroup-variables '(message-use-followup-to - (gnus-visible-headers . + (gnus-visible-headers . \"^From:\\\\|^Newsgroups:\\\\|^Subject:\\\\|^Date:\\\\|^To:\"))) ") @@ -6873,24 +6873,35 @@ If given a prefix, remove all limits." (gnus-summary-limit nil 'pop) (gnus-summary-position-point))) -(defun gnus-summary-limit-to-subject (subject &optional header) - "Limit the summary buffer to articles that have subjects that match a regexp." - (interactive "sLimit to subject (regexp): ") +(defun gnus-summary-limit-to-subject (subject &optional header not-matching) + "Limit the summary buffer to articles that have subjects that match a regexp. +If NOT-MATCHING, excluding articles that have subjects that match a regexp." + (interactive + (list (read-string (if current-prefix-arg + "Exclude subject (regexp): " + "Limit to subject (regexp): ")) + nil current-prefix-arg)) (unless header (setq header "subject")) (when (not (equal "" subject)) (prog1 (let ((articles (gnus-summary-find-matching - (or header "subject") subject 'all))) + (or header "subject") subject 'all nil nil + not-matching))) (unless articles (error "Found no matches for \"%s\"" subject)) (gnus-summary-limit articles)) (gnus-summary-position-point)))) -(defun gnus-summary-limit-to-author (from) - "Limit the summary buffer to articles that have authors that match a regexp." - (interactive "sLimit to author (regexp): ") - (gnus-summary-limit-to-subject from "from")) +(defun gnus-summary-limit-to-author (from &optional not-matching) + "Limit the summary buffer to articles that have authors that match a regexp. +If NOT-MATCHING, excluding articles that have authors that match a regexp." + (interactive + (list (read-string (if current-prefix-arg + "Exclude author (regexp): " + "Limit to author (regexp): ")) + current-prefix-arg)) + (gnus-summary-limit-to-subject from "from" not-matching)) (defun gnus-summary-limit-to-age (age &optional younger-p) "Limit the summary buffer to articles that are older than (or equal) AGE days. @@ -6930,25 +6941,31 @@ articles that are younger than AGE days." (gnus-summary-limit (nreverse articles))) (gnus-summary-position-point))) -(defun gnus-summary-limit-to-extra (header regexp) +(defun gnus-summary-limit-to-extra (header regexp &optional not-matching) "Limit the summary buffer to articles that match an 'extra' header." (interactive (let ((header (intern (gnus-completing-read (symbol-name (car gnus-extra-headers)) - "Limit extra header:" + (if current-prefix-arg + "Exclude extra header:" + "Limit extra header:") (mapcar (lambda (x) (cons (symbol-name x) x)) gnus-extra-headers) nil t)))) (list header - (read-string (format "Limit to header %s (regexp): " header))))) + (read-string (format "%s header %s (regexp): " + (if current-prefix-arg "Exclude" "Limit to") + header)) + current-prefix-arg))) (when (not (equal "" regexp)) (prog1 (let ((articles (gnus-summary-find-matching - (cons 'extra header) regexp 'all))) + (cons 'extra header) regexp 'all nil nil + not-matching))) (unless articles (error "Found no matches for \"%s\"" regexp)) (gnus-summary-limit articles)) @@ -7847,13 +7864,14 @@ fetched headers for, whether they are displayed or not." (nreverse articles))) (defun gnus-summary-find-matching (header regexp &optional backward unread - not-case-fold) + not-case-fold not-matching) "Return a list of all articles that match REGEXP on HEADER. The search stars on the current article and goes forwards unless BACKWARD is non-nil. If BACKWARD is `all', do all articles. If UNREAD is non-nil, only unread articles will be taken into consideration. If NOT-CASE-FOLD, case won't be folded -in the comparisons." +in the comparisons. If NOT-MATCHING, return a list of all articles that +not match REGEXP on HEADER." (let ((case-fold-search (not not-case-fold)) articles d func) (if (consp header) @@ -7874,8 +7892,12 @@ in the comparisons." (when (and (or (not unread) ; We want all articles... (gnus-data-unread-p d)) ; Or just unreads. (vectorp (gnus-data-header d)) ; It's not a pseudo. - (string-match regexp - (funcall func (gnus-data-header d)))) ; Match. + (if not-matching + (not (string-match + regexp + (funcall func (gnus-data-header d)))) + (string-match regexp + (funcall func (gnus-data-header d))))) (push (gnus-data-number d) articles))) ; Success! (nreverse articles))) diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index f22a062..9556f3e 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -1192,6 +1192,11 @@ sure of changing the value of `foo'." (defun gnus-not-ignore (&rest args) t) +(defvar gnus-directory-sep-char-regexp "/" + "The regexp of directory separator character. +If you find some problem with the directory separator character, try +\"[/\\\\\]\" for some systems.") + (provide 'gnus-util) ;;; gnus-util.el ends here diff --git a/lisp/message.el b/lisp/message.el index 02cbf71..82e3eb7 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1854,7 +1854,7 @@ Point is left at the beginning of the narrowed-to region." ;; ;; We use `after-change-functions' to keep special text properties ;; that interfer with the normal function of message mode out of the -;; buffer. +;; buffer. (defcustom message-strip-special-text-properties nil "Strip special properties from the message buffer. @@ -1868,13 +1868,13 @@ hope the message composition doesn't break too bad." :group 'message-various :type 'boolean) -(defconst message-forbidden-properties +(defconst message-forbidden-properties ;; No reason this should be clutter up customize. We make it a ;; property list (rather than a list of property symbols), to be ;; directly useful for `remove-text-properties'. - '(field nil read-only nil intangible nil invisible nil + '(field nil read-only nil intangible nil invisible nil mouse-face nil modification-hooks nil insert-in-front-hooks nil - insert-behind-hooks nil point-entered nil point-left nil) + insert-behind-hooks nil point-entered nil point-left nil) ;; Other special properties: ;; category, face, display: probably doesn't do any harm. ;; fontified: is used by font-lock. @@ -4858,13 +4858,7 @@ than 988 characters long, and if they are not, trim them until they are." headers) nil switch-function yank-action actions))))) -;;;(defvar mc-modes-alist) (defun message-setup-1 (headers &optional replybuffer actions) -;;; (when (and (boundp 'mc-modes-alist) -;;; (not (assq 'message-mode mc-modes-alist))) -;;; (push '(message-mode (encrypt . mc-encrypt-message) -;;; (sign . mc-sign-message)) -;;; mc-modes-alist)) (dolist (action actions) (condition-case nil (add-to-list 'message-send-actions @@ -5519,7 +5513,7 @@ header line with the old Message-ID." "Remove junk like \"Re:\", \"(fwd)\", etc. added to subject string SUBJECT. Previous forwarders, replyers, etc. may add it." (with-temp-buffer - (insert-string subject) + (insert subject) (goto-char (point-min)) ;; strip Re/Fwd stuff off the beginning (while (re-search-forward diff --git a/lisp/mm-bodies.el b/lisp/mm-bodies.el index 1cb753d..19cd5a4 100644 --- a/lisp/mm-bodies.el +++ b/lisp/mm-bodies.el @@ -131,6 +131,8 @@ If no encoding was done, nil is returned." (defun mm-body-encoding (charset &optional encoding) "Do Content-Transfer-Encoding and return the encoding of the current buffer." + (when (stringp encoding) + (setq encoding (intern (downcase encoding)))) (let ((bits (mm-body-7-or-8)) (longp (mm-long-lines-p 1000))) (require 'message) diff --git a/lisp/mm-encode.el b/lisp/mm-encode.el index b56c569..98edfe8 100644 --- a/lisp/mm-encode.el +++ b/lisp/mm-encode.el @@ -106,7 +106,7 @@ This variable should never be set directly, but bound before a call to ((functionp encoding) (ignore-errors (funcall encoding (point-min) (point-max)))) (t - (message "Unknown encoding %s; defaulting to 8bit" encoding)))) + (message "Unknown encoding %s; treating it as 8bit" encoding)))) (defun mm-encode-buffer (type) "Encode the buffer which contains data of TYPE. diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 3e09ae7..42a0e5c 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -280,7 +280,7 @@ outgoing mails (see `sort-coding-systems'). If this variable is set, it overrides the default priority. For example, Japanese users may prefer iso-2022-jp to japanese-shift-jis: -(setq mm-coding-system-priorities +\(setq mm-coding-system-priorities '(iso-2022-jp iso-2022-jp-2 japanese-shift-jis utf-8)) ") diff --git a/texi/ChangeLog b/texi/ChangeLog index fc19d0b..3655031 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,7 @@ +2001-11-25 09:00:00 ShengHuo ZHU + + * gnus.texi (Limiting): Addition. + 2001-11-19 Simon Josefsson * message.texi (Header Commands, Insertion): Use C-c C-f C-i for diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index a2e45fa..f0cbbe7 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -5786,19 +5786,22 @@ gnus $B<+BN$O2D;k5-;v$r4|8B@Z$l>C5n$7$^$;$s(B) $B$N$G!"1J1s$K5-;v$rJ]B8$7$F$* @kindex / / ($B35N,(B) @findex gnus-summary-limit-to-subject $B35N,%P%C%U%!$r$$$/$D$+$NI=Bj$H9gCW$9$k$b$N$@$1$K@)8B$7$^(B -$B$9(B (@code{gnus-summary-limit-to-subject})$B!#(B +$B$9(B (@code{gnus-summary-limit-to-subject})$B!#$b$7@\F,<-$,M?$($i$l$l$P!"9g(B +$BCW$9$k5-;v$r=|30$7$^$9!#(B @item / a @kindex / a ($B35N,(B) @findex gnus-summary-limit-to-author $B35N,%P%C%U%!$r2??M$+$NCx. + +* Investigate the memory usage of Gnus. + + But it does seem strange that Gnus would use some 15meg for this. I + think that is worth investigating. I suspect that bugs or bad + design are causing waste; they could be in Gnus, or in Emacs. -- RMS + * Google group digest The result of Google group search return a thread. Is it a digest -- 1.7.10.4