怎样在 Emacs 中编辑任意文字区域: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
# 在 Emacs 配置文件中写下: | # 在 Emacs 配置文件中写下: | ||
<syntaxhighlight lang="elisp" line> | <syntaxhighlight lang="elisp" line> | ||
;;; init-edit-textarea-with-emacs.el -*- lexical-binding: t -*- | |||
;;; 在任意输入框,用 Emacs 编辑 | ;;; 在任意输入框,用 Emacs 编辑 | ||
;; https://github.com/stsquad/emacs_chrome | ;;; 与 emacsclient 的 server-start 没有关系,只是名字相似 | ||
;;; https://github.com/stsquad/emacs_chrome | |||
(use-package edit-server | (use-package edit-server | ||
:ensure t | :ensure t | ||
| Line 20: | Line 22: | ||
(minibuffer . t) | (minibuffer . t) | ||
(menu-bar-lines . t)))) | (menu-bar-lines . t)))) | ||
(provide 'init-edit-textarea-with-emacs) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
即可。 | 即可。 | ||
Revision as of 21:42, 20 July 2026
- 在 Firefox 中,安装
Edit with Emacs拓展 - 在 Emacs 中,用 package-list-packages 安装
use-package拓展 - 在 Emacs 配置文件中写下:
;;; init-edit-textarea-with-emacs.el -*- lexical-binding: t -*-
;;; 在任意输入框,用 Emacs 编辑
;;; 与 emacsclient 的 server-start 没有关系,只是名字相似
;;; https://github.com/stsquad/emacs_chrome
(use-package edit-server
:ensure t
:commands edit-server-start
:init (if after-init-time
(edit-server-start)
(add-hook 'after-init-hook
#'(lambda() (edit-server-start))))
:config (setq edit-server-new-frame-alist
'((name . "Edit with Emacs FRAME")
(top . 200)
(left . 200)
(width . 80)
(height . 25)
(minibuffer . t)
(menu-bar-lines . t))))
(provide 'init-edit-textarea-with-emacs)
即可。