+2002-08-26 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * 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\e,b_\e(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
* gnus-art.el (gnus-emphasis-alist): Strikethru had a lot of false
(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
: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."
: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)
'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)
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
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