i often make links in Org Mode to files, which should open in emacs, but in another buffer than the one, which contains the link.

It would be the best, if they open in a buffer next to the one I work in.

How can i do that?

  • I don't find very clear what you want, but I suspect you're not clear with the window versus buffer emacs terminology. You could have a look at chapters 19 and 20 of the manual (C-h r) to make sure. – JeanPierre Dec 20 '16 at 13:23
  • You are right. What i want to achieve is, when i click on a link the file should open in a new window next to the window, which contains the link. – tester Dec 20 '16 at 13:34
  • What link types are you trying to open? The default behavior seems to be to open file: links in another window and id: links in the same window. – erikstokes Dec 20 '16 at 17:11
  • This question was also asked and answered on Stack Overflow – erikstokes Dec 20 '16 at 17:13

Please have a look at the variable org-link-frame-setup. In its documentation string you'll find the searched for information.

You might do this with the keyboard sequence C-h v and then typing above name.

  • Yes, but it will require more work to control how window is selected or split. – JeanPierre Dec 20 '16 at 16:03
  • There are four values, but no one is dedicated to links in org documents. – tester Dec 20 '16 at 18:43
  • @tester -- Instead of (file . find-file-other-window) within org-link-frame-setup you want (file . my-custom-find-file-other-window) and write up your custom function -- e.g., see the following thread for an example of how to create a function that targets a specific window: stackoverflow.com/a/41095888/2112489 – lawlist Dec 20 '16 at 22:40
  • @tester -- when you or someone else writes up my-custom-find-file-other-window referred to in the previous comment, beware of dedicated windows that resist being targeted: gnu.org/software/emacs/manual/html_node/elisp/… – lawlist Dec 20 '16 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.