* emacsclient: create a new frame if one doesn't exist
@ 2012-03-16 17:47 Eddie Hillenbrand
2012-03-16 17:52 ` Juanma Barranquero
2012-03-17 22:36 ` Stefan Monnier
0 siblings, 2 replies; 9+ messages in thread
From: Eddie Hillenbrand @ 2012-03-16 17:47 UTC (permalink / raw
To: emacs-devel
I'm using emacsclient with emacs --daemon, but I find myself wanting a
different behavior than the standard options provide.
It would be nice if emacsclient could create a window system frame
only when one doesn't exist and if one does exist simply reuse that
frame.
I know I can get this behavior by initially invoking emacsclient with
-c and then subsequently invoking it without the -c, however I'd
prefer not to think about whether I need to include the -c when
opening files.
Thankfully there is the --eval option. I wrote some Elisp that can be
passed to emacsclient to provide this behavior, but it occurred to me
that it may be general enough to include in emacsclient as a standard
option.
I'm proposing adding a -C option that would "create a new frame if one
doesn't exist otherwise use the current Emacs frame." I'd be happy to
make the required changes and submit a patch. Is this general enough
to be implemented?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: emacsclient: create a new frame if one doesn't exist
2012-03-16 17:47 emacsclient: create a new frame if one doesn't exist Eddie Hillenbrand
@ 2012-03-16 17:52 ` Juanma Barranquero
2012-03-16 18:39 ` Eddie Hillenbrand
2012-03-17 22:36 ` Stefan Monnier
1 sibling, 1 reply; 9+ messages in thread
From: Juanma Barranquero @ 2012-03-16 17:52 UTC (permalink / raw
To: Eddie Hillenbrand; +Cc: emacs-devel
On Fri, Mar 16, 2012 at 18:47, Eddie Hillenbrand <eh88@nau.edu> wrote:
> I'm proposing adding a -C option that would "create a new frame if one
> doesn't exist otherwise use the current Emacs frame." I'd be happy to
> make the required changes and submit a patch. Is this general enough
> to be implemented?
Can you get what you want via server-window?
Juanma
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: emacsclient: create a new frame if one doesn't exist
2012-03-16 17:52 ` Juanma Barranquero
@ 2012-03-16 18:39 ` Eddie Hillenbrand
2012-03-16 20:09 ` Eddie Hillenbrand
0 siblings, 1 reply; 9+ messages in thread
From: Eddie Hillenbrand @ 2012-03-16 18:39 UTC (permalink / raw
To: Juanma Barranquero; +Cc: emacs-devel
On Mar 16, 2012, at 10:52 AM, Juanma Barranquero wrote:
> On Fri, Mar 16, 2012 at 18:47, Eddie Hillenbrand <eh88@nau.edu> wrote:
>
>> I'm proposing adding a -C option that would "create a new frame if one
>> doesn't exist otherwise use the current Emacs frame." I'd be happy to
>> make the required changes and submit a patch. Is this general enough
>> to be implemented?
>
> Can you get what you want via server-window?
That looks promising.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: emacsclient: create a new frame if one doesn't exist
2012-03-16 18:39 ` Eddie Hillenbrand
@ 2012-03-16 20:09 ` Eddie Hillenbrand
2012-03-16 20:31 ` Juanma Barranquero
0 siblings, 1 reply; 9+ messages in thread
From: Eddie Hillenbrand @ 2012-03-16 20:09 UTC (permalink / raw
To: Juanma Barranquero; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 249 bytes --]
On Mar 16, 2012, at 11:39 AM, Eddie Hillenbrand wrote:
>> Can you get what you want via server-window?
>
> That looks promising.
Unfortunately, the frame is created before this variable is examined. Anything I could do here would be clunky.
[-- Attachment #2: Type: text/html, Size: 1072 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: emacsclient: create a new frame if one doesn't exist
2012-03-16 20:09 ` Eddie Hillenbrand
@ 2012-03-16 20:31 ` Juanma Barranquero
0 siblings, 0 replies; 9+ messages in thread
From: Juanma Barranquero @ 2012-03-16 20:31 UTC (permalink / raw
To: Eddie Hillenbrand; +Cc: emacs-devel
On Fri, Mar 16, 2012 at 21:09, Eddie Hillenbrand <eh88@nau.edu> wrote:
> Unfortunately, the frame is created before this variable is examined.
> Anything I could do here would be clunky.
I suggest you send a bug report to <bug-gnu-emacs@gnu.org>, explaining
what you want to do starting from emacs -Q.
That will help determining whether what you want is a new feature or
some (mis)behavior to fix.
Juanma
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: emacsclient: create a new frame if one doesn't exist
2012-03-16 17:47 emacsclient: create a new frame if one doesn't exist Eddie Hillenbrand
2012-03-16 17:52 ` Juanma Barranquero
@ 2012-03-17 22:36 ` Stefan Monnier
2012-03-19 18:34 ` Eddie Hillenbrand
1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2012-03-17 22:36 UTC (permalink / raw
To: Eddie Hillenbrand; +Cc: emacs-devel
> I'm proposing adding a -C option that would "create a new frame if one
> doesn't exist otherwise use the current Emacs frame."
I think I'd prefer a solution that doesn't require adding options to
emacsclient (i.e. where the choice is expressed via a customization in
.emacs).
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: emacsclient: create a new frame if one doesn't exist
2012-03-17 22:36 ` Stefan Monnier
@ 2012-03-19 18:34 ` Eddie Hillenbrand
2012-03-19 19:57 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Eddie Hillenbrand @ 2012-03-19 18:34 UTC (permalink / raw
To: Stefan Monnier; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 474 bytes --]
On Mar 17, 2012, at 3:36 PM, Stefan Monnier wrote:
> I think I'd prefer a solution that doesn't require adding options to
> emacsclient (i.e. where the choice is expressed via a customization in
> .emacs).
I thought about taking that route, but at the command line the user may want to create a frame if one doesn't exist or the user may want to create a frame regardless of other frames. I'm not sure how to provide both without adding an option to emacsclient.
[-- Attachment #2: Type: text/html, Size: 1250 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: emacsclient: create a new frame if one doesn't exist
2012-03-19 18:34 ` Eddie Hillenbrand
@ 2012-03-19 19:57 ` Stefan Monnier
2012-03-19 23:13 ` Eddie Hillenbrand
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2012-03-19 19:57 UTC (permalink / raw
To: Eddie Hillenbrand; +Cc: emacs-devel
>> I think I'd prefer a solution that doesn't require adding options to
>> emacsclient (i.e. where the choice is expressed via a customization in
>> .emacs).
> I thought about taking that route, but at the command line the user may want
> to create a frame if one doesn't exist or the user may want to
> create a frame regardless of other frames. I'm not sure how to provide both
> without adding an option to emacsclient.
Assuming you manage to get the "reuse frame when possible" to be the
default behavior, than -c will still let the user choose to force
creation of a new frame.
BTW, have you tried
emacsclient --display "$DISPLAY" <file>
-- Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: emacsclient: create a new frame if one doesn't exist
2012-03-19 19:57 ` Stefan Monnier
@ 2012-03-19 23:13 ` Eddie Hillenbrand
0 siblings, 0 replies; 9+ messages in thread
From: Eddie Hillenbrand @ 2012-03-19 23:13 UTC (permalink / raw
To: Stefan Monnier; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 392 bytes --]
On Mar 19, 2012, at 12:57 PM, Stefan Monnier wrote:
> Assuming you manage to get the "reuse frame when possible" to be the
> default behavior, than -c will still let the user choose to force
> creation of a new frame.
I didn't think of that. I like it, that's the way I'll implement it.
> emacsclient --display "$DISPLAY" <file>
On my machine (Mac OS X) that always creates a tty frame.
[-- Attachment #2: Type: text/html, Size: 1797 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-03-19 23:13 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16 17:47 emacsclient: create a new frame if one doesn't exist Eddie Hillenbrand
2012-03-16 17:52 ` Juanma Barranquero
2012-03-16 18:39 ` Eddie Hillenbrand
2012-03-16 20:09 ` Eddie Hillenbrand
2012-03-16 20:31 ` Juanma Barranquero
2012-03-17 22:36 ` Stefan Monnier
2012-03-19 18:34 ` Eddie Hillenbrand
2012-03-19 19:57 ` Stefan Monnier
2012-03-19 23:13 ` Eddie Hillenbrand
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.