emacs新新手,主要用writeroom-mode来写文本,可为啥英文文本行末出现\,中文后出现\字符,用cat查看又一切正常。这个真是费解,可是没到80列,故意显示换行符?多谢指教。
截个图看看。
一般而言是terminal模式下的换行,看看截图?
关掉 writeroom-mode 就没有了。我想这是由于由于你一行的字太多了导致的,你可以试试 writeroom-increase-width
这个是"视觉换行", 实际上还是同一行字. \
符号就代表这一行和下一行是一行字, 没有拆开.
要想自动插入换行符,可以用
(turn-on-auto-fill)
对对对,但现在问题我不想要这个视觉换行,毫无意义又很annoying。这个怎么能关掉么?
(setq-default truncate-lines nil)
是不想看到\
号,还是不想看到折行?
-
是前者
(setq truncate-lines nil word-wrap t fringe-indicator-alist (cons (cons 'continuation visual-line-fringe-indicators) fringe-indicator-alist))
或开启
visual-line-mode
。 -
是后者就
M-x toggle-truncate-lines
关闭折行,这样也就看不到长行后面的内容了。
周末忙不过来,今天照这个改了下,但是不是想要的结果,"\“消失了,但”$$"出现了,而且文字会不折行,继续写在后面。我有点要崩溃了。 另外cnfonts在terminal下不可用,有啥好的替代么? 多谢
我是想做到1,但照你的方法,还是不行。不知道咋办了。
如果在终端试试这个:
⋊> emacs -Q --eval "\
(progn
(set-display-table-slot standard-display-table 'wrap ?\s)
(insert (make-string 500 ?a)))" -nw
page-break-lines
会使上述设置失效。可借鉴 purcell/page-break-lines#29 提供的方案来解决冲突:
(defun prettify-continuation-indocator (&optional dummy)
(ignore dummy)
(when buffer-display-table
(set-display-table-slot buffer-display-table 'wrap ?↩)))
(unless window-system
(set-display-table-slot standard-display-table 'wrap ?↩)
(add-hook 'window-configuration-change-hook 'prettify-continuation-indocator)
;; 如果还有问题,试着启用以下设置
;; (with-eval-after-load 'page-break-lines
;; (add-hook 'page-break-lines-mode-hook 'prettify-continuation-indocator))
)
按照这个的确""消除了
我不知道你是怎么拷贝的,是不是用了终端拷屏的方式?去掉 -nw
参数试试。
是终端,终端是我主要的使用方式
你是不是使用的拷贝 utility 有问题?
我的是 macos,终端版本 emacs 启用 xclip-mode (你要去 elpa 安装这个包)以后,跨行的长行直接复制 (M-w
) 出来以后并不会换行:
以下是我的屏幕内容:
复制出来粘贴到这里是这样子的:
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
可以看出来并没有换行.
我的终端显示配置是这样子的:
(set-display-table-slot standard-display-table 'truncation 32)
(set-display-table-slot standard-display-table 'wrap 32)
(defun my/display-truncation-and-wrap-indicator-as-whitespace ()
(when (not (char-table-p buffer-display-table))
(setq buffer-display-table (make-display-table)))
(set-display-table-slot buffer-display-table 'truncation 32)
(set-display-table-slot buffer-display-table 'wrap 32))
(add-hook 'prog-mode-hook #'my/display-truncation-and-wrap-indicator-as-whitespace)
(add-hook 'text-mode-hook #'my/display-truncation-and-wrap-indicator-as-whitespace)