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 8438411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:42:29+00:00 2026-06-10T07:42:29+00:00

In emacs off late I have had to write some lines of code which

  • 0

In emacs off late I have had to write some lines of code which are quite repetitive in nature. Consecutive lines are almost exactly the same except for some trivial modifications.

Is there a keystroke in emacs by which the line the cursor (point) currently on gets duplicated onto the next line. To generalize this, if I could specifiy which line number
onto which I want to paste the current line, that would also be great.

  • 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-10T07:42:30+00:00Added an answer on June 10, 2026 at 7:42 am

    I tend to use the following:

    Select a region, and then C-x r x. Where r is the name of the register; a single character on your keyboard can serve as the register.

    Then C-x g r where you want to insert whatever line you saved in register r.

    You can bind these 2 commands to shortcut keys to make your task even easier.

    The benefit of using registers is that you can save different lines in different registers and recall them at any time. Also if you do C-k and kill a line, it won’t interfere with your saved registers.

    I hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In some of my programming, off late, I have often had to manually enter
I use Cocoa Emacs 23.1.91 and I want to always have hl-line-mode turned off
Some Emacs package I use has turned off the find-file confirmation for choosing a
I have tried emacs on and off for a while now and every time
Emacs and Java change propagation Hi, I'm mostly used to code in IDE like
I'm coding in Python and I really like Notepad++. However, off late when I
In emacs, it is possible to start a file off with a line this:
I have been using emacs for a while for mainly python programming, and have
I'm a starter with Emacs (but quite experienced Vim user) and trying to play
I have pydbgr working well now in Emacs 23.2 with virtualenv . But I

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.