Commit fd8d344f authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen
Browse files

Remove more XEmacs compat functions from Gnus

* lisp/gnus/gnus-util.el (gnus-next-char-property-change): Remove.
(gnus-previous-char-property-change): Remove.
(gnus-graphic-display-p): Remove.
(gnus-select-frame-set-input-focus): Remove.
parent e91b75de
......@@ -5540,7 +5540,7 @@ If INTERACTIVE, call FUNCTION interactively."
(setq window (selected-window))
;; Article may be displayed in the other frame.
(setq frame (selected-frame))))))
......@@ -5568,7 +5568,7 @@ If INTERACTIVE, call FUNCTION interactively."
(get-text-property (point) 'gnus-data))))
(set-marker overlay-arrow-position nil)
(unless gnus-auto-select-part
(gnus-select-frame-set-input-focus frame)
(select-frame-set-input-focus frame)
(select-window window))))
(if gnus-inhibit-mime-unbuttonizing
......@@ -6760,7 +6760,7 @@ not have a face in `gnus-article-boring-faces'."
(article 1.0)))))))
(gnus-configure-windows 'article))
(setq win (get-buffer-window summary-buffer 'visible)))
(gnus-select-frame-set-input-focus (window-frame win))
(select-frame-set-input-focus (window-frame win))
(select-window win))))
(setq in-buffer (current-buffer))
;; We disable the pick minor mode commands.
......@@ -317,7 +317,7 @@ If DONT-POP is nil, display the buffer after setting it up."
(let* ((window (get-buffer-window buff t))
(frame (and window (window-frame window))))
(if frame
(gnus-select-frame-set-input-focus frame)
(select-frame-set-input-focus frame)
(pop-to-buffer buff t)))
(error "The draft %s is under edit" file)))))
......@@ -444,7 +444,7 @@ Return a string with image data."
(defun gnus-html-put-image (data url &optional alt-text)
"Put an image with DATA from URL and optional ALT-TEXT."
(when (gnus-graphic-display-p)
(when (display-graphic-p)
(let* ((start (text-property-any (point-min) (point-max)
'image-url url))
(end (when start
......@@ -81,7 +81,7 @@ not get notifications."
(article (nth 2 group-article)))
(cond ((string= key "read")
(gnus-fetch-group group (list article))
(gnus-select-frame-set-input-focus (selected-frame)))
(select-frame-set-input-focus (selected-frame)))
((string= key "mark-read")
......@@ -6836,7 +6836,7 @@ Like forward-line, but skip over (and don't count) invisible lines."
;; If the following character is currently invisible,
;; skip all characters with that same `invisible' property value.
(while (invisible-p (point))
(goto-char (gnus-next-char-property-change (point))))
(goto-char (next-char-property-change (point))))
(forward-line 1)
(if (eobp)
(setq done t)
......@@ -6846,7 +6846,7 @@ Like forward-line, but skip over (and don't count) invisible lines."
(if (bobp) (setq done t)
(setq n (1+ n))
(while (and (not (bobp)) (invisible-p (1- (point))))
(goto-char (gnus-previous-char-property-change (point))))))))
(goto-char (previous-char-property-change (point))))))))
(defun gnus-summary-recenter ()
"Center point in the summary window.
......@@ -850,18 +850,6 @@ Otherwise, return the value."
(overlay-get overlay 'face))
(overlays-at pos))))))
;; Note: the optional 2nd argument has a different meaning between
;; Emacs and XEmacs.
;; (next-char-property-change POSITION &optional LIMIT)
;; (next-extent-change POS &optional OBJECT)
(defalias 'gnus-next-char-property-change
(if (fboundp 'next-extent-change)
'next-extent-change 'next-char-property-change))
(defalias 'gnus-previous-char-property-change
(if (fboundp 'previous-extent-change)
'previous-extent-change 'previous-char-property-change))
;;; Protected and atomic operations. 21.11.1996
;; The primary idea here is to try to protect internal data structures
;; from becoming corrupted when the user hits C-g, or if a hook or
......@@ -939,16 +927,8 @@ with potentially long computations."
;;; Functions for saving to babyl/mail files.
(if (featurep 'xemacs)
;; Don't load tm and apel XEmacs packages that provide some
;; Emacs emulating functions and variables.
(let ((features features))
(provide 'tm-view)
(unless (fboundp 'set-alist) (defalias 'set-alist 'ignore))
(require 'rmail)) ;; It requires tm-view that loads apel.
(require 'rmail))
(autoload 'rmail-update-summary "rmailsum"))
(require 'rmail)
(autoload 'rmail-update-summary "rmailsum")
(defvar mm-text-coding-system)
......@@ -1387,10 +1367,6 @@ is run."
"Byte-compile FORM if `gnus-use-byte-compile' is non-nil."
(if gnus-use-byte-compile
(condition-case nil
;; Work around a bug in XEmacs 21.4
(require 'byte-optimize)
(require 'bytecomp)
(defalias 'gnus-byte-compile
(lambda (form)
......@@ -1493,16 +1469,7 @@ SPEC is a predicate specifier that contains stuff like `or', `and',
initial-input history def)
"Call standard `completing-read-function'."
(let ((completion-styles gnus-completion-styles))
(completing-read prompt
(if (featurep 'xemacs)
;; Old XEmacs (at least 21.4) expect an alist,
;; in which the car of each element is a string,
;; for collection.
(lambda (elem)
(list (format "%s" (or (car-safe elem) elem))))
(completing-read prompt collection
nil require-match initial-input history def)))
(autoload 'ido-completing-read "ido")
......@@ -1543,11 +1510,6 @@ SPEC is a predicate specifier that contains stuff like `or', `and',
(or iswitchb-mode
(remove-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)))))
(defun gnus-graphic-display-p ()
(if (featurep 'xemacs)
(put 'gnus-parse-without-error 'lisp-indent-function 0)
(put 'gnus-parse-without-error 'edebug-form-spec '(body))
......@@ -1628,31 +1590,18 @@ CHOICE is a list of the choice char and help message at IDX."
(kill-buffer buf))
(if (featurep 'emacs)
(defalias 'gnus-select-frame-set-input-focus 'select-frame-set-input-focus)
(if (fboundp 'select-frame-set-input-focus)
(defalias 'gnus-select-frame-set-input-focus 'select-frame-set-input-focus)
;; XEmacs 21.4, SXEmacs
(defun gnus-select-frame-set-input-focus (frame)
"Select FRAME, raise it, and set input focus, if possible."
(raise-frame frame)
(select-frame frame)
(focus-frame frame))))
(defun gnus-frame-or-window-display-name (object)
"Given a frame or window, return the associated display name.
Return nil otherwise."
(if (featurep 'xemacs)
(device-connection (dfw-device object))
(if (or (framep object)
(and (windowp object)
(setq object (window-frame object))))
(let ((display (frame-parameter object 'display)))
(if (and (stringp display)
;; Exclude invalid display names.
(string-match "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'"
(if (or (framep object)
(and (windowp object)
(setq object (window-frame object))))
(let ((display (frame-parameter object 'display)))
(if (and (stringp display)
;; Exclude invalid display names.
(string-match "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'"
(defvar tool-bar-mode)
......@@ -1661,9 +1610,7 @@ Return nil otherwise."
(when (and (boundp 'tool-bar-mode)
(let* ((args nil)
(func (cond ((featurep 'xemacs)
((fboundp 'tool-bar-update)
(func (cond ((fboundp 'tool-bar-update)
((fboundp 'force-window-update)
......@@ -1723,10 +1670,6 @@ predicate on the elements."
(push (pop list1) res)))
(nconc (nreverse res) list1 list2))))
(defvar xemacs-codename)
(defvar sxemacs-codename)
(defvar emacs-program-version)
(defun gnus-emacs-version ()
"Stringified Emacs version."
(let* ((lst (if (listp gnus-user-agent)
......@@ -1737,37 +1680,15 @@ predicate on the elements."
((memq 'type lst)
(symbol-name system-type))
(t nil)))
codename emacsname)
(cond ((featurep 'sxemacs)
(setq emacsname "SXEmacs"
codename sxemacs-codename))
((featurep 'xemacs)
(setq emacsname "XEmacs"
codename xemacs-codename))
(setq emacsname "Emacs")))
((not (memq 'emacs lst))
((string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
;; Emacs:
(concat "Emacs/" (match-string 1 emacs-version)
(if system-v
(concat " (" system-v ")")
((or (featurep 'sxemacs) (featurep 'xemacs))
;; XEmacs or SXEmacs:
(concat emacsname "/" emacs-program-version
(let (plst)
(when (memq 'codename lst)
(push codename plst))
(when system-v
(push system-v plst))
(unless (featurep 'mule)
(push "no MULE" plst))
(when (> (length plst) 0)
" (" (mapconcat 'identity (reverse plst) ", ") ")")))))
(t emacs-version))))
(defun gnus-rename-file (old-path new-path &optional trim)
......@@ -429,7 +429,7 @@ See the Gnus manual for an explanation of the syntax used.")
(gnus-configure-frame split)
(run-hooks 'gnus-configure-windows-hook)
(when gnus-window-frame-focus
(window-frame gnus-window-frame-focus)))))))))
(defun gnus-delete-windows-in-gnusey-frames ()
......@@ -4382,12 +4382,12 @@ current display is used."
(with-current-buffer (window-buffer window)
(string-match "\\`gnus-"
(symbol-name major-mode))))
(setq gnus-other-frame-object (window-frame window)))
(select-window window)
(throw 'found t)))
'ignore t)))
(setq gnus-other-frame-object
(if display
(make-frame-on-display display gnus-other-frame-parameters)
......@@ -1943,7 +1943,6 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'."
(autoload 'gnus-output-to-mail "gnus-util")
(autoload 'gnus-output-to-rmail "gnus-util")
(autoload 'gnus-request-post "gnus-int")
(autoload 'gnus-select-frame-set-input-focus "gnus-util")
(autoload 'gnus-server-string "gnus")
(autoload 'idna-to-ascii "idna")
(autoload 'message-setup-toolbar "messagexmas")
......@@ -6486,7 +6485,7 @@ moved to the beginning "
(if window
;; Raise the frame already displaying the message buffer.
(gnus-select-frame-set-input-focus (window-frame window))
(select-frame-set-input-focus (window-frame window))
(select-window window))
(funcall (or switch-function #'pop-to-buffer) buffer)
(set-buffer buffer))
......@@ -179,7 +179,7 @@ regexp to replace with IMAGE. IMAGE is the name of an image file in
"Replace in the region `smiley-regexp-alist' matches with corresponding images.
A list of images is returned."
(interactive "r")
(when (gnus-graphic-display-p)
(when (display-graphic-p)
(unless smiley-cached-regexp-alist
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment