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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:18:18+00:00 2026-05-12T19:18:18+00:00

I have been researching how to get Cygwin to work under emacs . I

  • 0

I have been researching how to get Cygwin to work under emacs. I have it working, but now I want to write a macro that will do the following:

  • Launch by typing M-x cygwin
  • Have the script stored in some obvious place (probably my .emacs file)
  • M-x shell
  • Rename the buffer to cygwin (or cygwin1, cygwin2, cygwin3, … if cygwin exists) probably using M-x rename-buffer
  • M-x ansi-color-for-comint-mode-on
  • M-x set-buffer-process-coding-system ‘undecided-unix ‘undecided-unix
  • Open and run cygwin

It will basically do all of the above steps. I think most of the organization for this little project is done. How do I tie it all together so I can just type M-x cygwin and see a happy new cygwin buffer? What exactly needs to be added to .emacs? Also, where exactly is .emacs in Windows?

I still want the ability to run M-x shell for the windows shell for now. I may also make similar macros for MSYS and ssh’ing to my Linux boxes. How do I get started?

  • 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-12T19:18:18+00:00Added an answer on May 12, 2026 at 7:18 pm

    Many questions, here are some answers:

    Your .emacs can exist many places, it depends, read here. In short try C-x C-f .emacs, or check the value of the variable 'user-init-file (C-h v user-init-file).

    I think the command you want is something along the lines of this:

    (require 'comint) ; this does require comint
    (defun cygwin ()
      "do what i want for cygwin"
      (interactive)
      (let ((buffer (get-buffer-create (generate-new-buffer-name "cygwin"))))
        (pop-to-buffer buffer)
        (unless (comint-check-proc buffer)
          (apply 'make-comint-in-buffer (buffer-name buffer) buffer "c:/cygwin/Cygwin.bat"
                 nil
                 nil)
          (ansi-color-for-comint-mode-on)
          (set-buffer-process-coding-system 'undecided-unix 'undecided-unix))))
    

    Note: I directly ran the process Cygwin.bat instead of running shell and then starting that batch program. I believe the effect is the same, and more straight forward. I did choose the easy way out for naming the buffer (using 'generate-new-buffer-name) – you’ll want to customize to what you want.

    You can dump the above command in your .emacs easiest by doing the C-x C-f .emacs and pasting it in the buffer that gets opened up. Save it and restart (or do M-x eval-defun when your cursor is in the body of that command. Then M-x cygwin will run the command.

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

Sidebar

Related Questions

I've been researching but I just can't seem to get it right. I have
I have been researching a way to get the SQL statements that are built
I have been working with a few applications that deal with NSURLConnections. While researching
I have been researching this for a while but got no convinced answer. From
I've been researching for a bit now and now I have to decide which
I have been scratching my head since long now but not getting around to
I've been researching this for a while now and cant get a straight answer.
I have been researching this topic for a few days now and i'm still
I have been researching for this and read different opinions but i wanted to
I have been researching this issue for long. But I haven't come across any

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.