双击同一emacs框架中的打开.txt文件(如果当前打开)

oct*_*cti 9 windows emacs

我想在Windows中双击打开它们时将emacs设置为文本文件的默认编辑器.但是我想在emacs(即框架)的同一个运行实例中打开它们作为缓冲区,如果有的话.现在,该行为将打开另一个emacs实例(即另一个emacs框架).

有谁知道init.el中的哪个规范会允许这种行为?

Ben*_*Ben 9

我一直在使用这个人的方法,这是向注册表添加条目的替代方法.我在这里重现了他的步骤:

  • 创建以下批处理文件'runemacsclientw.bat'.
::::::::::::::::::::::::::::::::::::::::::::::::::
:::
::: Emacsclient startup script runemacsclientw.bat
::: Robert Adesam, robert@adesam.se
::: http://www.adesam.se/robert/
:::
::: N.B. Alot of this is reused from other Emacs
::: users that have published stuff on the
::: Internet. Thank you! :)
::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
:: Emacs binaries...
set binpath=c:\Program Files\emacs\bin
:: If no arg is given set filename to c:\
if "%~1"=="" (
  set filename=c:\
) else (
  set filename=%~1
)
:: Run Emacsclient
"%binpath%\emacsclientw.exe" --no-wait --alternate-editor="%binpath%\runemacs.exe" "%filename%"
  • 使用bat to exe转换器将bat文件转换为exe
    • 选择批处理文件.
    • 检查'隐形应用程序'.
    • 在"版本信息"下选择一个图标(如果你想让它变得清晰)
    • 编译并退出.
  • 将'runemacsclientw.bat'复制到.../emacs/bin.
  • 将文件类型与runemacsclientw.bat关联.
  • 将(server-start)添加到init文件.
  • 将〜/ .emacs.d/server的所有者(在%appdata%中)更改为当前用户(默认为本地管理员).这将删除"不安全的目录〜/ .emacs.d/server"警告.