Emacs-everywhere在MAC中的设置方法

Emacs-everywhere越来越重要,因为需要调用Emacs中封装的Chatgpt的API来对所有编辑的文本进行润色。 而Emacs是GNU的嫡系,所以对非GNU系统支持不好。 如要完美设置Emacs-everywhere,需要以下步骤,

  (defun my-emacs-everywhere-set-frame-position ()
    (let* ((frame (selected-frame))
           (frame-width (frame-pixel-width frame))
           (frame-height (frame-pixel-height frame))
           (screen-width (display-pixel-width))
           (screen-height (display-pixel-height))
           (pos-x (/ (- screen-width frame-width) 2))
           (pos-y (/ (- screen-height frame-height) 2)))
      (set-frame-position frame pos-x pos-y)))

  (advice-add 'emacs-everywhere-set-frame-position :around #'my-emacs-everywhere-set-frame-position)

以上,就可以自由自在地在任何程序中使用Emacs了! 然后就,

再没有心的沙漠!再没有爱的荒原!

石见 石页 /
在共享协议(CC)下发布于
类别: technology 
标签: emacs  emacs-everywhere  mac  配置  中