Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6150029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:33:11+00:00 2026-05-23T19:33:11+00:00

Sometimes I launch emacs from the command line with 2 files, as follows: emacs

  • 0

Sometimes I launch emacs from the command line with 2 files, as follows:

emacs foo.txt bar.txt

This opens the emacs window, split vertically:

foo.txt
-------
bar.txt

How can I edit my .emacs file so that they show up side-by-side, like this?:

        |
foo.txt | bar.txt
        |

EDIT: To clarify, I know how to make this happen after emacs has launched (M-x 0, M-x 3, then re-visit bar.txt in the right window). I just want emacs to split side-by-side by default when I launch it, so I don’t have to.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:33:12+00:00Added an answer on May 23, 2026 at 7:33 pm

    Here’s a function that will change a pair of vertical windows to a pair of horizontal windows:

    (defun 2-windows-vertical-to-horizontal ()
      (let ((buffers (mapcar 'window-buffer (window-list))))
        (when (= 2 (length buffers))
          (delete-other-windows)
          (set-window-buffer (split-window-horizontally) (cadr buffers)))))
    

    To do this automatically on startup, add this function to emacs-startup-hook:

    (add-hook 'emacs-startup-hook '2-windows-vertical-to-horizontal)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this command from the Terminal to launch a URL in Firefox: firefox
When I launch the mvn install command, maven sometimes tries to download dependencies that
Sometimes I need to quickly extract some arbitrary data from XML files to put
Sometimes this error occurs: emulator-5554 disconnected! Cancelling ... activity launch'! Please tell me what
I have an application that uses the accelerometer. Sometimes, the application will launch without
Sometimes when I'm editing page or control the .designer files stop being updated with
i'm having sometimes problems when launching my app. From time to time the screen
I keep getting this error ever so often when I launch the debugger to
I have an ncurses app that does the following, sometimes instantly after launch, sometimes
Sometimes when I launch my MVC 3 project it attempts to load the fully

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.