简体   繁体   English

在Emacs wc-mode中,如何只在当前缓冲区中计算字符?

[英]in Emacs wc-mode, how to count characters only in current buffer?

I'm using wc-mode to count characters in org-mode. 我正在使用wc-mode来计算org-mode中的字符。 However, when I do org-narrow-to-subtree , my modeline continues to count all the characters in the entire org file. 但是,当我执行org-narrow-to-subtree ,我的模式行继续计算整个org文件中的所有字符。

How do I direct wc-mode to count only the characters in the currently active buffer, ie the current subtree? 如何指示wc-mode仅计算当前活动缓冲区中的字符,即当前子树?

You need to customize wc-modeline-format . 您需要自定义wc-modeline-format The following line, for example, will give you the total number of words and total number of characters in the buffer (even when narrowed). 例如,以下行将为您提供缓冲区中的单词总数和总字符数(即使缩小时)。

(setq wc-modeline-format "[Words: %tw, Chars: %tc]")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM