【问题标题】:One compile command per buffer, not directory每个缓冲区一个编译命令,而不是目录
【发布时间】:2014-04-10 17:40:11
【问题描述】:

我经常在一个目录中编辑foo.cppbar.cpp(或foo.texbar.tex)。

在这些编辑会话期间,我多次运行 make foomake bar

在使用 Emacs 23 的某个时候,我只需要在各自的缓冲区上键入一次 make foomake bar。任何后续调用 compile 命令都将重用上次在该缓冲区上使用的命令。

现在使用 Emacs 24.3.50.1,这个设置变得比以前更糟糕了(使用 Emacs 21/22?)。在那里,每个目录保存一个编译命令。现在它是所有缓冲区的一个命令。

如何恢复之前的设置?我对每个带有文件局部变量的 .cpp.tex 文件都对 polluting 感兴趣。

【问题讨论】:

    标签: emacs emacs24 emacs23


    【解决方案1】:

    只需将适用的变量设为缓冲区本地即可。

    (eval-after-load 'compile
      '(progn (make-variable-buffer-local 'compile-command)
              (make-variable-buffer-local 'compile-history)))
    

    【讨论】:

      猜你喜欢
      • 2011-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-08
      • 1970-01-01
      • 1970-01-01
      • 2015-04-11
      相关资源
      最近更新 更多