Windows 上的 Emacs for C++开发配置?

发布于 2024-09-01 13:01:12 字数 355 浏览 9 评论 0 原文

有人设置 cygwin 和一些 emacs 在 64 位 Windows 7 下运行良好吗?

我最近尝试下载 cygwin,默认情况下连 dired 都不能可靠地工作,有奇怪的 shell 提示字符,我收到很多警告,在一种情况下 Cc 被读为 Cg 并导致各种错误。 (xemacs 和 emacs 都不适合我,其中“工作”我的意思是 dired 和 shell 工作,并且没有警告)。

我只希望常用的 emacs 开发工具:gdb 模式、shell 模式、编译、标签搜索能够正常工作。

我希望最近使用 cygwin 完成此操作的人可以共享任何相关的 shell 文件、emacs 文件、环境变量等以使这一切正常工作。所有这些东西都应该开箱即用吗?

Has anyone set up cygwin and some emacs to work well under a 64-bit Windows 7?

I tried downloading cygwin recently, and by default not even dired works reliably, there are odd shell prompt characters, I get a lot of warnings, in one case C-c was read as C-g and caused various errors. (Neither xemacs nor emacs worked for me, where by "work" I mean that dired and shell work, and without warnings).

I just want the usual emacs development tools: gdb-mode, shell-mode, compiling, tag-search to work as normal.

I was hoping someone who has done this recently with cygwin could share whatever relevant shell files, emacs files, environment variables, and so on to make this all work. Should all these things just work out of the box?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不即不离 2024-09-08 13:01:12

您应该检查一下 ntemacs,在 .emacs 中使用此代码,一切都可以与 cygwin 配合使用:

;; -- sets up cygwin
(let* ((cygwin-root "c:/cygwin")
  (cygwin-bin (concat cygwin-root "/bin")))
(when (and (eq 'windows-nt system-type)
  (file-readable-p cygwin-root))
(setq exec-path (cons cygwin-bin exec-path))
(setenv "PATH" (concat cygwin-bin ";" (getenv "PATH")))
(setq shell-file-name "bash")
(setenv "SHELL" shell-file-name) 
(setq explicit-shell-file-name shell-file-name) 
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)))

You should check out ntemacs, with this code in your .emacs everything is working great with cygwin:

;; -- sets up cygwin
(let* ((cygwin-root "c:/cygwin")
  (cygwin-bin (concat cygwin-root "/bin")))
(when (and (eq 'windows-nt system-type)
  (file-readable-p cygwin-root))
(setq exec-path (cons cygwin-bin exec-path))
(setenv "PATH" (concat cygwin-bin ";" (getenv "PATH")))
(setq shell-file-name "bash")
(setenv "SHELL" shell-file-name) 
(setq explicit-shell-file-name shell-file-name) 
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)))
Oo萌小芽oO 2024-09-08 13:01:12

我使用了“原生”Win32 emacs 的可怕的弗兰肯斯坦组合(http://alpha.gnu.org/gnu/emacs/pretest/windows/emacs-23.1.97-bin-i386.zip 是最新的,但我使用的是旧版本)和 Cygwin——用于 bash、find 等。我花了很多年的时间才根据自己的喜好调整东西,这仍然是一个相当坎坷的经历。

无论如何都值得尝试。

I use a hideous Frankenstein mix of "native" Win32 emacs (http://alpha.gnu.org/gnu/emacs/pretest/windows/emacs-23.1.97-bin-i386.zip is the latest, but I'm using an older version) and Cygwin -- for bash, find, etc. It's taken me years to tweak things to my liking, and it's still a pretty bumpy experience.

Anyway it's worth trying.

美男兮 2024-09-08 13:01:12

我使用 Cygwin 中直接全新安装的 Emacs、gcc、gdb、make 等(目前为 1.7.15,但我已经这样做很多年了)和我的标准点文件(.emacs、.bashrc/.bash_profile)经过调整(但不是很严重)以在 Linux 和 Cygwin 之间移植,一切对我来说都工作得很好。有时我会遇到问题(例如 processing2-mode ,其中处理还没有 Cygwin 包,所以它需要本机 Windows 路径,但这很容易修复并且与众不同,在我看来,您的设置似乎从根本上被破坏了;否则我只能建议擦除并进行清理。重新安装。

I use a straight clean install of Emacs, gcc, gdb, make, etc from Cygwin (currently 1.7.15, but I've been doing this for years) and my standard dotfiles (.emacs, .bashrc/.bash_profile) that have been tweaked (but not really heavily) to be portable across Linux and Cygwin, and everything works fine for me. Occasionally I run into problems (like with processing2-mode where Processing doesn't have a Cygwin package yet, so it wants native Windows paths, but that's easily enough fixed and out of the ordinary. It almost sounds to me like something is fundamentally broken on your setup; could you give more details? Otherwise all I can recommend is wipe and do a clean reinstall.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文