<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><pre style="padding:9.5px;font-family:Monaco,Menlo,Consolas,'Courier New',monospace;font-size:12.8000001907349px;color:rgb(51,51,51);border-radius:4px;margin-top:0px;margin-bottom:10px;line-height:1.5em;word-wrap:break-word;white-space:pre-wrap;border:1px solid rgba(0,0,0,0.14902);background-color:rgb(245,245,245)">(<span style="color:rgb(127,0,127)">defun</span> <span style="color:rgb(0,0,255)">my-new-frame-with-new-scratch</span> ()
  (interactive)
  (<span style="color:rgb(127,0,127)">let</span> ((one-buffer-one-frame t))
    (new-frame-with-new-scratch)))</pre></div><div><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">​So I tried the following:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><pre style="padding:9.5px;font-family:Monaco,Menlo,Consolas,'Courier New',monospace;font-size:12.8000001907349px;color:rgb(51,51,51);border-radius:4px;margin-top:0px;margin-bottom:10px;line-height:1.5em;word-wrap:break-word;white-space:pre-wrap;border:1px solid rgba(0,0,0,0.14902);background-color:rgb(245,245,245)">(defun find-file-same-frame ()<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline">​​</div>
  (interactive)<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline">​​</div>
  (let ((one-bu<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline">​​</div>ffer-one-frame 0))
    (ido-find-f<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline">​​</div>ile)))<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline">​</div></pre><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline">​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.</div></div><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline"><br></div></div><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">​Am I on the right track, or is there a smarter approach?​​</div></div><div dir="ltr"><br></div><div dir="ltr">-- Pete<div><br></div></div></div>
</div>