all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 35624@debbugs.gnu.org
Subject: bug#35624: log-view-diff regression
Date: Fri, 24 May 2019 00:07:25 +0300	[thread overview]
Message-ID: <87r28o3mnm.fsf@mail.linkov.net> (raw)
In-Reply-To: <d1c39ed7-0d55-1404-84be-9fdea7edf005@yandex.ru> (Dmitry Gutov's message of "Wed, 22 May 2019 00:52:49 +0300")

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]

>> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: vc-git-print-log-reveal-mode.patch --]
[-- Type: text/x-diff, Size: 936 bytes --]

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)

  parent reply	other threads:[~2019-05-23 21:07 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 21:56 bug#35624: log-view-diff regression Juri Linkov
2019-05-07 22:54 ` Dmitry Gutov
2019-05-08 19:52   ` Juri Linkov
2019-05-09 13:26     ` Dmitry Gutov
2019-05-09 19:41       ` Juri Linkov
2019-05-10  0:14         ` Dmitry Gutov
2019-05-10  7:56           ` Eli Zaretskii
2019-05-11 20:58           ` Juri Linkov
2019-05-13  0:32             ` Dmitry Gutov
2019-05-13 20:40               ` Juri Linkov
2019-05-13 21:21                 ` Dmitry Gutov
2019-05-14 20:29                   ` Juri Linkov
2019-05-15  0:34                     ` Dmitry Gutov
2019-05-15 21:12                       ` Juri Linkov
2019-05-15 22:05                         ` Dmitry Gutov
2019-05-16 20:04                           ` Juri Linkov
2019-05-19 20:11                             ` Juri Linkov
2019-05-20 23:29                               ` Dmitry Gutov
2019-05-21 20:12                                 ` Juri Linkov
2019-05-21 20:39                                   ` Dmitry Gutov
2019-05-21 21:32                                     ` Juri Linkov
2019-05-21 21:52                                       ` Dmitry Gutov
2019-05-22 21:52                                         ` Dmitry Gutov
2019-05-23 21:07                                         ` Juri Linkov [this message]
2019-05-24  1:29                                           ` Dmitry Gutov
2019-05-24 18:41                                             ` Juri Linkov
2019-05-27 15:26                                               ` Dmitry Gutov
2019-05-27 19:47                                                 ` Juri Linkov
2019-06-10  0:57                                                   ` Dmitry Gutov
2019-06-10 20:50                                                     ` Juri Linkov
2019-06-10 22:19                                                       ` Dmitry Gutov
2019-06-16  0:55                                                   ` Dmitry Gutov
2019-06-16 20:13                                                     ` Juri Linkov
2019-06-17 13:48                                                       ` Dmitry Gutov
2019-06-17 20:42                                                         ` Juri Linkov
2019-06-17 22:23                                                           ` Dmitry Gutov
2019-05-20 23:39                             ` Dmitry Gutov
2019-05-10  7:54     ` Eli Zaretskii
2019-05-08  6:01 ` Eli Zaretskii
2019-05-08 19:52   ` Juri Linkov
2019-05-10  7:51     ` Eli Zaretskii
2019-05-11 20:53       ` Juri Linkov
2019-05-12  2:36         ` Eli Zaretskii
2019-05-12 19:15           ` Juri Linkov
2019-05-13 14:24             ` Eli Zaretskii
2019-05-13 14:44               ` Dmitry Gutov
2019-05-13 15:09                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r28o3mnm.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=35624@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.