From: yamaoka Date: Wed, 21 Aug 2002 12:52:33 +0000 (+0000) Subject: Synch with Oort Gnus. X-Git-Tag: t-gnus-6_15_8-01-quimby~27 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb5dd55974034d238091ed0597d0129b4eb1aa65;p=elisp%2Fgnus.git- Synch with Oort Gnus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 01317f9..6a8553c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2002-08-21 Katsumi Yamaoka + + * gnus.el (gnus-other-frame-parameters): New user option. + (gnus-other-frame-object): New variable. + (gnus-other-frame): Make it search for existing Gnus frame; don't + read new news; delete frame on exit. + + * gnus-util.el (gnus-select-frame-set-input-focus): New function. + + * lpath.el: Fbind w32-focus-frame and x-focus-frame. + 2002-08-20 Katsumi Yamaoka From 小関 吉則 (KOSEKI Yoshinori) . diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index 93d2c57..c5f89b2 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -1311,6 +1311,30 @@ CHOICE is a list of the choice char and help message at IDX." (kill-buffer buf)) tchar)) +(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)) + (t + (raise-frame frame) + (select-frame frame) + (cond ((and (eq window-system 'x) + (fboundp 'x-focus-frame)) + (x-focus-frame frame)) + ((eq window-system 'w32) + (w32-focus-frame frame))) + (when (or (not (boundp 'focus-follows-mouse)) + (symbol-value 'focus-follows-mouse)) + (set-mouse-position frame (1- (frame-width frame)) 0))))) + (provide 'gnus-util) ;;; gnus-util.el ends here diff --git a/lisp/gnus.el b/lisp/gnus.el index 1a725aa..eeab02a 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1858,6 +1858,18 @@ Putting (gnus-agentize) in ~/.gnus is obsolete by (setq gnus-agent t)." :group 'gnus-agent :type 'boolean) +(defcustom gnus-other-frame-parameters nil + "Frame parameters used by `gnus-other-frame' to create a Gnus frame. +This should be an alist for FSF Emacs, or a plist for XEmacs." + :group 'gnus-start + :type (if (featurep 'xemacs) + '(repeat (list :inline t :format "%v" + (symbol :tag "Property") + (sexp :tag "Value"))) + '(repeat (cons :format "%v" + (symbol :tag "Parameter") + (sexp :tag "Value"))))) + ;;; Internal variables @@ -2072,6 +2084,9 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.") (defvar gnus-invalid-group-regexp "[: `'\"/]\\|^$" "Regexp matching invalid groups.") +(defvar gnus-other-frame-object nil + "A frame object which will be created by `gnus-other-frame'.") + ;;; End of variables. ;; Define some autoload functions Gnus might use. @@ -3462,27 +3477,31 @@ the variable `toolbar-news-frame-plist' will be refered instead." (defun gnus-other-frame (&optional arg) "Pop up a frame to read news." (interactive "P") - (static-if (featurep 'xemacs) - (let ((toolbar-news-use-separate-frame t)) - (toolbar-gnus)) - (if (frame-live-p gnus-frame) - (raise-frame gnus-frame) - (setq gnus-frame (make-frame gnus-frame-properties)) - (if (and (gnus-buffer-live-p gnus-group-buffer) - (save-current-buffer - (set-buffer gnus-group-buffer) - (eq 'gnus-group-mode major-mode))) - (progn - (select-frame gnus-frame) - (switch-to-buffer gnus-group-buffer)) - (add-hook 'gnus-exit-gnus-hook - (lambda () - (when (and (frame-live-p gnus-frame) - (cdr (frame-list))) - (delete-frame gnus-frame)) - (setq gnus-frame nil))) - (select-frame gnus-frame) - (gnus arg))))) + (let ((alive (gnus-alive-p))) + (or (and alive + (catch 'found + (walk-windows + (lambda (window) + (when (with-current-buffer (window-buffer window) + (string-match "\\`gnus-.+-mode\\'" + (symbol-name major-mode))) + (gnus-select-frame-set-input-focus + (setq gnus-other-frame-object (window-frame window))) + (select-window window) + (throw 'found t))) + 'ignore t))) + (gnus-select-frame-set-input-focus + (setq gnus-other-frame-object + (make-frame gnus-other-frame-parameters))) + (if alive + (switch-to-buffer gnus-group-buffer) + (gnus arg) + (add-hook 'gnus-exit-gnus-hook + (lambda nil + (when (and (frame-live-p gnus-other-frame-object) + (cdr (frame-list))) + (delete-frame gnus-other-frame-object)) + (setq gnus-other-frame-object nil))))))) ;;;###autoload (defun gnus (&optional arg dont-connect slave) diff --git a/lisp/lpath.el b/lisp/lpath.el index 018179d..57561fe 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -41,7 +41,8 @@ url-insert-file-contents w3-coding-system-for-mime-charset w3-prepare-buffer w3-region w3m-charset-to-coding-system w3m-region - widget-make-intangible x-defined-colors)) + widget-make-intangible x-defined-colors + w32-focus-frame x-focus-frame)) (maybe-bind '(adaptive-fill-first-line-regexp adaptive-fill-regexp babel-history babel-translations