From 8b9c89d0e964223d4ccfe68daae67a02a9879344 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 14 May 2001 11:41:14 +0000 Subject: [PATCH] * lisp/gnus-vers.el (gnus-revision-number): Increment to 01. * lisp/nnmail.el: Don't bind the colon keywords here. * lisp/gnus.el (gnus-colon-keywords): New variable which will default to the value of `dgnushack-colon-keywords'; bind them. * lisp/dgnushack.el (dgnushack-unexporting-files): Add dgnuskwds.el. (dgnushack-colon-keywords): New constant which will have the colon keywords shuld be bound at run-time for old Emacsen; cache them in the file dgnuskwds.el and bind them. (locate-library): Make the function to be silent for Mule. * lisp/Makefile.in (clean): Remove dgnuskwds.el. --- ChangeLog | 15 ++++++ lisp/Makefile.in | 2 +- lisp/dgnushack.el | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++--- lisp/gnus-vers.el | 2 +- lisp/gnus.el | 18 +++---- lisp/nnmail.el | 9 ---- 6 files changed, 173 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a7b77c..7d6dd5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2001-05-14 Katsumi Yamaoka + + * lisp/gnus-vers.el (gnus-revision-number): Increment to 01. + + * lisp/nnmail.el: Don't bind the colon keywords here. + * lisp/gnus.el (gnus-colon-keywords): New variable which will + default to the value of `dgnushack-colon-keywords'; bind them. + * lisp/dgnushack.el (dgnushack-unexporting-files): Add + dgnuskwds.el. + (dgnushack-colon-keywords): New constant which will have the colon + keywords shuld be bound at run-time for old Emacsen; cache them in + the file dgnuskwds.el and bind them. + (locate-library): Make the function to be silent for Mule. + * lisp/Makefile.in (clean): Remove dgnuskwds.el. + 2001-05-07 Katsumi Yamaoka * lisp/message.el (message-maybe-encode): Don't use diff --git a/lisp/Makefile.in b/lisp/Makefile.in index b3d796a..6e7da4c 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -101,7 +101,7 @@ gnus-load.elc: clean: rm -f *.orig *.rej *.elc *~ \ - auto-autoloads.el custom-load.el gnus-load.el + auto-autoloads.el custom-load.el gnus-load.el dgnuskwds.el distclean: clean rm -f Makefile dgnuspath.el diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index 07d4ff7..33bb100 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -176,14 +176,155 @@ Try to re-configure with --with-addpath=FLIM_PATH and run make again. byte-compile-function-environment))) form) +(when (boundp 'MULE) + (let (current-load-list) + ;; Make the function to be silent at compile-time. + (defun locate-library (library &optional nosuffix) + "Show the full path name of Emacs library LIBRARY. +This command searches the directories in `load-path' like `M-x load-library' +to find the file that `M-x load-library RET LIBRARY RET' would load. +Optional second arg NOSUFFIX non-nil means don't add suffixes `.elc' or `.el' +to the specified name LIBRARY (a la calling `load' instead of `load-library')." + (interactive "sLocate library: ") + (catch 'answer + (mapcar + '(lambda (dir) + (mapcar + '(lambda (suf) + (let ((try (expand-file-name (concat library suf) dir))) + (and (file-readable-p try) + (null (file-directory-p try)) + (progn + (or noninteractive + (message "Library is file %s" try)) + (throw 'answer try))))) + (if nosuffix '("") '(".elc" ".el" "")))) + load-path) + (or noninteractive + (message "No library %s in search path" library)) + nil)) + (byte-compile 'locate-library))) + (condition-case nil :symbol-for-testing-whether-colon-keyword-is-available-or-not (void-variable - ;; Bind keywords. - (dolist (keyword '(:button-keymap :data :file :mime-handle - :key-type :value-type - :ascent :foreground :help)) - (set keyword keyword)))) + (defun dgnushack-bind-colon-keywords () + "Bind all the colon keywords for old Emacsen." + (let ((cache (expand-file-name "dgnuskwds.el" srcdir)) + (makefile (expand-file-name "Makefile" srcdir)) + (buffer (get-buffer-create " *colon keywords*")) + keywords ignores files file dirs dir form elem make-backup-files) + (save-excursion + (set-buffer buffer) + (let (buffer-file-format + format-alist + insert-file-contents-post-hook + insert-file-contents-pre-hook + jam-zcat-filename-list + jka-compr-compression-info-list) + (if (and (file-exists-p cache) + (file-exists-p makefile) + (file-newer-than-file-p cache makefile)) + (progn + (insert-file-contents cache nil nil nil t) + (setq keywords (read buffer))) + (setq + ignores + '(:symbol-for-testing-whether-colon-keyword-is-available-or-not + ;; The following keywords will be bound by CUSTOM. + :get :group :initialize :link :load :options :prefix + :require :set :tag :type) + files (list (locate-library "semi-def") + (locate-library "mailcap") + (locate-library "mime-def") + (locate-library "path-util") + (locate-library "poem")) + dirs (list (file-name-as-directory (expand-file-name srcdir)))) + (while files + (when (setq file (pop files)) + (setq dir (file-name-directory file)) + (unless (member dir dirs) + (push dir dirs)))) + (message "Searching for all the colon keywords in:") + (while dirs + (setq dir (pop dirs)) + (message " %s..." dir) + (setq files (directory-files dir t + "\\.el\\(\\.gz\\|\\.bz2\\)?$")) + (while files + (setq file (pop files)) + (if (string-match "\\(\\.gz$\\)\\|\\.bz2$" file) + (let ((temp (expand-file-name "dgnustemp.el" srcdir))) + (when + (let* ((binary (if (boundp 'MULE) + '*noconv* + 'binary)) + (coding-system-for-read binary) + (coding-system-for-write binary) + (input-coding-system binary) + (output-coding-system binary) + (default-process-coding-system + (cons binary binary)) + call-process-hook) + (insert-file-contents file nil nil nil t) + (when + (condition-case code + (progn + (if (match-beginning 1) + (call-process-region + (point-min) (point-max) + "gzip" t buffer nil "-cd") + (call-process-region + (point-min) (point-max) + "bzip2" t buffer nil "-d")) + t) + (error + (erase-buffer) + (message "In file %s: %s" file code) + nil)) + (write-region (point-min) (point-max) temp + nil 'silent) + t)) + (unwind-protect + (insert-file-contents temp nil nil nil t) + (delete-file temp)))) + (insert-file-contents file nil nil nil t)) + (while (setq form (condition-case nil + (read buffer) + (error nil))) + (while form + (setq elem (pop form)) + (unless (memq (car-safe elem) + '(\` backquote defcustom define-widget + quote widget-convert-button + widget-create widget-put)) + (while (consp elem) + (push (car elem) form) + (setq elem (cdr elem))) + (when (and elem + (symbolp elem) + (not (eq ': elem)) + (eq ?: (aref (symbol-name elem) 0)) + (not (memq elem ignores)) + (not (memq elem keywords))) + (push elem keywords))))))) + (setq keywords (sort keywords + (lambda (a b) + (string-lessp (symbol-name a) + (symbol-name b))))) + (erase-buffer) + (insert (format "%s" keywords)) + (write-region (point-min) (point) cache nil 'silent) + (message + "The following colon keywords will be bound at run-time:\n %s" + keywords)))) + (kill-buffer buffer) + (defconst dgnushack-colon-keywords keywords) + (while keywords + (set (car keywords) (car keywords)) + (setq keywords (cdr keywords))))) + (byte-compile 'dgnushack-bind-colon-keywords) + (dgnushack-bind-colon-keywords))) ;; If you are using Mule 2.3 based on Emacs 19.34, you may also put the ;; following lines in your .emacs file, before gnus related modules are @@ -263,7 +404,7 @@ Try to re-configure with --with-addpath=FLIM_PATH and run make again. (defalias 'define-mail-user-agent 'ignore) (defconst dgnushack-unexporting-files - (append '("dgnushack.el" "dgnuspath.el" "lpath.el") + (append '("dgnushack.el" "dgnuspath.el" "dgnuskwds.el" "lpath.el") (unless (or (condition-case code (require 'w3-forms) (error diff --git a/lisp/gnus-vers.el b/lisp/gnus-vers.el index 3fd3e96..84cc3ee 100644 --- a/lisp/gnus-vers.el +++ b/lisp/gnus-vers.el @@ -34,7 +34,7 @@ (require 'product) (provide 'gnus-vers) -(defconst gnus-revision-number "00" +(defconst gnus-revision-number "01" "Revision number for this version of gnus.") ;; Product information of this gnus. diff --git a/lisp/gnus.el b/lisp/gnus.el index 4f4dca2..72b9a5b 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -893,15 +893,15 @@ For example: (defvar gnus-group-parameters-more nil) -(condition-case nil - :symbol-for-testing-whether-colon-keyword-is-available-or-not - (void-variable - ;; Bind keywords. - (dolist (keyword '(:parameter-type - :parameter-document :function :function-document - :variable :variable-document :variable-group - :variable-type :variable-default)) - (set keyword keyword)))) +(defvar gnus-colon-keywords + (eval-when-compile + (when (boundp 'dgnushack-colon-keywords) + (symbol-value 'dgnushack-colon-keywords))) + "List of the colon keywords should be bound at run-time. This variable +defaults to a proper value only if this file is byte-compiled by make.") + +(dolist (keyword gnus-colon-keywords) + (set keyword keyword)) (defmacro gnus-define-group-parameter (param &rest rest) "Define a group parameter PARAM. diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 939d853..227f61c 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -38,15 +38,6 @@ (autoload 'gnus-error "gnus-util") (autoload 'gnus-buffer-live-p "gnus-util")) -(eval-when-compile (require 'static)) - -(static-condition-case nil - :symbol-for-testing-whether-colon-keyword-is-available-or-not - (void-variable - (defconst :user ':user) - (defconst :path ':path) - (defconst :predicate ':predicate))) - (defgroup nnmail nil "Reading mail with Gnus." :group 'gnus) -- 1.7.10.4