1

I use split-frame (split-window-right in setup) for most things but would like Emacs to open some file types (specifically PDF files) in a new frame when using find-file.

Other files (for example .org files) should be opened in split-frame as before. I use pdf-tools for viewing PDFs.

Any suggestions welcome.

Drew
  • 75,699
  • 9
  • 109
  • 225
Erik
  • 123
  • 9
  • Here is a link to a complex example of how to target a specific frame with buffers or filenames matching a particular regexp: https://stackoverflow.com/questions/18346785/how-to-intercept-a-file-before-it-opens-and-decide-which-frame If you Google a bit, you'll find simpler examples using the `display-buffer-alist` and also the `special-display-regexps`. See also the two examples in the manual for some additional ideas: https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Action-Functions.html – lawlist Jun 12 '18 at 09:23
  • As @lawlist suggested, see variables `special-display-regexps` and `special-display-buffer-names`. Put the PDF buffers in dedicated windows. Alternatively, can fiddle with `display-buffer-alist`. – Drew Jun 12 '18 at 13:20
  • I tried `(add-to-list 'special-display-regexps ".*\.pdf$")` but no luck. – Erik Jun 15 '18 at 12:01

0 Answers0