Synch woth Oort Gnus.
authoryamaoka <yamaoka>
Mon, 26 Aug 2002 13:04:32 +0000 (13:04 +0000)
committeryamaoka <yamaoka>
Mon, 26 Aug 2002 13:04:32 +0000 (13:04 +0000)
lisp/ChangeLog
lisp/gnus-util.el
lisp/gnus.el
lisp/lpath.el

index 5557c06..b3d3532 100644 (file)
@@ -1,3 +1,14 @@
+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
index c5f89b2..946f6a8 100644 (file)
@@ -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
index 4651234..921ffd0 100644 (file)
@@ -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)
index 57561fe..97f3d00 100644 (file)
@@ -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
                 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