如何在 Emacs 空白模式下不显示换行符

发布于 2024-11-26 17:59:15 字数 141 浏览 0 评论 0原文

我在 Emacs 中设置了空白模式,仅显示制表符、空格和硬空格。但是,我无法摆脱换行符。请参阅以下屏幕截图,它们显示为灰色光标:

Screenshot

I have set up the Blank Mode in Emacs to display tabs, spaces and hard spaces only. However, I cannot get rid of the newline character. See the following screenshot, they are shown as the grey colored cursors:

Screenshot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的往事 2024-12-03 17:59:15

您需要编辑您的 emacs 配置(您尚未向我们展示!)以从 blank-chars BlankMode 选项中删除 newline 元素。

根据 BlankMode 文档,blank-chars 选项确定 BlankMode 可视化哪些空白字符。

来自 blank-mode.el 包 中的长文档:

(defcustom blank-chars
  '(tabs spaces trailing lines space-before-tab newline
     indentation empty space-after-tab)
  "*Specify which kind of blank is visualized.

It's a list which element value can be:

   trailing     trailing blanks are visualized.

   tabs     TABs are visualized.

   spaces       SPACEs and HARD SPACEs are visualized.

   lines        lines whose have columns beyond
            `blank-line-column' are highlighted.
            Whole line is highlighted.
            It has precedence over
            `lines-tail' (see below).

   lines-tail   lines whose have columns beyond
            `blank-line-column' are highlighted.
            But only the part of line which goes
            beyond `blank-line-column' column.
            It has effect only if `lines' (see above)
            is not present in `blank-chars'.

   space-before-tab SPACEs before TAB are visualized.

   newline      NEWLINEs are visualized.

   indentation  8 or more SPACEs at beginning of line are
            visualized.

   empty        empty lines at beginning and/or end of buffer
            are visualized.

   space-after-tab  8 or more SPACEs after a TAB are visualized.

Any other value is ignored.

You need to edit your emacs config (which you have not shown us!) to remove the newline element from the blank-chars BlankMode option.

According to the BlankMode documentation, the blank-chars option determines which blank characters are visualized by BlankMode.

From the long documentation in the blank-mode.el package:

(defcustom blank-chars
  '(tabs spaces trailing lines space-before-tab newline
     indentation empty space-after-tab)
  "*Specify which kind of blank is visualized.

It's a list which element value can be:

   trailing     trailing blanks are visualized.

   tabs     TABs are visualized.

   spaces       SPACEs and HARD SPACEs are visualized.

   lines        lines whose have columns beyond
            `blank-line-column' are highlighted.
            Whole line is highlighted.
            It has precedence over
            `lines-tail' (see below).

   lines-tail   lines whose have columns beyond
            `blank-line-column' are highlighted.
            But only the part of line which goes
            beyond `blank-line-column' column.
            It has effect only if `lines' (see above)
            is not present in `blank-chars'.

   space-before-tab SPACEs before TAB are visualized.

   newline      NEWLINEs are visualized.

   indentation  8 or more SPACEs at beginning of line are
            visualized.

   empty        empty lines at beginning and/or end of buffer
            are visualized.

   space-after-tab  8 or more SPACEs after a TAB are visualized.

Any other value is ignored.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文