From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: "Charles A. Roelli" <charles@aurox.ch>, 28852@debbugs.gnu.org
Subject: bug#28852: make revert-buffer ('g') in VC diff buffers keep point
Date: Sat, 29 Jan 2022 20:48:36 +0200 [thread overview]
Message-ID: <86mtjepizv.fsf@mail.linkov.net> (raw)
In-Reply-To: <87tudm8rvr.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 29 Jan 2022 16:48:40 +0100")
>> This will restore point to the same point it was before... but not to
>> "where it was", necessarily, I think?
>
> I was confused about how these functions worked. I've respun the patch
> for Emacs 29, and it seem to work very well, so I've now pushed it.
This doesn't work with such customization:
(add-hook 'diff-mode-hook 'rename-uniquely)
because this change assumes that the current buffer is always "*vc-diff*"
whereas the reverted buffer can be "*vc-diff*<2>".
Isn't the reverted buffer always current during revert-buffer command?
If this assumption is correct, how about his fix?
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 0096a5fcb3..1671f2f860 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1798,10 +1798,9 @@ vc-diff-internal
(coding-system-for-read
(if files (vc-coding-system-for-diff (car files)) 'undecided))
(orig-diff-buffer-clone
- (if (and (get-buffer buffer) revert-buffer-in-progress-p)
- (with-current-buffer buffer
- (clone-buffer
- (generate-new-buffer-name " *vc-diff-clone*") nil)))))
+ (if revert-buffer-in-progress-p
+ (clone-buffer
+ (generate-new-buffer-name " *vc-diff-clone*") nil))))
;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style
;; EOLs, which will look ugly if (car files) happens to have Unix
;; EOLs.
--
next prev parent reply other threads:[~2022-01-29 18:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-15 19:07 bug#28852: make revert-buffer ('g') in VC diff buffers keep point Charles A. Roelli
2017-10-17 17:58 ` Charles A. Roelli
2019-06-24 17:40 ` Lars Ingebrigtsen
2022-01-29 15:48 ` Lars Ingebrigtsen
2022-01-29 18:48 ` Juri Linkov [this message]
2022-01-30 15:55 ` Lars Ingebrigtsen
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=86mtjepizv.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=28852@debbugs.gnu.org \
--cc=charles@aurox.ch \
--cc=larsi@gnus.org \
/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.