From 4887fff915a27fe13c6aed50d5a68ae3704aeb6c Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 9 Oct 2001 01:11:51 +0000 Subject: [PATCH] Synch with Oort Gnus. --- ChangeLog | 6 +++++ GNUS-NEWS | 6 +++++ Makefile.in | 5 ++++ etc/Makefile.in | 13 ++++++++++ lisp/ChangeLog | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++ lisp/Makefile.in | 2 +- lisp/gnus-art.el | 28 ++++++++++++++++++--- lisp/gnus-group.el | 19 ++++++++------ lisp/gnus-msg.el | 8 +++++- lisp/gnus-srvr.el | 2 +- lisp/gnus-sum.el | 14 ++++++----- lisp/gnus-util.el | 8 ++++++ lisp/message.el | 21 ++++++++++++---- lisp/nnfolder.el | 3 ++- lisp/nnheader.el | 18 ++++++++++--- lisp/rfc2047.el | 33 ++++++++++++++++-------- texi/ChangeLog | 9 +++++++ texi/Makefile.in | 18 ++++++++++++- 18 files changed, 242 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index df56309..308b592 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-10-06 08:00:00 ShengHuo ZHU + + * Makefile.in (uninstall): Add. + + * etc/Makefile.in (uninstall): Add. + 2001-10-04 Katsumi Yamaoka * lisp/message.el (message-fix-before-sending): Don't expose diff --git a/GNUS-NEWS b/GNUS-NEWS index 8f63ecb..2ff520f 100644 --- a/GNUS-NEWS +++ b/GNUS-NEWS @@ -8,6 +8,12 @@ For older news, see Gnus info node "New Features". * Changes in Oort Gnus +** Group names are treated as UTF-8 by default. + +This is supposedly what USEFOR wants to migrate to. See +`gnus-group-name-charset-group-alist' and +`gnus-group-name-charset-method-alist' for customization. + ** The nnml and nnfolder backends store marks for each groups. This makes it possible to take backup of nnml/nnfolder servers/groups diff --git a/Makefile.in b/Makefile.in index 687a288..9ad496c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -145,6 +145,11 @@ xinfo: xinfo-ja: cd texi && $(MAKE) EMACS="$(XEMACS)" ja-info +uninstall: + cd lisp && $(MAKE) lispdir="$(lispdir)" uninstall + cd texi && $(MAKE) uninstall + cd etc && $(MAKE) uninstall + # Rule for Lars and nobody else. some: cd lisp && $(MAKE) EMACS="$(EMACS)" some diff --git a/etc/Makefile.in b/etc/Makefile.in index f81c462..a552a89 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -35,6 +35,19 @@ install: $(INSTALL_DATA) $$p $(etcdir)/$$p; \ done +uninstall: + rm -f $(etcdir)/gnus-tut.txt + cd $(srcdir) \ + && for p in gnus/*.xpm gnus/*.pbm gnus/*.xbm gnus/x-splash; do \ + rm -f "$(etcdir)/$$p"; \ + done + rmdir $(etcdir)/gnus 2> /dev/null || true + cd $(srcdir) \ + && for p in smilies/*.pbm; do \ + rm -f "$(etcdir)/$$p"; \ + done + rmdir $(etcdir)/smilies 2> /dev/null || true + Makefile: $(srcdir)/Makefile.in ../config.status cd .. \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0718ea..ffb7215 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,74 @@ +2001-10-07 15:00:00 ShengHuo ZHU + + * Makefile.in (install-el): Depend on gnus-load.el. + +2001-10-07 13:00:00 ShengHuo ZHU + + * Makefile.in (install-el): Use -f. + From: Amos Gouaux + +2001-10-07 Per Abrahamsen + + * message.el (message-send-news): Don't encode Followups-To when + gnus-group-name-charset-group-alist is ".*". [Yuck] + + * gnus-util.el (gnus-decode-newsgroups): No space in newsgroup + header. + + * gnus-art.el (article-decode-group-name): Also decode + "Followup-To". + + * rfc2047.el (rfc2047-encode-message-header): Encode without + asking for null methods. + + * gnus-group.el (gnus-group-name-charset-group-alist): Make utf-8 + default charset for newsgroup names in accordance with USEFOR. + + * gnus-group.el (gnus-group-name-charset-method-alist, + gnus-group-name-charset-group-alist): Removed "*" from doc + strings, "*" should not be used for complex variables. + +2001-10-06 Simon Josefsson + + Support UTF-8 group names better. + + * message.el (message-check-news-header-syntax): Encode group + names before comparison. + + * gnus-msg.el (gnus-copy-article-buffer): Run all + `gnus-article-decode-hook's except `article-decode-charset' + instead of hardcoding call to one of them. + + * gnus-art.el (gnus-article-decode-hook): Add + `article-decode-group-name'. + (article-decode-group-name): New function, use `g-d-n'. + + * gnus-group.el (gnus-group-insert-group-line): Decode + gnus-tmp-group using `g-d-n'. + + * gnus-util.el (gnus-decode-newsgroups): New function. + +2001-10-06 Per Abrahamsen + + * gnus-srvr.el (gnus-browse-foreign-server): Fixed bug non-nil + 'gnus-group-name-charset-group-alist'. + +2001-10-06 08:00:00 ShengHuo ZHU + + * Makefile.in: Install el in install. Add uninstall. + +2001-10-05 Simon Josefsson + + * nnheader.el (gnus-verbose-backends, gnus-nov-is-evil): Custom. + + * gnus-sum.el (gnus-summary-move-article): Also activate new groups. + + * nnfolder.el (nnfolder-normalize-buffer): Don't insert \n\n in + empty folders. + + * gnus-sum.el (gnus-select-newsgroup): Don't enable `display' + limiting if read-all (C-u RET) was used. + 2001-10-04 Simon Josefsson * mail-source.el (mail-source-movemail-program): New variable. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 0bac6c5..0934d58 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -98,7 +98,7 @@ separately: pot: xpot -drgnus -r`cat ./version` *.el > rgnus.pot -gnus-load.elc: +gnus-load.el gnus-load.elc: $(EMACS_COMP) -f dgnushack-make-cus-load $(srcdir) $(EMACS_COMP) -f dgnushack-make-auto-load $(srcdir) $(EMACS_COMP) -f dgnushack-make-load diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index bdc81ed..042e48b 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -686,7 +686,7 @@ displayed by the first non-nil matching CONTENT face." (item :tag "skip" nil) (face :value default))))) -(defcustom gnus-article-decode-hook nil +(defcustom gnus-article-decode-hook '(article-decode-group-name) "*Hook run to decode charsets in articles." :group 'gnus-article-headers :type 'hook) @@ -1916,8 +1916,30 @@ If PROMPT (the prefix), prompt for a coding system to use." (let ((charset (save-excursion (set-buffer gnus-summary-buffer) default-mime-charset))) - (mime-decode-header-in-buffer charset) - ))) + (mime-decode-header-in-buffer charset)))) + +(defun article-decode-group-name () + "Decode group names in `Newsgroups:'." + (let ((inhibit-point-motion-hooks t) + buffer-read-only + (method (gnus-find-method-for-group gnus-newsgroup-name))) + (when (and (or gnus-group-name-charset-method-alist + gnus-group-name-charset-group-alist) + (gnus-buffer-live-p gnus-original-article-buffer)) + (when (mail-fetch-field "Newsgroups") + (nnheader-replace-header "Newsgroups" + (gnus-decode-newsgroups + (with-current-buffer + gnus-original-article-buffer + (mail-fetch-field "Newsgroups")) + gnus-newsgroup-name method))) + (when (mail-fetch-field "Followup-To") + (nnheader-replace-header "Followup-To" + (gnus-decode-newsgroups + (with-current-buffer + gnus-original-article-buffer + (mail-fetch-field "Followup-To")) + gnus-newsgroup-name method)))))) (defun article-de-quoted-unreadable (&optional force read-charset) "Translate a quoted-printable-encoded article. diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 16cc279..d00e394 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -403,21 +403,22 @@ ticked: The number of ticked articles." :type '(repeat (cons (sexp :tag "Form") file))) (defcustom gnus-group-name-charset-method-alist nil - "*Alist of method and the charset for group names. + "Alist of method and the charset for group names. For example: - (((nntp \"news.com.cn\") . cn-gb-2312)) -" + (((nntp \"news.com.cn\") . cn-gb-2312))" :version "21.1" :group 'gnus-charset :type '(repeat (cons (sexp :tag "Method") (symbol :tag "Charset")))) -(defcustom gnus-group-name-charset-group-alist nil - "*Alist of group regexp and the charset for group names. +(defcustom gnus-group-name-charset-group-alist + (if (and (fboundp 'coding-system-p) (coding-system-p 'utf-8)) + '((".*" . utf-8)) + nil) + "Alist of group regexp and the charset for group names. For example: - ((\"\\.com\\.cn:\" . cn-gb-2312)) -" + ((\"\\.com\\.cn:\" . cn-gb-2312))" :group 'gnus-charset :type '(repeat (cons (regexp :tag "Group") (symbol :tag "Charset")))) @@ -1349,7 +1350,9 @@ if it is a string, only list groups matching REGEXP." (point) (prog1 (1+ (point)) ;; Insert the text. - (eval gnus-group-line-format-spec)) + (let ((gnus-tmp-group (gnus-group-name-decode + gnus-tmp-group group-name-charset))) + (eval gnus-group-line-format-spec))) `(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb) gnus-unread ,(if (numberp number) (string-to-int gnus-tmp-number-of-unread) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index ad49ee2..0e1c853 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -631,7 +631,13 @@ header line with the old Message-ID." (or (message-goto-body) (point-max))) ;; Insert the original article headers. (insert-buffer-substring gnus-original-article-buffer beg end) - (article-decode-encoded-words)))) + ;; Decode charsets. + (let ((gnus-article-decode-hook + (delq 'article-decode-charset gnus-article-decode-hook))) + ;; Needed for T-gnus. + (add-hook 'gnus-article-decode-hook + 'article-decode-encoded-words) + (run-hooks 'gnus-article-decode-hook))))) gnus-article-copy))) (defun gnus-post-news (post &optional group header article-buffer yank subject diff --git a/lisp/gnus-srvr.el b/lisp/gnus-srvr.el index 09eac06..e5179a6 100644 --- a/lisp/gnus-srvr.el +++ b/lisp/gnus-srvr.el @@ -729,7 +729,7 @@ The following commands are available: (let ((buffer-read-only nil) charset) (while groups (setq group (car groups)) - (setq charset (gnus-group-name-charset method group)) + (setq charset (gnus-group-name-charset method (car group))) (gnus-add-text-properties (point) (prog1 (1+ (point)) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 2441e5b..82613a0 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -4567,6 +4567,10 @@ If SELECT-ARTICLES, only select those articles from GROUP." (let ((display (gnus-group-find-parameter group 'display))) (setq gnus-newsgroup-display (cond + ((not (zerop (or (car-safe read-all) 0))) + ;; The user entered the group with C-u SPC/RET, let's show + ;; all articles. + 'gnus-not-ignore) ((eq display 'all) 'gnus-not-ignore) ((arrayp display) @@ -8330,12 +8334,10 @@ ACTION can be either `move' (the default), `crosspost' or `copy'." (gnus-summary-mark-article article gnus-canceled-mark)))) (gnus-summary-remove-process-mark article)) ;; Re-activate all groups that have been moved to. - (while to-groups - (save-excursion - (set-buffer gnus-group-buffer) - (when (gnus-group-goto-group (car to-groups) t) - (gnus-group-get-new-news-this-group 1 t)) - (pop to-groups))) + (save-excursion + (set-buffer gnus-group-buffer) + (let ((gnus-group-marked to-groups)) + (gnus-group-get-new-news-this-group nil t))) (gnus-kill-buffer copy-buf) (gnus-summary-position-point) diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index c5a04ec..fdf0c08 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -213,6 +213,14 @@ (search-forward ":" eol t) (point))))) +(defun gnus-decode-newsgroups (newsgroups group &optional method) + (let ((method (or method (gnus-find-method-for-group group)))) + (mapconcat (lambda (group) + (gnus-group-name-decode group (gnus-group-name-charset + method group))) + (message-tokenize-header newsgroups) + ","))) + (defun gnus-remove-text-with-property (prop) "Delete all text in the current buffer with text property PROP." (save-excursion diff --git a/lisp/message.el b/lisp/message.el index 43f1068..207d888 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -3281,6 +3281,12 @@ This sub function is for exclusive use of `message-send-news'." (method (if (message-functionp message-post-method) (funcall message-post-method arg) message-post-method)) + ;; BUG: We need to get the charset for each name in the + ;; Newsgroups and Followup-To lines. Using the empty string + ;; "works" with the a default value of ".*" for + ;; 'gnus-group-name-charset-group-alist', but not anything + ;; more specifik. + ;; -- Par Abrahamsen 2001-10-07. (group-name-charset (gnus-group-name-charset method "")) (message-syntax-checks (if arg @@ -3295,6 +3301,8 @@ This sub function is for exclusive use of `message-send-news'." (message-generate-headers message-required-news-headers) ;; Let the user do all of the above. (run-hooks 'message-header-hook)) + ;; Note: This check will be disabled by the ".*" default value for + ;; gnus-group-name-charset-group-alist. -- Pa 2001-10-07. (when group-name-charset (setq message-syntax-checks (cons '(valid-newsgroups . disabled) @@ -3482,12 +3490,15 @@ This sub function is for exclusive use of `message-send-news'." (if followup-to (concat newsgroups "," followup-to) newsgroups))) + (method (if (message-functionp message-post-method) + (funcall message-post-method) + message-post-method)) (known-groups - (mapcar (lambda (n) (gnus-group-real-name n)) - (gnus-groups-from-server - (if (message-functionp message-post-method) - (funcall message-post-method) - message-post-method)))) + (mapcar (lambda (n) + (gnus-group-name-decode + (gnus-group-real-name n) + (gnus-group-name-charset method n))) + (gnus-groups-from-server method))) errors) (while groups (unless (or (equal (car groups) "poster") diff --git a/lisp/nnfolder.el b/lisp/nnfolder.el index ac604ea..28b0f4f 100644 --- a/lisp/nnfolder.el +++ b/lisp/nnfolder.el @@ -792,7 +792,8 @@ deleted. Point is left where the deleted region was." (goto-char (point-max)) (skip-chars-backward "\n") (delete-region (point) (point-max)) - (insert "\n\n")) + (unless (bobp) + (insert "\n\n"))) (defun nnfolder-insert-newsgroup-line (group-art) (save-excursion diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 466d701..b13bf19 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -51,6 +51,20 @@ (autoload 'gnus-intersection "gnus-range") (autoload 'gnus-sorted-complement "gnus-range")) +(defcustom gnus-verbose-backends 7 + "Integer that says how verbose the Gnus backends should be. +The higher the number, the more messages the Gnus backends will flash +to say what it's doing. At zero, the Gnus backends will be totally +mute; at five, they will display most important messages; and at ten, +they will keep on jabbering all the time." + :group 'gnus-start + :type 'integer) + +(defcustom gnus-nov-is-evil nil + "If non-nil, Gnus backends will never output headers in the NOV format." + :group 'gnus-server + :type 'boolean) + (defvar nnheader-max-head-length 4096 "*Max length of the head of articles. @@ -680,10 +694,6 @@ list of headers that match SEQUENCE (see `nntp-retrieve-headers')." (defvar nntp-server-buffer nil) (defvar nntp-process-response nil) -(defvar gnus-verbose-backends 7 - "*A number that says how talkative the Gnus backends should be.") -(defvar gnus-nov-is-evil nil - "If non-nil, Gnus backends will never output headers in the NOV format.") (defvar news-reply-yank-from nil) (defvar news-reply-yank-message-id nil) diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index 71ac476..fe63a60 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -165,18 +165,29 @@ Should be called narrowed to the head of the message." mail-parse-charset) (mm-encode-coding-region (point-min) (point-max) mail-parse-charset))) + ;; We get this when CC'ing messsages to newsgroups with + ;; 8-bit names. The group name mail copy just get + ;; unconditionally encoded. Previously, it would ask + ;; whether to encode, which was quite confusing for the + ;; user. If the new behaviour is wrong, tell me. I have + ;; left the old code commented out below. + ;; -- Per Abrahamsen Date: 2001-10-07. ((null method) - (and (delq 'ascii - (mm-find-charset-region (point-min) - (point-max))) - (if (or (message-options-get - 'rfc2047-encode-message-header-encode-any) - (message-options-set - 'rfc2047-encode-message-header-encode-any - (y-or-n-p - "Some texts are not encoded. Encode anyway?"))) - (rfc2047-encode-region (point-min) (point-max)) - (error "Cannot send unencoded text")))) + (when (delq 'ascii + (mm-find-charset-region (point-min) (point-max))) + (rfc2047-encode-region (point-min) (point-max)))) +;;; ((null method) +;;; (and (delq 'ascii +;;; (mm-find-charset-region (point-min) +;;; (point-max))) +;;; (if (or (message-options-get +;;; 'rfc2047-encode-message-header-encode-any) +;;; (message-options-set +;;; 'rfc2047-encode-message-header-encode-any +;;; (y-or-n-p +;;; "Some texts are not encoded. Encode anyway?"))) +;;; (rfc2047-encode-region (point-min) (point-max)) +;;; (error "Cannot send unencoded text")))) ((mm-coding-system-p method) (if (and (featurep 'mule) (if (boundp 'default-enable-multibyte-characters) diff --git a/texi/ChangeLog b/texi/ChangeLog index 8325cb7..78e113a 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,12 @@ +2001-10-06 08:00:00 ShengHuo ZHU + + * Makefile.in (uninstall): Add uninstall. + +2001-10-05 Simon Josefsson + + * Makefile.in (clean): Add gnusconfig.tex. Suggested by Henrik + Enberg . + 2001-10-04 Simon Josefsson * gnus.texi (Mail Source Customization): Add. diff --git a/texi/Makefile.in b/texi/Makefile.in index e57d882..e038a53 100644 --- a/texi/Makefile.in +++ b/texi/Makefile.in @@ -99,7 +99,7 @@ clean: gnus.ilg gnus.ind gnus.[cgk]ind gnus.idx \ gnustmp.texi *.tmplatexi gnus.tmplatexi1 texput.log *.orig *.rej \ gnus.latexi*~* xface.tex picons.tex smiley.tex *.latexi *.dvi-x \ - *.pdf-x + *.pdf-x gnusconfig.tex makeinfo: makeinfo -o gnus gnus.texi @@ -220,6 +220,22 @@ install: $(INFO_DEPS) done; \ else : ; fi +uninstall: + @list='$(INFO_DEPS)'; \ + list=$$list' $(INFO_DEPS_JA) $(INFO_DEPS_INFO) $(INFO_DEPS_JA_INFO)'; \ + for file in $$list; do \ + for ifile in `echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ + rm -f $(infodir)/$$ifile; \ + done; \ + done + @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + echo " install-info --delete --info-dir=$(infodir) $(infodir)/$$file";\ + install-info --delete --info-dir=$(infodir) $(infodir)/$$file || :;\ + done; \ + else : ; fi + install-ja: $(INFO_DEPS_JA) $(MAKE) INFO_DEPS='$(INFO_DEPS_JA)' EMACS="$(EMACS)" \ infodir="$(infodir)" install -- 1.7.10.4