mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-31 20:02:42 +00:00
Remove XEmacs compat code from Gnus backends
* lisp/gnus/mm-view.el (mm-inline-image-xemacs): Remove. (mm-inline-image): Rename from mm-inline-image-emacs. * lisp/gnus/mml.el: Remove XEmacs compat code. * lisp/gnus/nnheader.el: Remove XEmacs compat code. * lisp/gnus/nnimap.el (nnimap-open-connection-1): Remove XEmacs compat code. * lisp/gnus/nnir.el (nnir-run-gmane): Remove XEmacs compat code. * lisp/gnus/nnmail.el (nnmail-pathname-coding-system): Remove XEmacs compat code. * lisp/gnus/nnmairix.el: Remove XEmacs compat code. * lisp/gnus/nnrss.el: Remove XEmacs compat code. * lisp/gnus/nntp.el: Remove XEmacs compat code.
This commit is contained in:
parent
37cf4454b1
commit
9f7711815b
@ -249,14 +249,7 @@ To disable dissecting shar codes, for instance, add
|
||||
(defsubst mm-uu-function-2 (entry)
|
||||
(nth 5 entry))
|
||||
|
||||
;; In Emacs 22, we could use `min-colors' in the face definition. But Emacs
|
||||
;; 21 and XEmacs don't support it.
|
||||
(defcustom mm-uu-hide-markers
|
||||
(< 16 (or (and (fboundp 'defined-colors)
|
||||
(length (defined-colors)))
|
||||
(and (fboundp 'device-color-cells)
|
||||
(device-color-cells))
|
||||
0))
|
||||
(defcustom mm-uu-hide-markers (< 16 (length (defined-colors)))
|
||||
"If non-nil, hide verbatim markers.
|
||||
The value should be nil on displays where the face
|
||||
`mm-uu-extract' isn't distinguishable to the face `default'."
|
||||
@ -299,10 +292,7 @@ apply the face `mm-uu-extract'."
|
||||
(let ((obuf (current-buffer))
|
||||
(multi (and (boundp 'enable-multibyte-characters)
|
||||
enable-multibyte-characters))
|
||||
(coding-system
|
||||
;; Might not exist in non-MULE XEmacs
|
||||
(when (boundp 'buffer-file-coding-system)
|
||||
buffer-file-coding-system)))
|
||||
(coding-system buffer-file-coding-system))
|
||||
(with-current-buffer (generate-new-buffer " *mm-uu*")
|
||||
(if multi (mm-enable-multibyte) (mm-disable-multibyte))
|
||||
(setq buffer-file-coding-system coding-system)
|
||||
|
@ -79,7 +79,7 @@
|
||||
|
||||
(autoload 'gnus-rescale-image "gnus-util")
|
||||
|
||||
(defun mm-inline-image-emacs (handle)
|
||||
(defun mm-inline-image (handle)
|
||||
(let ((b (point-marker))
|
||||
(inhibit-read-only t))
|
||||
(put-image
|
||||
@ -104,27 +104,6 @@
|
||||
(remove-images b b)
|
||||
(delete-region b (1+ b)))))))
|
||||
|
||||
(defun mm-inline-image-xemacs (handle)
|
||||
(when (featurep 'xemacs)
|
||||
(insert "\n")
|
||||
(forward-char -1)
|
||||
(let ((annot (make-annotation (mm-get-image handle) nil 'text))
|
||||
(inhibit-read-only t))
|
||||
(mm-handle-set-undisplayer
|
||||
handle
|
||||
`(lambda ()
|
||||
(let ((b ,(point-marker))
|
||||
(inhibit-read-only t))
|
||||
(delete-annotation ,annot)
|
||||
(delete-region (1- b) b))))
|
||||
(set-extent-property annot 'mm t)
|
||||
(set-extent-property annot 'duplicable t))))
|
||||
|
||||
(eval-and-compile
|
||||
(if (featurep 'xemacs)
|
||||
(defalias 'mm-inline-image 'mm-inline-image-xemacs)
|
||||
(defalias 'mm-inline-image 'mm-inline-image-emacs)))
|
||||
|
||||
(defvar mm-w3m-setup nil
|
||||
"Whether gnus-article-mode has been setup to use emacs-w3m.")
|
||||
|
||||
@ -462,11 +441,6 @@
|
||||
handle
|
||||
`(lambda ()
|
||||
(let ((inhibit-read-only t))
|
||||
(if (fboundp 'remove-specifier)
|
||||
;; This is only valid on XEmacs.
|
||||
(dolist (prop '(background background-pixmap foreground))
|
||||
(remove-specifier
|
||||
(face-property 'default prop) (current-buffer))))
|
||||
(delete-region ,(point-min-marker) ,(point-max-marker)))))))))
|
||||
|
||||
;; Shut up byte-compiler.
|
||||
@ -526,14 +500,6 @@ If MODE is not set, try to find mode automatically."
|
||||
(if (fboundp 'font-lock-ensure)
|
||||
(font-lock-ensure)
|
||||
(font-lock-fontify-buffer)))))
|
||||
;; By default, XEmacs font-lock uses non-duplicable text
|
||||
;; properties. This code forces all the text properties
|
||||
;; to be copied along with the text.
|
||||
(when (featurep 'xemacs)
|
||||
(map-extents (lambda (ext ignored)
|
||||
(set-extent-property ext 'duplicable t)
|
||||
nil)
|
||||
nil nil nil nil nil 'text-prop))
|
||||
(setq text (buffer-string))
|
||||
;; Set buffer unmodified to avoid confirmation when killing the
|
||||
;; buffer.
|
||||
@ -542,9 +508,8 @@ If MODE is not set, try to find mode automatically."
|
||||
(mm-insert-inline handle text)))
|
||||
|
||||
;; Shouldn't these functions check whether the user even wants to use
|
||||
;; font-lock? At least under XEmacs, this fontification is pretty
|
||||
;; much unconditional. Also, it would be nice to change for the size
|
||||
;; of the fontified region.
|
||||
;; font-lock? Also, it would be nice to change for the size of the
|
||||
;; fontified region.
|
||||
|
||||
(defun mm-display-patch-inline (handle)
|
||||
(mm-display-inline-fontify handle 'diff-mode))
|
||||
|
@ -29,9 +29,6 @@
|
||||
(require 'mml-sec)
|
||||
(eval-when-compile (require 'cl))
|
||||
(eval-when-compile (require 'url))
|
||||
(eval-when-compile
|
||||
(when (featurep 'xemacs)
|
||||
(require 'easy-mmode))) ; for `define-minor-mode'
|
||||
|
||||
(autoload 'message-make-message-id "message")
|
||||
(declare-function gnus-setup-posting-charset "gnus-msg" (group))
|
||||
@ -656,9 +653,7 @@ be \"related\" or \"alternate\"."
|
||||
filename)))))
|
||||
(t
|
||||
(let ((contents (cdr (assq 'contents cont))))
|
||||
(if (if (featurep 'xemacs)
|
||||
(string-match "[^\000-\377]" contents)
|
||||
(multibyte-string-p contents))
|
||||
(if (multibyte-string-p contents)
|
||||
(progn
|
||||
(mm-enable-multibyte)
|
||||
(insert contents)
|
||||
@ -1107,57 +1102,42 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
|
||||
(easy-menu-define
|
||||
mml-menu mml-mode-map ""
|
||||
`("Attachments"
|
||||
["Attach File..." mml-attach-file
|
||||
,@(if (featurep 'xemacs) '(t)
|
||||
'(:help "Attach a file at point"))]
|
||||
["Attach File..." mml-attach-file :help "Attach a file at point"]
|
||||
["Attach Buffer..." mml-attach-buffer
|
||||
,@(if (featurep 'xemacs) '(t)
|
||||
'(:help "Attach a buffer to the outgoing message"))]
|
||||
:help "Attach a buffer to the outgoing message"]
|
||||
["Attach External..." mml-attach-external
|
||||
,@(if (featurep 'xemacs) '(t)
|
||||
'(:help "Attach reference to an external file"))]
|
||||
:help "Attach reference to an external file"]
|
||||
;; FIXME: Is it possible to do this without using
|
||||
;; `gnus-gcc-externalize-attachments'?
|
||||
["Externalize Attachments"
|
||||
(lambda ()
|
||||
(interactive)
|
||||
(if (not (and (boundp 'gnus-gcc-externalize-attachments)
|
||||
(memq gnus-gcc-externalize-attachments
|
||||
'(all t nil))))
|
||||
;; Stupid workaround for XEmacs not honoring :visible.
|
||||
(message "Can't handle this value of `gnus-gcc-externalize-attachments'")
|
||||
(setq gnus-gcc-externalize-attachments
|
||||
(not gnus-gcc-externalize-attachments))
|
||||
(message "gnus-gcc-externalize-attachments is `%s'."
|
||||
gnus-gcc-externalize-attachments)))
|
||||
;; XEmacs barfs on :visible.
|
||||
,@(if (featurep 'xemacs) nil
|
||||
'(:visible (and (boundp 'gnus-gcc-externalize-attachments)
|
||||
(memq gnus-gcc-externalize-attachments
|
||||
'(all t nil)))))
|
||||
(setq gnus-gcc-externalize-attachments
|
||||
(not gnus-gcc-externalize-attachments))
|
||||
(message "gnus-gcc-externalize-attachments is `%s'."
|
||||
gnus-gcc-externalize-attachments))
|
||||
:visible (and (boundp 'gnus-gcc-externalize-attachments)
|
||||
(memq gnus-gcc-externalize-attachments
|
||||
'(all t nil)))
|
||||
:style toggle
|
||||
:selected gnus-gcc-externalize-attachments
|
||||
,@(if (featurep 'xemacs) nil
|
||||
'(:help "Save attachments as external parts in Gcc copies"))]
|
||||
:help "Save attachments as external parts in Gcc copies"]
|
||||
"----"
|
||||
;;
|
||||
("Change Security Method"
|
||||
["PGP/MIME"
|
||||
(lambda () (interactive) (setq mml-secure-method "pgpmime"))
|
||||
,@(if (featurep 'xemacs) nil
|
||||
'(:help "Set Security Method to PGP/MIME"))
|
||||
:help "Set Security Method to PGP/MIME"
|
||||
:style radio
|
||||
:selected (equal mml-secure-method "pgpmime") ]
|
||||
["S/MIME"
|
||||
(lambda () (interactive) (setq mml-secure-method "smime"))
|
||||
,@(if (featurep 'xemacs) nil
|
||||
'(:help "Set Security Method to S/MIME"))
|
||||
:help "Set Security Method to S/MIME"
|
||||
:style radio
|
||||
:selected (equal mml-secure-method "smime") ]
|
||||
["Inline PGP"
|
||||
(lambda () (interactive) (setq mml-secure-method "pgp"))
|
||||
,@(if (featurep 'xemacs) nil
|
||||
'(:help "Set Security Method to inline PGP"))
|
||||
:help "Set Security Method to inline PGP"
|
||||
:style radio
|
||||
:selected (equal mml-secure-method "pgp") ] )
|
||||
;;
|
||||
@ -1165,8 +1145,7 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
|
||||
["Encrypt Message" mml-secure-message-encrypt t]
|
||||
["Sign and Encrypt Message" mml-secure-message-sign-encrypt t]
|
||||
["Encrypt/Sign off" mml-unsecure-message
|
||||
,@(if (featurep 'xemacs) '(t)
|
||||
'(:help "Don't Encrypt/Sign Message"))]
|
||||
:help "Don't Encrypt/Sign Message"]
|
||||
;; Do we have separate encrypt and encrypt/sign commands for parts?
|
||||
["Sign Part" mml-secure-sign t]
|
||||
["Encrypt Part" mml-secure-encrypt t]
|
||||
@ -1181,26 +1160,18 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
|
||||
;;["Narrow" mml-narrow-to-part t]
|
||||
["Quote MML in region" mml-quote-region
|
||||
:active (message-mark-active-p)
|
||||
,@(if (featurep 'xemacs) nil
|
||||
'(:help "Quote MML tags in region"))]
|
||||
:help "Quote MML tags in region"]
|
||||
["Validate MML" mml-validate t]
|
||||
["Preview" mml-preview t]
|
||||
"----"
|
||||
["Emacs MIME manual" (lambda () (interactive) (message-info 4))
|
||||
,@(if (featurep 'xemacs) '(t)
|
||||
'(:help "Display the Emacs MIME manual"))]
|
||||
:help "Display the Emacs MIME manual"]
|
||||
["PGG manual" (lambda () (interactive) (message-info mml2015-use))
|
||||
;; XEmacs barfs on :visible.
|
||||
,@(if (featurep 'xemacs) nil
|
||||
'(:visible (and (boundp 'mml2015-use) (equal mml2015-use 'pgg))))
|
||||
,@(if (featurep 'xemacs) '(t)
|
||||
'(:help "Display the PGG manual"))]
|
||||
:visible (and (boundp 'mml2015-use) (equal mml2015-use 'pgg))
|
||||
:help "Display the PGG manual"]
|
||||
["EasyPG manual" (lambda () (interactive) (require 'mml2015) (message-info mml2015-use))
|
||||
;; XEmacs barfs on :visible.
|
||||
,@(if (featurep 'xemacs) nil
|
||||
'(:visible (and (boundp 'mml2015-use) (equal mml2015-use 'epg))))
|
||||
,@(if (featurep 'xemacs) '(t)
|
||||
'(:help "Display the EasyPG manual"))]))
|
||||
:visible (and (boundp 'mml2015-use) (equal mml2015-use 'epg))
|
||||
:help "Display the EasyPG manual"]))
|
||||
|
||||
(define-minor-mode mml-mode
|
||||
"Minor mode for editing MML.
|
||||
|
@ -726,9 +726,7 @@ the line could be found."
|
||||
(string-match nnheader-numerical-short-files file)
|
||||
(string-to-number (match-string 0 file))))
|
||||
|
||||
(defvar nnheader-directory-files-is-safe
|
||||
(or (eq system-type 'windows-nt)
|
||||
(not (featurep 'xemacs)))
|
||||
(defvar nnheader-directory-files-is-safe (not (eq system-type 'windows-nt))
|
||||
"If non-nil, Gnus believes `directory-files' is safe.
|
||||
It has been reported numerous times that `directory-files' fails with
|
||||
an alarming frequency on NFS mounted file systems. If it is nil,
|
||||
@ -780,28 +778,8 @@ If FULL, translate everything."
|
||||
2 0))
|
||||
;; We translate -- but only the file name. We leave the directory
|
||||
;; alone.
|
||||
(if (and (featurep 'xemacs)
|
||||
(memq system-type '(windows-nt cygwin)))
|
||||
;; This is needed on NT and stuff, because
|
||||
;; file-name-nondirectory is not enough to split
|
||||
;; file names, containing ':', e.g.
|
||||
;; "d:\\Work\\News\\nntp+news.fido7.ru:fido7.ru.gnu.SCORE"
|
||||
;;
|
||||
;; we are trying to correctly split such names:
|
||||
;; "d:file.name" -> "a:" "file.name"
|
||||
;; "aaa:bbb.ccc" -> "" "aaa:bbb.ccc"
|
||||
;; "d:aaa\\bbb:ccc" -> "d:aaa\\" "bbb:ccc"
|
||||
;; etc.
|
||||
;; to translate then only the file name part.
|
||||
(progn
|
||||
(setq leaf file
|
||||
path "")
|
||||
(if (string-match "\\(^\\w:\\|[/\\]\\)\\([^/\\]+\\)$" file)
|
||||
(setq leaf (substring file (match-beginning 2))
|
||||
path (substring file 0 (match-beginning 2)))))
|
||||
;; Emacs DTRT, says andrewi.
|
||||
(setq leaf (file-name-nondirectory file)
|
||||
path (file-name-directory file))))
|
||||
(setq leaf (file-name-nondirectory file)
|
||||
path (file-name-directory file)))
|
||||
(setq len (length leaf))
|
||||
(while (< i len)
|
||||
(when (setq trans (cdr (assq (aref leaf i)
|
||||
@ -1098,16 +1076,14 @@ See `find-file-noselect' for the arguments."
|
||||
|
||||
(defmacro nnheader-insert-buffer-substring (buffer &optional start end)
|
||||
"Copy string from unibyte buffer to multibyte current buffer."
|
||||
(if (featurep 'xemacs)
|
||||
`(insert-buffer-substring ,buffer ,start ,end)
|
||||
`(if enable-multibyte-characters
|
||||
(insert (with-current-buffer ,buffer
|
||||
(string-to-multibyte
|
||||
,(if (or start end)
|
||||
`(buffer-substring (or ,start (point-min))
|
||||
(or ,end (point-max)))
|
||||
'(buffer-string)))))
|
||||
(insert-buffer-substring ,buffer ,start ,end))))
|
||||
`(if enable-multibyte-characters
|
||||
(insert (with-current-buffer ,buffer
|
||||
(string-to-multibyte
|
||||
,(if (or start end)
|
||||
`(buffer-substring (or ,start (point-min))
|
||||
(or ,end (point-max)))
|
||||
'(buffer-string)))))
|
||||
(insert-buffer-substring ,buffer ,start ,end)))
|
||||
|
||||
(defvar nnheader-last-message-time '(0 0))
|
||||
(defun nnheader-message-maybe (&rest args)
|
||||
@ -1116,9 +1092,6 @@ See `find-file-noselect' for the arguments."
|
||||
(setq nnheader-last-message-time now)
|
||||
(apply 'nnheader-message args))))
|
||||
|
||||
(when (featurep 'xemacs)
|
||||
(require 'nnheaderxm))
|
||||
|
||||
(run-hooks 'nnheader-load-hook)
|
||||
|
||||
(provide 'nnheader)
|
||||
|
@ -447,9 +447,7 @@ textual parts.")
|
||||
(when (and stream (not (memq (process-status stream) '(open run))))
|
||||
(setq stream nil))
|
||||
|
||||
(when (and (fboundp 'set-network-process-option) ;; Not in XEmacs.
|
||||
(fboundp 'process-type) ;; Emacs 22 doesn't provide it.
|
||||
(eq (process-type stream) 'network))
|
||||
(when (eq (process-type stream) 'network)
|
||||
;; Use TCP-keepalive so that connections that pass through a NAT
|
||||
;; router don't hang when left idle.
|
||||
(set-network-process-option stream :keepalive t))
|
||||
|
@ -1688,7 +1688,7 @@ actually)."
|
||||
(mm-url-encode-www-form-urlencoded
|
||||
`(("query" . ,search)
|
||||
("HITSPERPAGE" . "999")))))
|
||||
(unless (featurep 'xemacs) (set-buffer-multibyte t))
|
||||
(set-buffer-multibyte t)
|
||||
(decode-coding-region (point-min) (point-max) 'utf-8)
|
||||
(goto-char (point-min))
|
||||
(forward-line 1)
|
||||
|
@ -628,14 +628,7 @@ using different case (i.e. mailing-list@domain vs Mailing-List@Domain)."
|
||||
mm-text-coding-system
|
||||
"Coding system used in reading inbox")
|
||||
|
||||
(defvar nnmail-pathname-coding-system
|
||||
;; This causes Emacs 22.2 and 22.3 to issue a useless warning.
|
||||
;;(if (and (featurep 'xemacs) (featurep 'file-coding))
|
||||
(if (featurep 'xemacs)
|
||||
(if (featurep 'file-coding)
|
||||
;; Work around a bug in many XEmacs 21.5 betas.
|
||||
;; Cf. http://thread.gmane.org/gmane.emacs.gnus.general/68134
|
||||
(setq file-name-coding-system (coding-system-aliasee 'file-name))))
|
||||
(defvar nnmail-pathname-coding-system nil
|
||||
"*Coding system for file name.")
|
||||
|
||||
(defun nnmail-find-file (file)
|
||||
|
@ -147,11 +147,6 @@
|
||||
|
||||
;;; === Keymaps
|
||||
|
||||
(eval-when-compile
|
||||
(when (featurep 'xemacs)
|
||||
;; The `kbd' macro requires that the `read-kbd-macro' macro is available.
|
||||
(require 'edmacro)))
|
||||
|
||||
;; Group mode
|
||||
(defun nnmairix-group-mode-hook ()
|
||||
"Nnmairix group mode keymap."
|
||||
|
@ -240,7 +240,6 @@ for decoding when the cdr that the data specify is not available.")
|
||||
(max 1 (/ (* (window-width window) 7) 8))))
|
||||
(fill-region (point) (point-max))
|
||||
(goto-char (point-max))
|
||||
;; XEmacs version of `fill-region' inserts newline.
|
||||
(unless (bolp)
|
||||
(insert "\n"))))
|
||||
(when (or link enclosure)
|
||||
|
@ -244,8 +244,7 @@ server there that you can connect to. See also
|
||||
|
||||
(defvoo nntp-connection-timeout nil
|
||||
"*Number of seconds to wait before an nntp connection times out.
|
||||
If this variable is nil, which is the default, no timers are set.
|
||||
NOTE: This variable is never seen to work in Emacs 20 and XEmacs 21.")
|
||||
If this variable is nil, which is the default, no timers are set.")
|
||||
|
||||
(defvoo nntp-prepare-post-hook nil
|
||||
"*Hook run just before posting an article. It is supposed to be used
|
||||
@ -344,16 +343,14 @@ retried once before actually displaying the error report."
|
||||
|
||||
(defmacro nntp-copy-to-buffer (buffer start end)
|
||||
"Copy string from unibyte current buffer to multibyte buffer."
|
||||
(if (featurep 'xemacs)
|
||||
`(copy-to-buffer ,buffer ,start ,end)
|
||||
`(let ((string (buffer-substring ,start ,end)))
|
||||
(with-current-buffer ,buffer
|
||||
(erase-buffer)
|
||||
(insert (if enable-multibyte-characters
|
||||
(string-to-multibyte string)
|
||||
string))
|
||||
(goto-char (point-min))
|
||||
nil))))
|
||||
`(let ((string (buffer-substring ,start ,end)))
|
||||
(with-current-buffer ,buffer
|
||||
(erase-buffer)
|
||||
(insert (if enable-multibyte-characters
|
||||
(string-to-multibyte string)
|
||||
string))
|
||||
(goto-char (point-min))
|
||||
nil)))
|
||||
|
||||
(defsubst nntp-wait-for (process wait-for buffer &optional decode discard)
|
||||
"Wait for WAIT-FOR to arrive from PROCESS."
|
||||
@ -1301,9 +1298,7 @@ If SEND-IF-FORCE, only send authinfo to the server if the
|
||||
(nntp-kill-buffer pbuffer))
|
||||
(when (and (buffer-name pbuffer)
|
||||
process)
|
||||
(when (and (fboundp 'set-network-process-option) ;; Unavailable in XEmacs.
|
||||
(fboundp 'process-type) ;; Emacs 22 doesn't provide it.
|
||||
(eq (process-type process) 'network))
|
||||
(when (eq (process-type process) 'network)
|
||||
;; Use TCP-keepalive so that connections that pass through a NAT router
|
||||
;; don't hang when left idle.
|
||||
(set-network-process-option process :keepalive t))
|
||||
|
@ -513,7 +513,7 @@ Valid types include `google', `dejanews', and `gmane'.")
|
||||
;;("TOPDOC" . "1000")
|
||||
))))
|
||||
(setq buffer-file-name nil)
|
||||
(unless (featurep 'xemacs) (set-buffer-multibyte t))
|
||||
(set-buffer-multibyte t)
|
||||
(decode-coding-region (point-min) (point-max) 'utf-8)
|
||||
t)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user