【问题标题】:How to use a different diff command for Emacs and Shell (in terminal)?如何为 Emacs 和 Shell(在终端中)使用不同的 diff 命令?
【发布时间】:2017-01-18 20:26:16
【问题描述】:

我使用从 Cygwin 终端(在 Windows 上)启动的图形 Emacs-w32 进行所有编辑,并使用 Zsh(在 MinTTY 中)运行命令。

我在~/.subversion/config 中设置了diff-cmd = colordiff,虽然这会在终端中生成漂亮的颜色(对于svn log),但这会导致添加颜色转义码输出,当在 Emacs 中进行比较时,会导致 Emacs 中出现未着色、不可读的差异

对此最明智的解决办法是什么?

【问题讨论】:

    标签: shell svn emacs colors diff


    【解决方案1】:

    试试 EmacsWiki 中的这个解决方案:

    如果你在 svn 中使用 colordiff,也许你需要这个:

    (add-hook 'diff-mode-hook 
        '(lambda () 
            (require 'ansi-color)
            (ansi-color-apply-on-region (point-min) (point-max))))
    

    来源:https://www.emacswiki.org/emacs/VersionControl

    顺便说一句:在网上搜索“emacs svn colordiff”将其列为前 5 名...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-28
      • 2015-04-18
      • 2014-02-07
      • 1970-01-01
      • 2013-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多