all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* new frame for emacsclient-emacs (v22)
@ 2007-08-29 15:16 Allan Gottlieb
  2007-08-29 16:15 ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Allan Gottlieb @ 2007-08-29 15:16 UTC (permalink / raw)
  To: help-gnu-emacs

I would like emacsclient-emacs (this is the name of the executable on
my gentoo system; I had thought it was simply emacsclient), to show
the requested file in a new frame.  I have set server-window to
`pop-to-buffer', but that does not create a new frame.

I often invoke emacsclient-emacs from a window-manager
workspace different from the one on which the server emacs is running
so the new buffer is not visible and I must switch workspaces.

I would not like to have all new buffers in the emacs itself displayed
in separate frames, just those invoked by emacsclient-emacs.

thanks,
allan

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

* Re: new frame for emacsclient-emacs (v22)
  2007-08-29 15:16 new frame for emacsclient-emacs (v22) Allan Gottlieb
@ 2007-08-29 16:15 ` Tom Tromey
  2007-08-29 17:05   ` Allan Gottlieb
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2007-08-29 16:15 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "Allan" == Allan Gottlieb <gottlieb@nyu.edu> writes:

Allan> I would like emacsclient-emacs (this is the name of the executable on
Allan> my gentoo system; I had thought it was simply emacsclient), to show
Allan> the requested file in a new frame.  I have set server-window to
Allan> `pop-to-buffer', but that does not create a new frame.

Try setting server-window to a function that makes a frame and
displays your buffer in it.

This is untested but may do what you want:

(defun server-make-frame-for-buffer (buffer)
  (if multiple-frames
      (let ((frame (make-frame)))
        (set-window-buffer (frame-selected-window frame) buffer)
        (select-frame-set-input-focus frame))
    (pop-to-buffer buffer)))

Tom

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

* Re: new frame for emacsclient-emacs (v22)
  2007-08-29 16:15 ` Tom Tromey
@ 2007-08-29 17:05   ` Allan Gottlieb
  2007-08-29 19:36     ` Reiner Steib
  0 siblings, 1 reply; 6+ messages in thread
From: Allan Gottlieb @ 2007-08-29 17:05 UTC (permalink / raw)
  To: help-gnu-emacs

At Wed, 29 Aug 2007 10:15:27 -0600 Tom Tromey <tromey@redhat.com> wrote:

>>>>>> "Allan" == Allan Gottlieb <gottlieb@nyu.edu> writes:
>
> Allan> I would like emacsclient-emacs (this is the name of the executable on
> Allan> my gentoo system; I had thought it was simply emacsclient), to show
> Allan> the requested file in a new frame.  I have set server-window to
> Allan> `pop-to-buffer', but that does not create a new frame.
>
> Try setting server-window to a function that makes a frame and
> displays your buffer in it.
>
> This is untested but may do what you want:
>
> (defun server-make-frame-for-buffer (buffer)
>   (if multiple-frames
>       (let ((frame (make-frame)))
>         (set-window-buffer (frame-selected-window frame) buffer)
>         (select-frame-set-input-focus frame))
>     (pop-to-buffer buffer)))

Thanks.  I changed `multiple-frames' to `window-system' since
sometimes the server emacs has only one frame.

Works very well; thanks again,
allan

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

* Re: new frame for emacsclient-emacs (v22)
  2007-08-29 17:05   ` Allan Gottlieb
@ 2007-08-29 19:36     ` Reiner Steib
  2007-08-29 21:38       ` Allan Gottlieb
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2007-08-29 19:36 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, Aug 29 2007, Allan Gottlieb wrote:

> At Wed, 29 Aug 2007 10:15:27 -0600 Tom Tromey <tromey@redhat.com> wrote:
>>>>>>> "Allan" == Allan Gottlieb <gottlieb@nyu.edu> writes:
>> Allan> I would like emacsclient-emacs (this is the name of the executable on
>> Allan> my gentoo system; I had thought it was simply emacsclient), to show
>> Allan> the requested file in a new frame.  I have set server-window to
>> Allan> `pop-to-buffer', but that does not create a new frame.
>>
>> Try setting server-window to a function that makes a frame and
>> displays your buffer in it.
>>
>> This is untested but may do what you want:
>>
>> (defun server-make-frame-for-buffer (buffer)
>>   (if multiple-frames
>>       (let ((frame (make-frame)))
>>         (set-window-buffer (frame-selected-window frame) buffer)
>>         (select-frame-set-input-focus frame))
>>     (pop-to-buffer buffer)))
>
> Thanks.  I changed `multiple-frames' to `window-system' since
> sometimes the server emacs has only one frame.

Shouldn't the existing customize choice "Display in new frame"
(switch-to-buffer-other-frame) already do the same?  If not, I think
we should add a predefined function doing what Allan expects (I think
this is a very common wish).

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: new frame for emacsclient-emacs (v22)
  2007-08-29 19:36     ` Reiner Steib
@ 2007-08-29 21:38       ` Allan Gottlieb
  2007-08-29 21:47         ` Reiner Steib
  0 siblings, 1 reply; 6+ messages in thread
From: Allan Gottlieb @ 2007-08-29 21:38 UTC (permalink / raw)
  To: help-gnu-emacs

At Wed, 29 Aug 2007 21:36:48 +0200 Reiner Steib <reinersteib+gmane@imap.cc> wrote:

> On Wed, Aug 29 2007, Allan Gottlieb wrote:
>
>> At Wed, 29 Aug 2007 10:15:27 -0600 Tom Tromey <tromey@redhat.com> wrote:
>>>>>>>> "Allan" == Allan Gottlieb <gottlieb@nyu.edu> writes:
>>> Allan> I would like emacsclient-emacs (this is the name of the executable on
>>> Allan> my gentoo system; I had thought it was simply emacsclient), to show
>>> Allan> the requested file in a new frame.  I have set server-window to
>>> Allan> `pop-to-buffer', but that does not create a new frame.
>>>
>>> Try setting server-window to a function that makes a frame and
>>> displays your buffer in it.
>>>
>>> This is untested but may do what you want:
>>>
>>> (defun server-make-frame-for-buffer (buffer)
>>>   (if multiple-frames
>>>       (let ((frame (make-frame)))
>>>         (set-window-buffer (frame-selected-window frame) buffer)
>>>         (select-frame-set-input-focus frame))
>>>     (pop-to-buffer buffer)))
>>
>> Thanks.  I changed `multiple-frames' to `window-system' since
>> sometimes the server emacs has only one frame.
>
> Shouldn't the existing customize choice "Display in new frame"
> (switch-to-buffer-other-frame) already do the same?  If not, I think
> we should add a predefined function doing what Allan expects (I think
> this is a very common wish).

I have emacs-22.1.  When I do
   customize-option    for `server-window'
the only choices I get are
   use selected
   use pop-to-buffer
   other function

Currently I have `other-function' and use my simple adaptation of
tom's code.  It works fine.

I just now changed the `other function' to your suggestion of
switch-to-buffer-other-frame and that also works fine.

If `display in new frame' is available as a customize option in newer
version of emacs, I will change to 'display in new frame' when that
newer version of emacs hits gentoo stable.

If `display in new frame' is not available as a customize option in
emacs, I agree with you that it would be a good addition.

allan

PS thanks for your help with emacs and gnus

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

* Re: new frame for emacsclient-emacs (v22)
  2007-08-29 21:38       ` Allan Gottlieb
@ 2007-08-29 21:47         ` Reiner Steib
  0 siblings, 0 replies; 6+ messages in thread
From: Reiner Steib @ 2007-08-29 21:47 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, Aug 29 2007, Allan Gottlieb wrote:

> If `display  in new frame' is  not available as a  customize option in
> emacs, I agree with you that it would be a good addition.

I looked at the release branch (to-be 22.2) where it is included in
the customize value menu.  In fact, it's not in 22.1.  Stefan Monnier
has added it after the release:
<http://thread.gmane.org/gmane.emacs.devel/75833/focus=75843>.

Please report it as an Emacs bug if `switch-to-buffer-other-frame' for
`server-window' doesn't behave correctly.

> PS thanks for your help with emacs and gnus

You're welcome.  Next time, please respond only to the group/list or
at least make it clear that the mail went to the group/list as well.
I didn't see any trace of this (gnu.emacs.help/help-gnu-emacs) in the
mail I got.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

end of thread, other threads:[~2007-08-29 21:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-29 15:16 new frame for emacsclient-emacs (v22) Allan Gottlieb
2007-08-29 16:15 ` Tom Tromey
2007-08-29 17:05   ` Allan Gottlieb
2007-08-29 19:36     ` Reiner Steib
2007-08-29 21:38       ` Allan Gottlieb
2007-08-29 21:47         ` Reiner Steib

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.