From: Lars Ingebrigtsen <larsi@gnus.org>
To: rogers-emacs@rgrjr.dyndns.org
Cc: 6870@debbugs.gnu.org
Subject: bug#6870: Make vc-root-diff work in more modes
Date: Tue, 25 Aug 2020 15:38:42 +0200 [thread overview]
Message-ID: <87a6yi976l.fsf@gnus.org> (raw)
In-Reply-To: <19561.60443.364109.899857@rgr.rgrjr.com> (rogers-emacs@rgrjr.dyndns.org's message of "Mon, 16 Aug 2010 21:55:39 -0400")
rogers-emacs@rgrjr.dyndns.org writes:
> It makes sense to me that vc-root-diff uses "(vc-responsible-backend
> default-directory)" when in a dired-mode buffer. But since vc-root-diff
> is not at all about the current buffer, why not also make that the
> default for shell-mode, diff-mode, or any of the other modes for
> non-version-controlled buffers that may be generated in a working copy?
[...]
> - ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory))
> - (vc-mode (vc-backend buffer-file-name))))
> + (vc-mode (vc-backend buffer-file-name))
> + (t (vc-responsible-backend default-directory))))
This has been extended somewhat over the years:
(defun vc-deduce-backend ()
(cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend)
((derived-mode-p 'log-view-mode) log-view-vc-backend)
((derived-mode-p 'log-edit-mode) log-edit-vc-backend)
((derived-mode-p 'diff-mode) diff-vc-backend)
;; Maybe we could even use comint-mode rather than shell-mode?
((derived-mode-p 'dired-mode 'shell-mode 'compilation-mode)
(ignore-errors (vc-responsible-backend default-directory)))
(vc-mode (vc-backend buffer-file-name))))
So we still don't do this in all buffers, but since there's some issues
with that, I think this works well now. So I'm closing this bug
report. If there's more to be done here, respond to the debbugs address
and we'll reopen the report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
prev parent reply other threads:[~2020-08-25 13:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 1:55 bug#6870: Make vc-root-diff work in more modes rogers-emacs
2011-07-04 15:18 ` Lars Magne Ingebrigtsen
2011-07-04 18:13 ` Stefan Monnier
2011-07-05 13:32 ` Lars Magne Ingebrigtsen
2011-07-05 19:04 ` Stefan Monnier
2011-07-05 20:58 ` Chong Yidong
2020-08-25 13:38 ` Lars Ingebrigtsen [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6yi976l.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=6870@debbugs.gnu.org \
--cc=rogers-emacs@rgrjr.dyndns.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).