Function: gnus-other-frame

gnus-other-frame is an autoloaded, interactive and byte-compiled function defined in gnus.el.gz.

Signature

(gnus-other-frame &optional ARG DISPLAY)

Documentation

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 pop up a Gnus frame and run the command specified by gnus-other-frame-resume-function. 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.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus.el.gz
;;;###autoload
(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 pop up a Gnus frame and run the
command specified by `gnus-other-frame-resume-function'.
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 (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))))
			(select-frame-set-input-focus
			 (setq gnus-other-frame-object (window-frame window)))
			(select-window window)
			(throw 'found t)))
		    'ignore t)))
      (select-frame-set-input-focus
       (setq gnus-other-frame-object
	     (if display
		 (make-frame-on-display display gnus-other-frame-parameters)
	       (make-frame gnus-other-frame-parameters))))
      (if alive
	  (progn (switch-to-buffer gnus-group-buffer)
		 (funcall gnus-other-frame-resume-function arg))
	(funcall gnus-other-frame-function arg)
	(add-hook 'gnus-exit-gnus-hook #'gnus-delete-gnus-frame)
  ;; One might argue that `gnus-delete-gnus-frame' should not be called
  ;; from `gnus-suspend-gnus-hook', but, on the other hand, one might
  ;; argue that it should.  No matter what you think, for the sake of
  ;; those who want it to be called from it, please keep (defun
  ;; gnus-delete-gnus-frame) even if you remove the next `add-hook'.
  (add-hook 'gnus-suspend-gnus-hook #'gnus-delete-gnus-frame)))))