[OS X Emacs] opening *some* files in same window

Pete Siemsen siemsen at ucar.edu
Wed Aug 26 11:19:56 EDT 2015


In general, I like that Aquamacs opens new files in new windows (frames).
But I think I might sometimes like it better if it opened similar files in
the same window. For example, if I'm editing several Perl files that are
part of one program, I might like to handle them in the same window. I'd
like a "find-file-same-frame" command. I understand that I can use
open-buffer-one-frame-mode to set the behavior, but I'd like some guidance
as to how to do it elegantly.

I looked around a bit and found, in the Aquamacs Wiki under "Customize
Aquamacs" a description of how to define a function that does the opposite
of what I want, like so:

(defun my-new-frame-with-new-scratch ()
  (interactive)
  (let ((one-buffer-one-frame t))
    (new-frame-with-new-scratch)))

​So I tried the following:

(defun find-file-same-frame ()
​​

  (interactive)
​​

  (let ((one-bu
​​
ffer-one-frame 0))
    (ido-find-f
​​
ile)))
​

​This just opens the file, in a new window. I think ido-find-file forces it
to open in a new window, regardless of the setting of one-buffer-one-frame.

​Am I on the right track, or is there a smarter approach?​​

-- Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-emacs/attachments/20150826/c79a8144/attachment.html>


More information about the MacOSX-Emacs mailing list