我刚刚使用 Mx 尝试了 Gnu emacs 23 自动长行换行功能auto-fill-mode
。它完美地工作。现在我.emacs
按如下方式修改了我的文件以始终打开此功能,但它不起作用......
;;; Xemacs backwards compatibility file
(setq user-init-file
(expand-file-name "init.el"
(expand-file-name ".xemacs" "~")))
(setq custom-file
(expand-file-name "custom.el"
(expand-file-name ".xemacs" "~")))
(load-file user-init-file)
(load-file custom-file)
(global-linum-mode t)
;;; Scrollbar on the right
(set-scroll-bar-mode 'right)
;;; Open help file
(find-file "/home/manu/These/Docs/Emacs-Shortcuts")
(split-window-horizontally)
;;; Transparency
;;(set-frame-parameter (selected-frame) 'alpha '(<active> [<inactive>]))
(set-frame-parameter (selected-frame) 'alpha '(85 50))
(add-to-list 'default-frame-alist '(alpha 85 50))
;;; Auto fill to wrap long lines
(add-hook 'text-mode-hook 'turn-on-auto-fill)
Run Code Online (Sandbox Code Playgroud)
我哪里错了?
小智 6
Emacs 23 有visual-line-mode
,它不会更改文本,而是在显示缓冲区时在字边界上换行。对于某些类型的文档,这比 更好auto-fill-mode
,它改变了文本,因此失去了“软”和“硬”换行符之间的区别。
您可以visual-line-mode
使用与 相同的方式自动开启auto-fill-mode
,例如:
(add-hook 'text-mode-hook 'turn-on-visual-line-mode)
Run Code Online (Sandbox Code Playgroud)
根据Emacs 常见问题解答,您可以仅为文本模式(对于一般文本文件)打开自动填充模式
(add-hook 'text-mode-hook 'turn-on-auto-fill)
Run Code Online (Sandbox Code Playgroud)
如果要全局启用自动填充模式(对于所有模式),请将此行添加到您的 ini 文件中:
(setq-default auto-fill-function 'do-auto-fill)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6028 次 |
最近记录: |