10

git format-patch (統一されたパッチ形式) を使用して作成された diff ファイルがある場合、同じファイルを emacs にロードして Cc Cc を使用してファイル内のそれぞれの場所に移動できるようにするにはどうすればよいですか?ウィンドウでは、スペースが含まれています。

私のプロジェクトには、スペースを含むファイル名とディレクトリ名が多数含まれています。

4

1 に答える 1

3

これは Emacs のバグのようです。これは私のためにそれを修正するように見えるパッチです:

=== modified file 'lisp/vc/diff-mode.el'
--- lisp/vc/diff-mode.el    2013-01-02 16:13:04 +0000
+++ lisp/vc/diff-mode.el    2013-02-26 05:08:48 +0000
@@ -821,9 +821,11 @@ If the OLD prefix arg is passed, tell th
               (progn (diff-hunk-prev) (point))
             (error (point-min)))))
      (header-files
-      (if (looking-at "[-*][-*][-*] \\(\\S-+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(\\S-+\\)")
-          (list (if old (match-string 1) (match-string 3))
-            (if old (match-string 3) (match-string 1)))
+           ;; handle filenames with spaces;
+           ;; cf. diff-font-lock-keywords / diff-file-header-face
+      (if (looking-at "[-*][-*][-*] \\([^\t]+\\)\t.*\n[-+][-+][-+] \\([^\t]+\\)")
+          (list (if old (match-string 1) (match-string 2))
+            (if old (match-string 2) (match-string 1)))
         (forward-line 1) nil)))
       (delq nil
        (append

異議がなければ、Emacs bzr ソースツリーにコミットします。

于 2013-02-26T05:14:11.920 に答える