Gnus development mailing list
 help / color / mirror / Atom feed
* Multiple frame problem
@ 2000-04-26 19:54 Reid Rivenburgh
  2000-04-26 20:47 ` Kai Großjohann
  0 siblings, 1 reply; 6+ messages in thread
From: Reid Rivenburgh @ 2000-04-26 19:54 UTC (permalink / raw)


[posted to gnu.emacs.gnus, but maybe better asked here]

Hi,

[Before I forget: Gnus 5.8.5 and XEmacs 21.1.9]

I currently use a setup that pops up a new frame for composing mail
and posts, leaving my original frame for normal reading.  The
composition frame is created once, raised when needed, and
automatically lowered after sending using the following hook:

   (add-hook 'message-sent-hook (lambda () (bury-buffer (get-buffer "*Group*"))) (lower-frame)))

You'll notice I'm also burying the *Group* buffer.  That's where my
question comes in.  The composition frame seems to revert back to that
buffer and sometimes others after sending.  That's annoying, because
my main frame then won't display it, since it's visible in the
composition frame.  My burying it is an attempt to get it to stop
doing that.  I also tried this:

   (add-hook 'message-sent-hook (lambda () (switch-to-buffer "*scratch*")) (lower-frame)))

But that doesn't work; that switch-to-buffer seems to happen before
the internal buffer switch.  There doesn't appear to be a later hook I
could use.  Does anyone have any suggestions for how to handle this?
I'm an elisp novice, and I've done some poking around, but nothing
I've found works very well.

Thanks,
reid



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Multiple frame problem
  2000-04-26 19:54 Multiple frame problem Reid Rivenburgh
@ 2000-04-26 20:47 ` Kai Großjohann
  2000-04-26 21:00   ` Reid Rivenburgh
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Großjohann @ 2000-04-26 20:47 UTC (permalink / raw)
  Cc: ding

Reid Rivenburgh <reid@lanl.gov> writes:

> I currently use a setup that pops up a new frame for composing mail
> and posts, leaving my original frame for normal reading.

It ought to be possible using the normal method of configuring frames
and windows and buffers in Gnus.  Alas, I'm not an expert -- I just
use the default and I'm happy.

But I'm sure if you post what configuration you currently use, some
buffer configuration guru will be able to tell you how to frob it to
get what you want.

kai
-- 
Beware of flying birch trees.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Multiple frame problem
  2000-04-26 20:47 ` Kai Großjohann
@ 2000-04-26 21:00   ` Reid Rivenburgh
  2000-05-01 19:49     ` David S. Goldberg
  0 siblings, 1 reply; 6+ messages in thread
From: Reid Rivenburgh @ 2000-04-26 21:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1864 bytes --]

 Kai Großjohann writes:

 > Reid Rivenburgh <reid@lanl.gov> writes:
 >> I currently use a setup that pops up a new frame for composing
 >> mail and posts, leaving my original frame for normal reading.

 > It ought to be possible using the normal method of configuring
 > frames and windows and buffers in Gnus.  Alas, I'm not an expert --
 > I just use the default and I'm happy.

 > But I'm sure if you post what configuration you currently use, some
 > buffer configuration guru will be able to tell you how to frob it
 > to get what you want.

Thanks, Kai.  I wasn't sure how much info to include in my previous
message.  I had asked before how to go about getting the separate
frame for compositions, and I believe David Goldberg was kind enough
to post something from his .gnus.el.  Here's what I'm using:

(gnus-add-configuration
 '(message
   (frame 1.0
	  (if (not (buffer-live-p gnus-summary-buffer))
	      (car (cdr (assoc 'group gnus-buffer-configuration)))
	    (car (cdr (assoc 'summary gnus-buffer-configuration))))
	  (vertical (user-position t width 80 top 0 left 0 name "Gnus Edit")
		    (message 1.0 point)))))

The same for reply-yank, reply, and forward.  And as I mentioned in my
previous message, I'm using some hooks to raise and lower the
composition frame as appropriate:

(add-hook 'message-sent-hook (lambda () (bury-buffer (get-buffer
          "*Group*"))) (lower-frame)))
(add-hook 'message-setup-hook (lambda () (raise-frame (next-frame))))

It feels like a mighty big kludge, but it mostly works.  (Sometimes
something in the message-sent-hook outright kills XEmacs, but I
haven't yet diagnosed that one, annoying as it is.)  I'd just like it
to not try to switch to the main gnus buffers (*Group*, *Summary*,
etc.) in the composition frame after sending the message.

Thanks,
Reid



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Multiple frame problem
  2000-04-26 21:00   ` Reid Rivenburgh
@ 2000-05-01 19:49     ` David S. Goldberg
  2000-05-04 20:38       ` Reid Rivenburgh
  0 siblings, 1 reply; 6+ messages in thread
From: David S. Goldberg @ 2000-05-01 19:49 UTC (permalink / raw)


> Thanks, Kai.  I wasn't sure how much info to include in my previous
> message.  I had asked before how to go about getting the separate
> frame for compositions, and I believe David Goldberg was kind enough
> to post something from his .gnus.el.  Here's what I'm using:


[...]

Yup, that looks something like my setup.

> (add-hook 'message-sent-hook (lambda () (bury-buffer (get-buffer
>           "*Group*"))) (lower-frame)))
> (add-hook 'message-setup-hook (lambda () (raise-frame (next-frame))))

Here's my solution which works with XEmacs.  Not sure about Emacs.  In
my .gnus I have: 

(defvar dsg-gnus-edit-buffer "*gnusedit*" "place holder for gnus editing")

(defun dsg-gnus-buffer-predicate (arg)
  (string= (buffer-name arg) dsg-gnus-edit-buffer))

[...]

(gnus-add-configuration
 '(message
   (frame 1.0
	  (if (not (buffer-live-p gnus-summary-buffer))
	      (car (cdr (assoc 'group gnus-buffer-configuration)))
	    (car (cdr (assoc 'summary gnus-buffer-configuration))))
	  (vertical (user-position t top 1 left 1 name "Gnus Edit"
				   buffer-predicate
				   dsg-gnus-buffer-predicate)
		    (message 1.0 point)))))

What this says is that when I kill or bury whatever is being put in
the frame called "Gnus Edit", the buffer it will return to is called
"*gnusedit*" which is not used for anything else, and therefore won't
likely show up in any other frame.  You can use this as the buffer to
find and lower.  Note that you're better off with something like this
to do the lowering:

(lower-frame (window-frame (get-buffer-window "*gnusedit*" t)))

This way you don't end up mucking with your current frame selection etc.
-- 
Dave Goldberg
Post: The Mitre Corporation\MS K207\202 Burlington Rd.\Bedford, MA 01730
Phone: 781-271-3887
Email: dsg@mitre.org



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Multiple frame problem
  2000-05-01 19:49     ` David S. Goldberg
@ 2000-05-04 20:38       ` Reid Rivenburgh
  2000-05-05 17:07         ` David S. Goldberg
  0 siblings, 1 reply; 6+ messages in thread
From: Reid Rivenburgh @ 2000-05-04 20:38 UTC (permalink / raw)


 David S Goldberg writes:

 > Here's my solution which works with XEmacs.  Not sure about Emacs.
 > In my .gnus I have:

 > (defvar dsg-gnus-edit-buffer "*gnusedit*" "place holder for gnus
 > editing")

 > (defun dsg-gnus-buffer-predicate (arg)
  (string= (buffer-name arg) dsg-gnus-edit-buffer))

 > [...]

 > (gnus-add-configuration
 '(message
   (frame 1.0
 > 	  (if (not (buffer-live-p gnus-summary-buffer))
 > 	      (car (cdr (assoc 'group gnus-buffer-configuration)))
 > 	    (car (cdr (assoc 'summary gnus-buffer-configuration))))
 > 	  (vertical (user-position t top 1 left 1 name "Gnus Edit"
 > 				   buffer-predicate
 > 				   dsg-gnus-buffer-predicate)
 > 		    (message 1.0 point)))))

 > What this says is that when I kill or bury whatever is being put in
 > the frame called "Gnus Edit", the buffer it will return to is
 > called "*gnusedit*" which is not used for anything else, and
 > therefore won't likely show up in any other frame.  You can use
 > this as the buffer to find and lower.  Note that you're better off
 > with something like this to do the lowering:

 > (lower-frame (window-frame (get-buffer-window "*gnusedit*" t)))

Thanks again for your help, Dave.  Do you by any chance create the
*gnusedit* buffer beforehand?  I'm using your code, and when I finish
composing something, it returns to the *scratch* buffer, not one
called *gnusedit* (which doesn't exist).

Everything is working pretty well now otherwise, though the lowering
occasionally crashes XEmacs (21.1.9).  I haven't looked into that
yet....

Thanks again,
Reid



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Multiple frame problem
  2000-05-04 20:38       ` Reid Rivenburgh
@ 2000-05-05 17:07         ` David S. Goldberg
  0 siblings, 0 replies; 6+ messages in thread
From: David S. Goldberg @ 2000-05-05 17:07 UTC (permalink / raw)


> Thanks again for your help, Dave.  Do you by any chance create the
> *gnusedit* buffer beforehand?

Yes, in gnus-startup-hook, though in retrospect I could just as easily
do the get-buffer-create in the defvar.  Sorry I missed that detail.
-- 
Dave Goldberg
Post: The Mitre Corporation\MS K207\202 Burlington Rd.\Bedford, MA 01730
Phone: 781-271-3887
Email: dsg@mitre.org



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-05-05 17:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-26 19:54 Multiple frame problem Reid Rivenburgh
2000-04-26 20:47 ` Kai Großjohann
2000-04-26 21:00   ` Reid Rivenburgh
2000-05-01 19:49     ` David S. Goldberg
2000-05-04 20:38       ` Reid Rivenburgh
2000-05-05 17:07         ` David S. Goldberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).