emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/backports-25.2 344bc2b 17/46: Strip out some leadi


From: Noam Postavsky
Subject: [Emacs-diffs] scratch/backports-25.2 344bc2b 17/46: Strip out some leading whitespace when looking at logs
Date: Sun, 2 Oct 2016 14:04:48 +0000 (UTC)

branch: scratch/backports-25.2
commit 344bc2b7c0f073b8b328e4c0bca9a12de5f4e219
Author: Dima Kogan <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Strip out some leading whitespace when looking at logs
    
    * lisp/vc/vc-git.el (vc-git-expanded-log-entry): When looking
    at expanded git logs with `vc-print-root-log' (C-x v L, then
    <enter> by default), Emacs was stripping out all leading
    whitespace from git logs.  I now strip exactly 2 leading
    spaces, which retains the indentation in the logs (bug#18110).
    
    (cherry picked from commit e8146d49b04232348edb7b4fff339c89de4e8a76)
---
 lisp/vc/vc-git.el |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 9eac5b2..bd64599 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1005,7 +1005,9 @@ or BRANCH^ (where \"^\" can be repeated)."
     (goto-char (point-min))
     (unless (eobp)
       ;; Indent the expanded log entry.
-      (indent-region (point-min) (point-max) 2)
+      (while (re-search-forward "^  " nil t)
+        (replace-match "")
+        (forward-line))
       (buffer-string))))
 
 (defun vc-git-region-history (file buffer lfrom lto)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]