GNU bug report logs - #35624
log-view-diff regression

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 7 May 2019 22:02:02 UTC

Severity: normal

Tags: patch

Found in version 26.1

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #113 received at 35624 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35624 <at> debbugs.gnu.org
Subject: Re: bug#35624: log-view-diff regression
Date: Fri, 24 May 2019 00:07:25 +0300
[Message part 1 (text/plain, inline)]
>> Maybe just set window-start to the first non-empty line initially,
>> thus moving the empty line out of screen?
>
> Thought about this too. Could work, but the fact that it's not easy to
> "undo" the view if you pressed 'C-p' accidentally is a downside.

"undo" is a minuscule issue, or rather a non-issue at all,
whereas the idea is good.  Created a feature request bug#35860

>>> If you really must have it this way, do we have an example of invisible
>>> text expanding when cursor moves inside, and then contracting when it's out
>>> again? Meaning if would look like an empty line you wanted after you press
>>> 'C-p', but not visible at all otherwise.
>>
>> Yes, this is possible:
>
> It almost works fine, but going from the second log entry to the first with
> 'p' while at bol leads to the first (empty) line becoming visible.

Asked about this in http://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00827.html
and the answer was to use reveal-mode.

> BTW, if we implement this, here's something we could add as well:
>
> Instead of the empty line, how about it will contain some quick help string
> for the 'd' command, so that the user is not too puzzled if they hit 'C-p'
> by accident?

Good idea, added too:

[vc-git-print-log-reveal-mode.patch (text/x-diff, inline)]
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index b6feb3b8d1..1637f1106f 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1018,7 +1018,10 @@ vc-git-print-log
     ;; read-only.
     (let ((inhibit-read-only t))
       (with-current-buffer buffer
-	(insert "\n")
+        (overlay-put (make-overlay (point) (progn (insert (propertize "\n" 'help-echo
+          "You can use `d' on the top empty line to compare with the current working revision"))
+          (point)))
+          'invisible t)
 	(apply 'vc-git-command buffer
 	       'async files
 	       (append
@@ -1122,7 +1125,8 @@ vc-git-log-view-mode
 	     (1 'change-log-acknowledgment)
 	     (2 'change-log-acknowledgment))
 	    ("^Date:   \\(.+\\)" (1 'change-log-date))
-	    ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))))
+	    ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message))))))
+  (reveal-mode 1))
 
 
 (defun vc-git-show-log-entry (revision)

This bug report was last modified 5 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.