+ (gnus-xmas-redefine))
+
+ ((featurep 'mule)
+ ;; Mule and new Emacs definitions
+
+ ;; [Note] Now there are three kinds of mule implementations,
+ ;; original MULE, XEmacs/mule and beta version of Emacs including
+ ;; some mule features. Unfortunately these API are different. In
+ ;; particular, Emacs (including original MULE) and XEmacs are
+ ;; quite different.
+ ;; Predicates to check are following:
+ ;; (boundp 'MULE) is t only if MULE (original; anything older than
+ ;; Mule 2.3) is running.
+ ;; (featurep 'mule) is t when every mule variants are running.
+
+ ;; These implementations may be able to share between original
+ ;; MULE and beta version of new Emacs. In addition, it is able to
+ ;; detect XEmacs/mule by (featurep 'mule) and to check variable
+ ;; `emacs-version'. In this case, implementation for XEmacs/mule
+ ;; may be able to share between XEmacs and XEmacs/mule.
+
+ (defvar gnus-summary-display-table nil
+ "Display table used in summary mode buffers.")
+ (fset 'gnus-max-width-function 'gnus-mule-max-width-function)
+ (fset 'gnus-summary-set-display-table (lambda ()))
+
+ (when (boundp 'gnus-check-before-posting)
+ (setq gnus-check-before-posting
+ (delq 'long-lines
+ (delq 'control-chars gnus-check-before-posting))))
+
+ (defun gnus-summary-line-format-spec ()
+ (insert gnus-tmp-unread gnus-tmp-replied
+ gnus-tmp-score-char gnus-tmp-indentation)
+ (put-text-property
+ (point)
+ (progn
+ (insert
+ gnus-tmp-opening-bracket
+ (format "%4d: %-20s"
+ gnus-tmp-lines
+ (if (> (length gnus-tmp-name) 20)
+ (truncate-string-to-width gnus-tmp-name 20)
+ gnus-tmp-name))
+ gnus-tmp-closing-bracket)
+ (point))
+ gnus-mouse-face-prop gnus-mouse-face)
+ (insert " " gnus-tmp-subject-or-nil "\n"))
+ )))
+
+(defun gnus-region-active-p ()
+ "Say whether the region is active."
+ (and (boundp 'transient-mark-mode)
+ transient-mark-mode
+ (boundp 'mark-active)
+ mark-active))
+
+(defun gnus-add-minor-mode (mode name map)
+ (if (fboundp 'add-minor-mode)
+ (add-minor-mode mode name map)
+ (set (make-local-variable mode) t)
+ (unless (assq mode minor-mode-alist)
+ (push `(,mode ,name) minor-mode-alist))
+ (unless (assq mode minor-mode-map-alist)
+ (push (cons mode map)
+ minor-mode-map-alist))))
+
+(defun gnus-x-splash ()
+ "Show a splash screen using a pixmap in the current buffer."
+ (let ((dir (nnheader-find-etc-directory "gnus"))
+ pixmap file height beg i)
+ (save-excursion
+ (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer))
+ (let ((buffer-read-only nil))
+ (erase-buffer)
+ (when (and dir
+ (file-exists-p (setq file (concat dir "x-splash"))))
+ (with-temp-buffer
+ (insert-file-contents file)
+ (goto-char (point-min))
+ (ignore-errors
+ (setq pixmap (read (current-buffer))))))
+ (when pixmap
+ (unless (facep 'gnus-splash)
+ (make-face 'gnus-splash))
+ (setq height (/ (car pixmap) (frame-char-height))
+ width (/ (cadr pixmap) (frame-char-width)))
+ (set-face-foreground 'gnus-splash "Brown")
+ (set-face-stipple 'gnus-splash pixmap)
+ (insert-char ?\n (* (/ (window-height) 2 height) height))
+ (setq i height)
+ (while (> i 0)
+ (insert-char ? (* (/ (window-width) 2 width) width))
+ (setq beg (point))
+ (insert-char ? width)
+ (set-text-properties beg (point) '(face gnus-splash))
+ (insert "\n")
+ (decf i))
+ (goto-char (point-min))
+ (sit-for 0))))))