+2002-08-21 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * 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 <yamaoka@jpl.org>
From \e$B>.4X\e(B \e$B5HB'\e(B (KOSEKI Yoshinori) <kose@meadowy.org>.
(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 focus-follows-mouse
+ (set-mouse-position frame (1- (frame-width frame)) 0)))))
+
(provide 'gnus-util)
;;; gnus-util.el ends here
: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")))))
+
\f
;;; Internal variables
(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.
(defun gnus-other-frame (&optional arg)
"Pop up a frame to read news."
(interactive "P")
- (let ((window (get-buffer-window gnus-group-buffer)))
- (cond (window
- (select-frame (window-frame window)))
- (t
- (select-frame (make-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)))))))
;;(setq thing ? ; this is a comment
;; more 'yes)
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
)
(defun nnkiboze-score-file (a)
-)
+ )
(provide 'lpath)