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

  • Home
  • SEARCH
  • 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 8565339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:24:16+00:00 2026-06-11T17:24:16+00:00

I am very new with emacs and Lisp, though from experience with other functional

  • 0

I am very new with emacs and Lisp, though from experience with other functional languages it’s not too hard for me to mimic what I am seeing in useful code snippets. I’ve added some nice window toggling features in the .emacs file and they are working well.

But on start-up, I’d like to configure a specific arrangement of windows/frames. Basically, I want to do the following each time I launch emacs (which is generally at most once per day and then it is left open for days/weeks).

1. Split the screen in half (C-x 2)
2. Grow the top half bigger by 20 lines (C-u 20 C-x ^)
3. Open a second frame of emacs (C-x 5 2)

Ideally, I’d even like to maximize the first frame on my left monitor and the second frame on my right monitor, but I can do without that.

I am just wondering how you write the function equivalent of the key commands into the .emacs file.

  • 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-06-11T17:24:18+00:00Added an answer on June 11, 2026 at 5:24 pm

    The best feature in Emacs is the self documenting help, so you can easily
    figure out how to write the desired command in Emacs-lisp with experience in
    other languages.

    But because what you want is a straight forward sqeuence of keys, a macro
    would serve you best, and it gives you a good place to start writing

    Here is a keysequence I entered:

     C-x (  C-x 2 C-u 2 0 C-x ^ C-x 5 2 <switch-frame> C-x ) 
    

    I’ve recorded a macro to do what you asked. Then M-x edit-last-kbd-macro, I see:

    ;; Keyboard Macro Editor.  Press C-c C-c to finish; press C-x k RET to cancel.
    ;; Original keys: C-x 2 C-u 20 C-x ^ C-x 5 2
    
    Command: last-kbd-macro
    Key: none
    
    Macro:
    
    
    C-x 2           ;; split-window-below
    C-u 20 C-x ^        ;; enlarge-window
    C-x 5 2         ;; make-frame-command
    

    Then M-x name-last-kbd-macro “foo” M-x insert-kbd-macro “foo”

    (fset 'foo
       [?\C-x ?2 ?\C-u ?2 ?0 ?\C-x ?^ ?\C-x ?5 ?2 (switch-frame #<frame  *Minibuf-1* 0x101855410>)])
    

    Add the last chunk to your .emacs file, and call it with

    (foo)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am very new to iPhone application development. Am adding the events to iCal from
I'm very new to emacs and I'm using version 23.2 on Windows. I'm trying
I am very new to emacs, I am trying to get a directory tree.
I'm very new to emacs, just started yesterday. I'm installing plugins for emacs to
Using Emacs/Magit, I had first a very smooth git experience in another project, but
I'm new to emacs lisp programming. I'm a developer and programming in c on
(very new to JavaScript jQuery) Can an if statement contain a collection of other
Very new to AJAX, but have learned a bit from online tutorials. If I
This is probably a very naive Emacs question - I'm new to it. When
Very new to jQuery, if dupe question sorry at this point not even sure

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.