changeset 70146:2cd7cafcba54

Revision: emacs@sv.gnu.org/emacs--devo--0--patch-238 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 87-90) - Merge from emacs--devo--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Fri, 21 Apr 2006 05:35:31 +0000
parents 00cb3fe5fed5
children 37f988f09f67 72dea2ff0142
files lisp/gnus/ChangeLog lisp/gnus/gnus-group.el lisp/gnus/gnus-sum.el lisp/gnus/gnus-util.el
diffstat 4 files changed, 34 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Fri Apr 21 01:32:16 2006 +0000
+++ b/lisp/gnus/ChangeLog	Fri Apr 21 05:35:31 2006 +0000
@@ -1,3 +1,18 @@
+2006-04-20  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-util.el (gnus-replace-in-string): Prefer
+	replace-regexp-in-string over of replace-in-string.
+
+2006-04-20  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-group.el: Bind tool-bar-mode instead of tool-bar-map.
+
+	* gnus-sum.el: Ditto.
+
+	* gnus-util.el (gnus-select-frame-set-input-focus): Use
+	select-frame-set-input-focus if it is available in XEmacs; use
+	definition defined in Emacs 22 for old Emacsen.
+
 2006-04-17  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	[ Merge from Gnus trunk. ]
--- a/lisp/gnus/gnus-group.el	Fri Apr 21 01:32:16 2006 +0000
+++ b/lisp/gnus/gnus-group.el	Fri Apr 21 05:35:31 2006 +0000
@@ -29,7 +29,7 @@
 
 (eval-when-compile
   (require 'cl)
-  (defvar tool-bar-map))
+  (defvar tool-bar-mode))
 
 (require 'gnus)
 (require 'gnus-start)
--- a/lisp/gnus/gnus-sum.el	Fri Apr 21 01:32:16 2006 +0000
+++ b/lisp/gnus/gnus-sum.el	Fri Apr 21 05:35:31 2006 +0000
@@ -29,7 +29,7 @@
 
 (eval-when-compile
   (require 'cl)
-  (defvar tool-bar-map))
+  (defvar tool-bar-mode))
 
 (require 'gnus)
 (require 'gnus-group)
--- a/lisp/gnus/gnus-util.el	Fri Apr 21 01:32:16 2006 +0000
+++ b/lisp/gnus/gnus-util.el	Fri Apr 21 05:35:31 2006 +0000
@@ -61,8 +61,11 @@
 
 (eval-and-compile
   (cond
-   ((fboundp 'replace-in-string)
-    (defalias 'gnus-replace-in-string 'replace-in-string))
+   ;; Prefer `replace-regexp-in-string' (present in Emacs, XEmacs 21.5,
+   ;; SXEmacs 22.1.4) over `replace-in-string'.  The later leads to inf-loops
+   ;; on empty matches:
+   ;;   (replace-in-string "foo" "/*$" "/")
+   ;;   (replace-in-string "xe" "\\(x\\)?" "")
    ((fboundp 'replace-regexp-in-string)
     (defun gnus-replace-in-string (string regexp newtext &optional literal)
       "Replace all matches for REGEXP with NEWTEXT in STRING.
@@ -71,6 +74,8 @@
 
 This is a compatibility function for different Emacsen."
       (replace-regexp-in-string regexp newtext string nil literal)))
+   ((fboundp 'replace-in-string)
+    (defalias 'gnus-replace-in-string 'replace-in-string))
    (t
     (defun gnus-replace-in-string (string regexp newtext &optional literal)
       "Replace all matches for REGEXP with NEWTEXT in STRING.
@@ -1424,20 +1429,19 @@
 (defun gnus-select-frame-set-input-focus (frame)
   "Select FRAME, raise it, and set input focus, if possible."
   (cond ((featurep 'xemacs)
-	 (raise-frame frame)
-	 (select-frame frame)
-	 (focus-frame frame))
-	;; The function `select-frame-set-input-focus' won't set
-	;; the input focus under Emacs 21.2 and X window system.
-	;;((fboundp 'select-frame-set-input-focus)
-	;; (defalias 'gnus-select-frame-set-input-focus
-	;;   'select-frame-set-input-focus)
-	;; (select-frame-set-input-focus frame))
+	 (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 ((and (eq window-system 'x)
-		     (fboundp 'x-focus-frame))
+	 (cond ((memq window-system '(x mac))
 		(x-focus-frame frame))
 	       ((eq window-system 'w32)
 		(w32-focus-frame frame)))