unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* basic question: reusing frame when opening Emacs file
@ 2006-03-01 22:49 Peter Tury
  2006-03-02  0:14 ` B. T. Raven
  2006-03-02 15:50 ` Peter Tury
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Tury @ 2006-03-01 22:49 UTC (permalink / raw)


Hi,

Emacs opens the files always in a new frame. How to avoid this? I mean: I
would like to have just one frame unless I directly create a new one via
e.g. File > New frame. But now, if I press Enter on a file what is
associated with Emacs, a new frame is created for that file.

I use EmacsW32 (P060106) on MS Windows XP.

My Emacs files are opened by D:\Program
Files\Emacs_P060106\EmacsW32\bin\gnuclientw.exe -sqf "%1" if I press Enter
(I guess).

I have (setq gnuserv-frame (selected-frame)) in my .emacs, its value is
#<frame  *Minibuf-1* - Emacs 0x1409c00>
after a fresh start. (It doesn't help if I modify it to e.g. 
#<frame .emacs - Emacs 0x1409c00>, neither if I comment this out in my
.emacs.)

special-display-buffer-names is nil
special-display-regexps is nil
same-window-buffer-names is ("*shell*" "*mail*" "*inferior-lisp*" "*ielm*"
"*scheme*")
same-window-regexps is ("\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)"
"\\*telnet-.*\\*\\(\\|<[0-9]+>\\)" "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)"
"\\*info\\*\\(\\|<[0-9]+>\\)" "\\*gud-.*\\*\\(\\|<[0-9]+>\\)"
"\\`\\*Customiz.*\\*\\'")

gnuserv-reuseframe is gnuserv-find-files-frame

What to check/modify?

Thanks,
P

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

* Re: basic question: reusing frame when opening Emacs file
  2006-03-01 22:49 basic question: reusing frame when opening Emacs file Peter Tury
@ 2006-03-02  0:14 ` B. T. Raven
  2006-03-02  8:47   ` Peter Tury
  2006-03-02 15:50 ` Peter Tury
  1 sibling, 1 reply; 4+ messages in thread
From: B. T. Raven @ 2006-03-02  0:14 UTC (permalink / raw)



"Peter Tury" <tury.peter@gmail.com> wrote in message
news:jbdkui9mi4lz$.1lmnhcqbred0b.dlg@40tude.net...
> Hi,
>
> Emacs opens the files always in a new frame. How to avoid this? I mean:
I
> would like to have just one frame unless I directly create a new one via
> e.g. File > New frame. But now, if I press Enter on a file what is
> associated with Emacs, a new frame is created for that file.
>
> I use EmacsW32 (P060106) on MS Windows XP.
>
> My Emacs files are opened by D:\Program
> Files\Emacs_P060106\EmacsW32\bin\gnuclientw.exe -sqf "%1" if I press
Enter
> (I guess).
>
> I have (setq gnuserv-frame (selected-frame)) in my .emacs, its value is
> #<frame  *Minibuf-1* - Emacs 0x1409c00>
> after a fresh start. (It doesn't help if I modify it to e.g.
> #<frame .emacs - Emacs 0x1409c00>, neither if I comment this out in my
> .emacs.)
>
> special-display-buffer-names is nil
> special-display-regexps is nil
> same-window-buffer-names is ("*shell*" "*mail*" "*inferior-lisp*"
"*ielm*"
> "*scheme*")
> same-window-regexps is ("\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)"
> "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)" "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)"
> "\\*info\\*\\(\\|<[0-9]+>\\)" "\\*gud-.*\\*\\(\\|<[0-9]+>\\)"
> "\\`\\*Customiz.*\\*\\'")
>
> gnuserv-reuseframe is gnuserv-find-files-frame
>
> What to check/modify?
>
> Thanks,
> P

Are you sure that you are not opening another instance of emacs? This is
even more resource exhausting that a new frame for every file. That's what
happened here when I associated a file extension with emacs. (Using
22.0.50.1 on msw 98.) Why not have emacs look for the file instead of
versa vice?

Ed

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

* Re: basic question: reusing frame when opening Emacs file
  2006-03-02  0:14 ` B. T. Raven
@ 2006-03-02  8:47   ` Peter Tury
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Tury @ 2006-03-02  8:47 UTC (permalink / raw)


On Thu, 02 Mar 2006 00:14:08 GMT, B. T. Raven wrote:

> Are you sure that you are not opening another instance of emacs?

Thanks for the idea, but yes, I am sure: I see all the buffers in both
frames, and if I close one frame, I still have the "newly visited" file in
a buffer in the other frame.

Some more info: it seems that initial-frame-alist is not used for the new
frame, but some default values.

I tried some other things: if I try to visit a file what is already opened
then I get a new frame for it if it wasn't in "the upmost" (the "active"?)
buffer in any frames (but the file is not opened again, in a new buffer:
just the existing buffer is "activated" in a new frame); but if the buffer
is "active" in a frame, then just that frame is "activated".

Should I check some hook running at file opening? What? How?

> Why not have emacs look for the file instead of versa vice?

Sometimes this way is easier: e.g. when I am at the file in TotalCommander
already, it is easier to press enter than switching (by hand) to emacs and
locate the same file...

Thanks,
P

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

* Re: basic question: reusing frame when opening Emacs file
  2006-03-01 22:49 basic question: reusing frame when opening Emacs file Peter Tury
  2006-03-02  0:14 ` B. T. Raven
@ 2006-03-02 15:50 ` Peter Tury
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Tury @ 2006-03-02 15:50 UTC (permalink / raw)


On Wed, 1 Mar 2006 23:49:59 +0100, Peter Tury wrote:

> Hi,
> 
> Emacs opens the files always in a new frame. How to avoid this? I mean: I
> would like to have just one frame unless I directly create a new one via
> e.g. File > New frame. But now, if I press Enter on a file what is
> associated with Emacs, a new frame is created for that file.
> 
> I use EmacsW32 (P060106) on MS Windows XP.
> 
> gnuserv-reuseframe is gnuserv-find-files-frame

Finally I identified the problem: gnuserv-reuseframe works in another way
as I expected. Now I modified it for myself: I changed its last line from
use-frame))
to
 (if (eq use-frame nil) (selected-frame)
      use-frame)))

Now it seems to work as I wanted. Maybe this kind of operation could be
added as a new alternative besides the existing ones?

Br,
P

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

end of thread, other threads:[~2006-03-02 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-01 22:49 basic question: reusing frame when opening Emacs file Peter Tury
2006-03-02  0:14 ` B. T. Raven
2006-03-02  8:47   ` Peter Tury
2006-03-02 15:50 ` Peter Tury

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 read-only IMAP folder(s) and NNTP newsgroup(s).