关于在 windows 下使用 emacs 的一点总结

粘一下自己在 windows 下开始使用 emacs 的一些经验。

  1. 主要是安装 https://wangz.me/2021-03-17-envir.html , 不过不再需要指定分支了
  2. 配置文件用的自己之前在 Linux 下攒好的配置,几乎没动
  3. 新增这个快捷方式
C:\msys64\mingw64\bin\emacsclientw.exe -n -c -a ""

并且各种文件格式绑定到这个快捷方式以后,基本上就可以使用 emacsclient 秒开各种文件了

  1. 我就是到处搬运了一下,顺便感谢一下这个帖子 windows上用msys2编译native-comp分支踩坑
  2. 上图
1 个赞

如果有人像我一样把 emacs 固定到了任务栏,并且在用 daemon + client 的方式

可能会有这样一个困扰,直接点击任务栏的 emacs 按钮不会打开一个 client,而是一个新的 emacs 实例。

可以这样解决:

  1. Shift + 右键单击任务栏上的 emacs 按钮
  2. 点击属性
  3. 在目标中填入如下内容
C:\msys64\mingw64\bin\emacsclientw.exe -n -c -e "(raise-frame)" -a ""
2 个赞

这个是什么作用?其他参数我也一样,没觉得异常

raise-frame is an interactive built-in function in ‘C source code’.

(raise-frame &optional FRAME)

Bring FRAME to the front, so it occludes any frames it overlaps.
If FRAME is invisible or iconified, make it visible.
If you don’t specify a frame, the selected frame is used.
If Emacs is displaying on an ordinary terminal or some other device which
doesn’t support multiple overlapping frames, this function selects FRAME.

这个参数应该是能把已经打开的emacs窗口显示出来吧,不过如果想实现每次按下emacs按钮就新开一个clinet似乎不需要加这个?

好像是不需要就能直接打开已经存在的窗口,如果要新开可以用鼠标中键。

1 个赞