From: yamaoka Date: Mon, 26 Aug 2002 13:04:32 +0000 (+0000) Subject: Synch woth Oort Gnus. X-Git-Tag: t-gnus-6_15_8-01-quimby~21 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=ee61ca89e200e6f402b57718d005ba297b101263;p=elisp%2Fgnus.git- Synch woth Oort Gnus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5557c06..b3d3532 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2002-08-26 Katsumi Yamaoka + + * gnus.el (gnus-other-frame-function): New user option. + (gnus-other-frame): Use it; add a doc-string; make it work with + the gnuclient program. + + * gnus-util.el (gnus-frame-or-window-display-name): New function. + + * lpath.el: Fbind `frame-parameter', `make-frame-on-display', + `device-connection' and `dfw-device'. + 2002-08-22 Kai Gro,b_(Bjohann * gnus-art.el (gnus-emphasis-alist): Strikethru had a lot of false diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index c5f89b2..946f6a8 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -1335,6 +1335,16 @@ CHOICE is a list of the choice char and help message at IDX." (symbol-value 'focus-follows-mouse)) (set-mouse-position frame (1- (frame-width frame)) 0))))) +(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)))) + (frame-parameter object 'display)))) + (provide 'gnus-util) ;;; gnus-util.el ends here diff --git a/lisp/gnus.el b/lisp/gnus.el index 4651234..921ffd0 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1858,6 +1858,14 @@ Putting (gnus-agentize) in ~/.gnus is obsolete by (setq gnus-agent t)." :group 'gnus-agent :type 'boolean) +(defcustom gnus-other-frame-function 'gnus + "Function called by the command `gnus-other-frame'." + :group 'gnus-start + :type '(choice (function-item gnus) + (function-item gnus-no-server) + (function-item gnus-slave) + (function-item gnus-slave-no-server))) + (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." @@ -3471,17 +3479,32 @@ the variable `toolbar-news-frame-plist' will be refered instead." :group 'gnus) ;;;###autoload -(defun gnus-other-frame (&optional arg) - "Pop up a frame to read news." +(defun gnus-other-frame (&optional arg display) + "Pop up a frame to read news. +This will call one of the Gnus commands which is specified by the user +option `gnus-other-frame-function' (default `gnus') with the argument +ARG if Gnus is not running, otherwise just pop up a Gnus frame. The +optional second argument DISPLAY should be a standard display string +such as \"unix:0\" to specify where to pop up a frame. If DISPLAY is +omitted or the function `make-frame-on-display' is not available, the +current display is used." (interactive "P") + (if (fboundp 'make-frame-on-display) + (unless display + (setq display (gnus-frame-or-window-display-name (selected-frame)))) + (setq display nil)) (let ((alive (gnus-alive-p))) (unless (and alive (catch 'found (walk-windows (lambda (window) - (when (with-current-buffer (window-buffer window) - (string-match "\\`gnus-.+-mode\\'" - (symbol-name major-mode))) + (when (and (or (not display) + (equal display + (gnus-frame-or-window-display-name + window))) + (with-current-buffer (window-buffer window) + (string-match "\\`gnus-" + (symbol-name major-mode)))) (gnus-select-frame-set-input-focus (setq gnus-other-frame-object (window-frame window))) (select-window window) @@ -3489,10 +3512,12 @@ the variable `toolbar-news-frame-plist' will be refered instead." 'ignore t))) (gnus-select-frame-set-input-focus (setq gnus-other-frame-object - (make-frame gnus-other-frame-parameters))) + (if display + (make-frame-on-display display gnus-other-frame-parameters) + (make-frame gnus-other-frame-parameters)))) (if alive (switch-to-buffer gnus-group-buffer) - (gnus arg) + (funcall gnus-other-frame-function arg) (add-hook 'gnus-exit-gnus-hook (lambda nil (when (and (frame-live-p gnus-other-frame-object) diff --git a/lisp/lpath.el b/lisp/lpath.el index 57561fe..97f3d00 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -89,7 +89,8 @@ window-edges x-color-values x-popup-menu browse-url frame-char-height frame-char-width url-generic-parse-url xml-parse-region - make-network-process)) + make-network-process + frame-parameter make-frame-on-display)) (maybe-bind '(buffer-display-table buffer-file-coding-system font-lock-defaults global-face-data gnus-article-x-face-too-ugly @@ -120,7 +121,8 @@ specifier-instance url-generic-parse-url valid-image-instantiator-format-p w3-do-setup window-pixel-height window-pixel-width - xml-parse-region make-network-process))) + xml-parse-region make-network-process + device-connection dfw-device))) ;; T-gnus. (let ((functions