rg.el deadgrep color-rg 等ripgrep返回的结果显示有折叠

我利用 rg.el deadgrep color-rg 等 package 筛选文字时,如果文件中有特别长的行,返回的结果只显示一部分,未显示的部分由 [...] 替代省略。如何去除这种特性,让所有文字都显示。

具体例子,我的文件中包含这样一句话(这句话落在一整行中)

The ripgrep executable to use. Could be an absolute path or just the base name if the executable is in the path. The default is using executable-find to locate the command. If you want to use this package with tramp it might be better to set it to just “rg” in order to let the OS find the binary where it’s invoked. From 27.1, the tramp use case is by default handled automatically. See rg-executable-per-connection for details.The ripgrep executable to use. Could be an absolute path or just the base name if the executable is in the path. The default is using executable-find to locate the command. If you want to use this package with tramp it might be better to set it to just “rg” in order to let the OS find the binary where it’s invoked. From Emacs 27.1, the tramp use case is by default handled automatically. 

我尝试用 rg.el 包搜索 Emacs 关键词,它在这句话的最后一句,返回的结果是这样的。命中的目标在划红线的省略号中。

这个情况用 deadgrep 或者 color-rg 也是如此。如果将光标移至省略号处,按 enter 键,能打开折叠。

是否可设置为直接显示所有内容,而不是一个个点击?

rg.el 实际上是定制了 compilation-mode 自己没有变量控制

(defcustom compilation-max-output-line-length 400
  "Output lines that are longer than this value will be hidden.
If nil, don't hide anything."
  :type '(choice (const :tag "Hide nothing" nil)
                 integer)
  :version "29.1")

deadgrep

(defvar deadgrep-max-line-length
  500
  "Truncate lines if they are longer than this.

Emacs performance can be really poor with long lines, so this
ensures that searching minified files does not slow down movement
in results buffers.

In extreme cases (100KiB+ single-line files), we can get a stack
overflow on our regexp matchers if we don't apply this.")

color-rg

(defcustom color-rg-max-column 3000
  "When searching for JS library files, the long JS library file will cause color-rg navigation to be very slow.
By default, there are 3000 columns of restrictions to avoid long file problems."
  :type 'integer
  :group 'color-rg)
3 个赞