summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2010-09-24 07:25:37 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-09-24 07:25:37 +0000
commit5843126b45d053c3d153c4157230462094a7e505 (patch)
tree5f5efc8f6d0a41c8652c6eea8cacbbb874120db1 /lisp
parent3431395cd8d11f1fede7fdcdae0be04b621aa3c9 (diff)
downloademacs-5843126b45d053c3d153c4157230462094a7e505.tar.gz
Remove Emacs 21 stuff.
gmm-utils.el (gmm-tool-bar-from-list): Always use tool-bar-local-item and tool-bar-local-item-from-menu. gnus-agent.el (gnus-agent-make-mode-line-string): Always use mode-line-highlight face for Emacs. gnus-art.el (toplevel): Don't bind recursive-load-depth-limit while loading gnus-sum.elc; don't autoload canlock-verify. gnus-art.el (gnus-article-jump-to-part): Use read-number. gnus-art.el (gnus-insert-mime-button, gnus-insert-mime-security-button): Remove Emacs pre-21 compatible code for help-echo. gnus-art.el (gnus-article-next-page-1): No need to adjust the number of lines. gnus-art.el (gnus-article-describe-bindings): Always use help-buffer. gnus-audio.el (gnus-audio-inline-sound): Comment fix. gnus-cus.el (gnus-custom-mode): Comment fix. gnus-group.el (gnus-group-update-tool-bar): Comment fix. gnus-sum.el (gnus-remove-overlays): Doc fix. gnus-util.el (gnus-select-frame-set-input-focus): Remove Emacs 21 compatible code.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/ChangeLog25
-rw-r--r--lisp/gnus/gmm-utils.el29
-rw-r--r--lisp/gnus/gnus-agent.el17
-rw-r--r--lisp/gnus/gnus-art.el41
-rw-r--r--lisp/gnus/gnus-audio.el2
-rw-r--r--lisp/gnus/gnus-cus.el2
-rw-r--r--lisp/gnus/gnus-group.el2
-rw-r--r--lisp/gnus/gnus-sum.el2
-rw-r--r--lisp/gnus/gnus-util.el32
9 files changed, 63 insertions, 89 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c1a54e0108c..b8fae313249 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,28 @@
+2010-09-24 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gmm-utils.el (gmm-tool-bar-from-list): Always use tool-bar-local-item
+ and tool-bar-local-item-from-menu.
+
+ * gnus-agent.el (gnus-agent-make-mode-line-string): Always use
+ mode-line-highlight face for Emacs.
+
+ * gnus-art.el (toplevel): Don't bind recursive-load-depth-limit while
+ loading gnus-sum.elc; fix comment for canlock-verify.
+ (gnus-article-jump-to-part): Use read-number.
+ (gnus-insert-mime-button, gnus-insert-mime-security-button): Remove
+ Emacs pre-21 compatible code for help-echo.
+ (gnus-article-next-page-1): No need to adjust the number of lines.
+ (gnus-article-describe-bindings): Always use help-buffer.
+
+ * gnus-audio.el (gnus-audio-inline-sound)
+ * gnus-cus.el (gnus-custom-mode)
+ * gnus-group.el (gnus-group-update-tool-bar): Comment fix.
+
+ * gnus-sum.el (gnus-remove-overlays): Doc fix.
+
+ * gnus-util.el (gnus-select-frame-set-input-focus): Remove Emacs 21
+ compatible code.
+
2010-09-24 Glenn Morris <rgm@gnu.org>
* message.el (message-output): Use gnus-output-to-rmail if a buffer is
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el
index 533d9a951b5..b76db479dfb 100644
--- a/lisp/gnus/gmm-utils.el
+++ b/lisp/gnus/gmm-utils.el
@@ -267,27 +267,16 @@ DEFAULT-MAP specifies the default key map for ICON-LIST."
;; (tool-bar-add-item ICON DEF KEY &rest PROPS)
(apply 'tool-bar-add-item icon nil nil :enable nil props)))
((equal fmap t) ;; Not a menu command
- (if (fboundp 'tool-bar-local-item)
- (apply 'tool-bar-local-item
- icon command
- (intern icon) ;; reuse icon or fmap here?
- tool-bar-map props)
- ;; Emacs 21 compatibility:
- (apply 'tool-bar-add-item
- icon command
- (intern icon)
- props)))
+ (apply 'tool-bar-local-item
+ icon command
+ (intern icon) ;; reuse icon or fmap here?
+ tool-bar-map props))
(t ;; A menu command
- (if (fboundp 'tool-bar-local-item-from-menu)
- (apply 'tool-bar-local-item-from-menu
- ;; (apply 'tool-bar-local-item icon def key
- ;; tool-bar-map props)
- command icon tool-bar-map (symbol-value fmap)
- props)
- ;; Emacs 21 compatibility:
- (apply 'tool-bar-add-item-from-menu
- command icon (symbol-value fmap)
- props))))
+ (apply 'tool-bar-local-item-from-menu
+ ;; (apply 'tool-bar-local-item icon def key
+ ;; tool-bar-map props)
+ command icon tool-bar-map (symbol-value fmap)
+ props)))
t))
(if (symbolp icon-list)
(eval icon-list)
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 2a586e627c6..8112565ba54 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -606,16 +606,13 @@ manipulated as follows:
(propertize string 'local-map
(make-mode-line-mouse-map mouse-button mouse-func)
'mouse-face
- (cond ((and (featurep 'xemacs)
- ;; XEmacs' `facep' only checks for a face
- ;; object, not for a face name, so it's useless
- ;; to check with `facep'.
- (find-face 'modeline))
- 'modeline)
- ((facep 'mode-line-highlight) ;; Emacs 22
- 'mode-line-highlight)
- ((facep 'mode-line) ;; Emacs 21
- 'mode-line)) )
+ (if (and (featurep 'xemacs)
+ ;; XEmacs' `facep' only checks for a face
+ ;; object, not for a face name, so it's useless
+ ;; to check with `facep'.
+ (find-face 'modeline))
+ 'modeline
+ 'mode-line-highlight))
string))
(defun gnus-agent-toggle-plugged (set-to)
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 7e51abb564e..d92d29d621c 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -34,10 +34,7 @@
(defvar w3m-minor-mode-map)
(require 'gnus)
-;; Avoid the "Recursive load suspected" error in Emacs 21.1.
-(eval-and-compile
- (let ((recursive-load-depth-limit 100))
- (require 'gnus-sum)))
+(require 'gnus-sum)
(require 'gnus-spec)
(require 'gnus-int)
(require 'gnus-win)
@@ -4259,7 +4256,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
(put-text-property (match-end 0) (point-max)
'face eface)))))))))
-(autoload 'canlock-verify "canlock" nil t) ;; for Emacs 21.
+(autoload 'canlock-verify "canlock" nil t) ;; for XEmacs.
(defun article-verify-cancel-lock ()
"Verify Cancel-Lock header."
@@ -4894,10 +4891,7 @@ General format specifiers can also be used. See Info node
;; FIXME: why is it necessary?
(sit-for 0)
(let ((parts (length gnus-article-mime-handle-alist)))
- (or n (setq n
- (string-to-number
- (read-string ;; Emacs 21 doesn't have `read-number'.
- (format "Jump to part (2..%s): " parts)))))
+ (or n (setq n (read-number (format "Jump to part (2..%s): " parts))))
(unless (and (integerp n) (<= n parts) (>= n 1))
(setq n
(progn
@@ -5681,7 +5675,7 @@ all parts."
:action 'gnus-widget-press-button
:button-keymap gnus-mime-button-map
:help-echo
- (lambda (widget/window &optional overlay pos)
+ (lambda (widget)
;; Needed to properly clear the message due to a bug in
;; wid-edit (XEmacs only).
(if (boundp 'help-echo-owns-message)
@@ -5689,14 +5683,7 @@ all parts."
(format
"%S: %s the MIME part; %S: more options"
(aref gnus-mouse-2 0)
- ;; XEmacs will get a single widget arg; Emacs 21 will get
- ;; window, overlay, position.
- (if (mm-handle-displayed-p
- (if overlay
- (with-current-buffer (gnus-overlay-buffer overlay)
- (widget-get (widget-at (gnus-overlay-start overlay))
- :mime-handle))
- (widget-get widget/window :mime-handle)))
+ (if (mm-handle-displayed-p (widget-get widget :mime-handle))
"hide" "show")
(aref gnus-down-mouse-3 0))))))
@@ -6319,15 +6306,6 @@ specifies."
2)))))))
(defun gnus-article-next-page-1 (lines)
- (unless (featurep 'xemacs)
- ;; Protect against the bug that Emacs 21.x hangs up when scrolling up for
- ;; too many number of lines if `scroll-margin' is set as two or greater.
- (when (and (numberp lines)
- (> lines 0)
- (> scroll-margin 0))
- (setq lines (min lines
- (max 0 (- (count-lines (window-start) (point-max))
- scroll-margin))))))
(condition-case ()
(let ((scroll-in-place nil))
(scroll-up lines))
@@ -6581,6 +6559,9 @@ KEY is a string or a vector."
(defvar gnus-draft-mode)
;; Calling help-buffer will autoload help-mode.
(defvar help-xref-stack-item)
+;; Emacs 22 doesn't load it in the batch mode.
+(eval-when-compile
+ (autoload 'help-buffer "help-mode"))
(defun gnus-article-describe-bindings (&optional prefix)
"Show a list of all defined keys, and their definitions.
@@ -6631,9 +6612,7 @@ then we display only bindings that start with that prefix."
(with-current-buffer ,(current-buffer)
(gnus-article-describe-bindings prefix)))
,prefix)))
- (with-current-buffer (if (fboundp 'help-buffer)
- (let (help-xref-following) (help-buffer))
- "*Help*") ;; Emacs 21
+ (with-current-buffer (let (help-xref-following) (help-buffer))
(setq help-xref-stack-item item)))))
(defun gnus-article-reply-with-original (&optional wide)
@@ -8702,7 +8681,7 @@ For example:
:action 'gnus-widget-press-button
:button-keymap gnus-mime-security-button-map
:help-echo
- (lambda (widget/window &optional overlay pos)
+ (lambda (widget)
;; Needed to properly clear the message due to a bug in
;; wid-edit (XEmacs only).
(when (boundp 'help-echo-owns-message)
diff --git a/lisp/gnus/gnus-audio.el b/lisp/gnus/gnus-audio.el
index c89faef7023..cc198176f10 100644
--- a/lisp/gnus/gnus-audio.el
+++ b/lisp/gnus/gnus-audio.el
@@ -39,7 +39,7 @@
(defvar gnus-audio-inline-sound
(or (if (fboundp 'device-sound-enabled-p)
(device-sound-enabled-p)) ; XEmacs
- (fboundp 'play-sound)) ; Emacs 21
+ (fboundp 'play-sound)) ; Emacs
"Non-nil means try to play sounds without using an external program.")
(defcustom gnus-audio-directory (nnheader-find-etc-directory "sounds")
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el
index 89b893090b5..838150d1146 100644
--- a/lisp/gnus/gnus-cus.el
+++ b/lisp/gnus/gnus-cus.el
@@ -50,7 +50,7 @@ if that value is non-nil."
(setq major-mode 'gnus-custom-mode
mode-name "Gnus Customize")
(use-local-map widget-keymap)
- ;; Emacs 21 stuff:
+ ;; Emacs stuff:
(when (and (facep 'custom-button-face)
(facep 'custom-button-pressed-face))
(set (make-local-variable 'widget-button-face)
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 399eb2adf45..86cdb0e89ea 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1515,7 +1515,7 @@ if it is a string, only list groups matching REGEXP."
(and (not (featurep 'xemacs))
(boundp 'tool-bar-mode)
tool-bar-mode
- ;; Using `redraw-frame' (see `gnus-tool-bar-update') in Emacs 21 might
+ ;; Using `redraw-frame' (see `gnus-tool-bar-update') in Emacs might
;; be confusing, so maybe we shouldn't call it by default.
(fboundp 'force-window-update))
"Force updating the group buffer tool bar."
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 622665d519e..50f9b32700d 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -11318,7 +11318,7 @@ If ARG is positive number, turn showing conversation threads on."
(defalias 'gnus-remove-overlays 'remove-overlays)
(defun gnus-remove-overlays (beg end name val)
"Clear BEG and END of overlays whose property NAME has value VAL.
-For compatibility with Emacs 21 and XEmacs."
+For compatibility with XEmacs."
(dolist (ov (gnus-overlays-in beg end))
(when (eq (gnus-overlay-get ov name) val)
(gnus-delete-overlay ov))))))
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 334f0eea7db..ead48f43cea 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1661,30 +1661,14 @@ CHOICE is a list of the choice char and help message at IDX."
(kill-buffer buf))
tchar))
-(declare-function x-focus-frame "xfns.c" (frame))
-(declare-function w32-focus-frame "../term/w32-win" (frame))
-
-(defun gnus-select-frame-set-input-focus (frame)
- "Select FRAME, raise it, and set input focus, if possible."
- (cond ((featurep 'xemacs)
- (if (fboundp 'select-frame-set-input-focus)
- (select-frame-set-input-focus frame)
- (raise-frame frame)
- (select-frame frame)
- (focus-frame frame)))
- ;; `select-frame-set-input-focus' defined in Emacs 21 will not
- ;; set the input focus.
- ((>= emacs-major-version 22)
- (select-frame-set-input-focus frame))
- (t
- (raise-frame frame)
- (select-frame frame)
- (cond ((memq window-system '(x ns mac))
- (x-focus-frame frame))
- ((eq window-system 'w32)
- (w32-focus-frame frame)))
- (when focus-follows-mouse
- (set-mouse-position frame (1- (frame-width frame)) 0)))))
+(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.