<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi, Pete. Is this something you can use the fancy controls of display-buffer-alist for?<div class=""><br class=""></div><div class="">For example, in Aquamacs 3.2, with one-buffer-one-frame-mode enabled, you can use</div><div class="">(set display-buffer-alist</div><div class="">    (cons “<a href="smb://.txt$" class="">\\.txt$</a>” (display-buffer-reuse-window display-buffer-below-selected))</div><div class="">    display-buffer-alist)</div><div class=""><br class=""></div><div class="">which should make buffers with names ending in “.txt” open in a split window in the current frame.</div><div class=""><br class=""></div><div class="">There’s a lot more you can do it with it; that’s just a very basic example.</div><div class=""><br class=""></div><div class="">Best,</div><div class=""><br class=""></div><div class="">Win</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 26, 2015, at 11:19 AM, Pete Siemsen <<a href="mailto:siemsen@ucar.edu" class="">siemsen@ucar.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><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 class=""></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 class=""></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)" class="">(<span style="color:rgb(127,0,127)" class="">defun</span> <span style="color:rgb(0,0,255)" class="">my-new-frame-with-new-scratch</span> ()
  (interactive)
  (<span style="color:rgb(127,0,127)" class="">let</span> ((one-buffer-one-frame t))
    (new-frame-with-new-scratch)))</pre></div><div class=""><div dir="ltr" class=""><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 class=""></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)" class="">(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" class=""><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline"><br class=""></div></div><div dir="ltr" class=""><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" class=""><br class=""></div><div dir="ltr" class="">-- Pete<div class=""><br class=""></div></div></div>
</div>
<br class="">_____________________________________________________________<br class="">MacOSX-Emacs mailing list<br class=""><a href="mailto:MacOSX-Emacs@email.esm.psu.edu" class="">MacOSX-Emacs@email.esm.psu.edu</a><br class="">https://email.esm.psu.edu/mailman/listinfo/macosx-emacs<br class="">List Archives: http://dir.gmane.org/gmane.emacs.macintosh.osx<br class=""></div></blockquote></div><br class=""></div></body></html>