macos 在 Mac 上升级控制台 emacs (/usr/bin/emacs)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8005115/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 08:34:20  来源:igfitidea点击:

upgrading console emacs (/usr/bin/emacs) on Mac

macosemacsconsole

提问by eugene

I extensively use /usr/bin/emacsin Terminal.

/usr/bin/emacs在终端中广泛使用。

I have Emacs 22 and I'd like to upgrade it to 23. I wonder how to do it.
Googling "emacs download mac" gives me Emacs.appwhich has its own window and user interface, but I don't want that.

我有 Emacs 22,我想将它升级到 23。我想知道如何去做。
谷歌搜索“emacs 下载 mac”给了我Emacs.app它有自己的窗口和用户界面,但我不想要那个。

I am not sure how I have /usr/bin/emacs in the first place, maybe it came with Mac OS?

我不确定我是如何拥有 /usr/bin/emacs 的,也许它是 Mac OS 附带的?

回答by Asher L.

You can run the Emacs.app version in a terminal like this:

您可以在终端中运行 Emacs.app 版本,如下所示:

/Applications/Emacs.app/Contents/MacOS/Emacs -nw

In my .cshrc file, I use an alias to make this easier to invoke:

在我的 .cshrc 文件中,我使用别名来使调用更容易:

alias enw '/Applications/Emacs.app/Contents/MacOS/Emacs -nw'

回答by prodigitalson

It is a standard editor included with OS X and a lot of other *nix systems along with vi/vim, and pico. Personally i wouldnt upgrade the pre-installed one. I would install from Macports, Fink, or Homebrew or compile from source myself to a different location (like /usr/local).

它是 OS X 和许多其他 *nix 系统以及 vi/vim 和 pico 中包含的标准编辑器。我个人不会升级预装的。我会从 Macports、Fink 或 Homebrew 安装,或者自己从源代码编译到不同的位置(如/usr/local)。

回答by Dan Kruchinin

Install emacs from macports.

macports安装 emacs 。

% sudo port install emacs

Then launch it from the terminal

然后从终端启动它

回答by sumisu3

Or you can install Emacs.app, follow the instructions hereto create a ~/bin/emacsscript and then launch as emacs -nwor any other options.

或者您可以安装Emacs.app,按照此处的说明创建~/bin/emacs脚本,然后作为emacs -nw或任何其他选项启动。

#!/bin/sh
exec /Applications/Emacs.app/Contents/MacOS/Emacs "$@"

回答by Sean H

I was on this same search and ended up installing with Homebrewso I could get the latest version along with several libraries, as described in this answerat the Emacs Stack Exchangesite:

我进行了同样的搜索,最终安装了Homebrew,因此我可以获得最新版本和几个库,如Emacs Stack Exchange站点上的这个答案中所述:

Nowadays, I use just GNU Emacs snapshot builds. These have reasonably good OS X support, and are by far the easiest to install, and best supported by the community.

I used to get them from Emacs for Mac OS X, but now I use Homebrew, because it supports more libraries, notably GNU TLS for encrypted network connections.

All in all: Use brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick:).

现在,我只使用 GNU Emacs 快照构建。它们具有相当不错的 OS X 支持,并且是迄今为止最容易安装的,并且得到社区的最佳支持。

我曾经从 Mac OS X 的 Emacs 获取它们,但现在我使用 Homebrew,因为它支持更多的库,特别是用于加密网络连接的 GNU TLS。

总而言之:使用brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick:)。

(Note that GNU Emacs is what comes preinstalled on Mac OS X, at least on mine as of 10.10.5)

(请注意 GNU Emacs 是预装在 Mac OS X 上的,至少在我的 10.10.5 上是这样)

This added a new Emacs binary at /usr/local/bin/emacs, leaving the existing installation and /usr/bin/emacsin place.

这在 中添加了一个新的 Emacs 二进制文件/usr/local/bin/emacs,保留了现有的安装/usr/bin/emacs

回答by Justin Kaipada

I created a symlink in /usr/local/binpointing to the new version of emacs which was in Applications/Emacs.app/Contents/MacOS/

我创建了一个符号链接,/usr/local/bin指向新版本的 emacsApplications/Emacs.app/Contents/MacOS/