X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-ems.el;h=62c26952005c383c358fcd8a663ced016fa4a93d;hb=f4ab76dd129c9a39ced89798be7da47ea4065365;hp=365154cb4b8d05f15eae78ac154165f61e81aefd;hpb=7db65818baa58fbf633f219f9dead3c247217a3b;p=gnus diff --git a/lisp/gnus-ems.el b/lisp/gnus-ems.el index 365154cb4..62c269520 100644 --- a/lisp/gnus-ems.el +++ b/lisp/gnus-ems.el @@ -1,5 +1,5 @@ ;;; gnus-ems.el --- functions for making Gnus work under different Emacsen -;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 +;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen @@ -26,20 +26,18 @@ ;;; Code: -(eval-when-compile (require 'cl)) +(eval-when-compile + (require 'cl) + (require 'ring)) ;;; Function aliases later to be redefined for XEmacs usage. -(eval-and-compile - (defvar gnus-xemacs (featurep 'xemacs) - "Non-nil if running under XEmacs.")) - (defvar gnus-mouse-2 [mouse-2]) (defvar gnus-down-mouse-3 [down-mouse-3]) (defvar gnus-down-mouse-2 [down-mouse-2]) (defvar gnus-widget-button-keymap nil) (defvar gnus-mode-line-modified - (if (or gnus-xemacs + (if (or (featurep 'xemacs) (< emacs-major-version 20)) '("--**-" . "-----") '("**" "--"))) @@ -49,7 +47,17 @@ (autoload 'gnus-xmas-redefine "gnus-xmas") (autoload 'appt-select-lowest-window "appt")) -(autoload 'gnus-smiley-display "smiley-ems") ; override XEmacs version +(if (featurep 'xemacs) + (autoload 'gnus-smiley-display "smiley") + (autoload 'gnus-smiley-display "smiley-ems")) ; override XEmacs version + +(defun gnus-kill-all-overlays () + "Delete all overlays in the current buffer." + (let* ((overlayss (overlay-lists)) + (buffer-read-only nil) + (overlays (delq nil (nconc (car overlayss) (cdr overlayss))))) + (while overlays + (delete-overlay (pop overlays))))) ;;; Mule functions. @@ -62,7 +70,7 @@ valstr))) (eval-and-compile - (if gnus-xemacs + (if (featurep 'xemacs) (gnus-xmas-define) (defvar gnus-mouse-face-prop 'mouse-face "Property used for highlighting mouse regions."))) @@ -87,10 +95,11 @@ (defvar gnus-tmp-name) (defvar gnus-tmp-closing-bracket) (defvar gnus-tmp-subject-or-nil) +(defvar gnus-check-before-posting) (defun gnus-ems-redefine () (cond - (gnus-xemacs + ((featurep 'xemacs) (gnus-xmas-redefine)) ((featurep 'mule) @@ -162,7 +171,8 @@ pixmap file height beg i) (save-excursion (switch-to-buffer (gnus-get-buffer-create gnus-group-buffer)) - (let ((buffer-read-only nil)) + (let ((buffer-read-only nil) + width height) (erase-buffer) (when (and dir (file-exists-p (setq file @@ -198,12 +208,15 @@ "Length of the ring used for `gnus-article-xface-ring-internal'.") (defvar gnus-article-compface-xbm - (eq 0 (string-match "#define" (shell-command-to-string "uncompface -X"))) + (condition-case () + (eq 0 (string-match "#define" + (shell-command-to-string "uncompface -X"))) + (error nil)) "Non-nil means the compface program supports the -X option. That produces XBM output.") -(defun gnus-article-display-xface (beg end) - "Display an XFace header from between BEG and END in the current article. +(defun gnus-article-display-xface (beg end &optional buffer) + "Display an XFace header from between BEG and END in BUFFER. Requires support for images in your Emacs and the external programs `uncompface', and `icontopbm'. On a GNU/Linux system these might be in packages with names like `compface' or `faces-xface' and @@ -221,7 +234,10 @@ for XEmacs." (make-ring gnus-article-xface-ring-size))) (save-excursion (let* ((cur (current-buffer)) - (data (buffer-substring beg end)) + (data (if buffer + (with-current-buffer buffer + (buffer-substring beg end)) + (buffer-substring beg end))) (image (cdr-safe (assoc data (ring-elements gnus-article-xface-ring-internal)))) default-enable-multibyte-characters) @@ -266,8 +282,4 @@ for XEmacs." (provide 'gnus-ems) -;; Local Variables: -;; byte-compile-warnings: '(redefine callargs) -;; End: - ;;; gnus-ems.el ends here