[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit cc07643bb1 12/13: Use fboundp instead of declar
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit cc07643bb1 12/13: Use fboundp instead of declare-function for magit-blame functions |
Date: |
Fri, 6 May 2022 15:58:12 -0400 (EDT) |
branch: elpa/git-commit
commit cc07643bb1d81e8eb3fe4adcf60d24f9de2ba009
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Use fboundp instead of declare-function for magit-blame functions
This helps avoiding circular dependencies.
---
lisp/magit-diff.el | 3 ++-
lisp/magit-git.el | 10 ++++------
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 9e78b52923..1687ef1382 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -1803,7 +1803,8 @@ commit or stash at point, then prompt for a commit."
(defun magit-diff-show-or-scroll (fn)
(let (rev cmd buf win)
(cond
- (magit-blame-mode
+ ((and (bound-and-true-p magit-blame-mode)
+ (fboundp 'magit-current-blame-chunk))
(setq rev (oref (magit-current-blame-chunk) orig-rev))
(setq cmd #'magit-show-commit)
(setq buf (magit-get-mode-buffer 'magit-revision-mode)))
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 80879b2ab7..341167f3d1 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -59,10 +59,6 @@
(defvar magit-this-error)
(defvar magit-process-error-message-regexps)
-;; From `magit-blame'.
-(declare-function magit-current-blame-chunk "magit-blame"
- (&optional type noerror))
-
(eval-when-compile
(cl-pushnew 'orig-rev eieio--known-slot-names)
(cl-pushnew 'number eieio--known-slot-names))
@@ -1507,7 +1503,8 @@ to, or to some other symbolic-ref that points to the same
ref."
(defun magit-commit-at-point ()
(or (magit-section-value-if 'commit)
(magit-thing-at-point 'git-revision t)
- (and-let* ((chunk (magit-current-blame-chunk 'addition t)))
+ (and-let* ((chunk (and (fboundp 'magit-current-blame-chunk)
+ (magit-current-blame-chunk 'addition t))))
(oref chunk orig-rev))
(and (derived-mode-p 'magit-stash-mode
'magit-merge-preview-mode
@@ -1527,7 +1524,8 @@ to, or to some other symbolic-ref that points to the same
ref."
(magit-ref-p (format "refs/pullreqs/%s"
(oref (oref it value) number))))))
(magit-thing-at-point 'git-revision t)
- (and-let* ((chunk (magit-current-blame-chunk 'addition t)))
+ (and-let* ((chunk (and (fboundp 'magit-current-blame-chunk)
+ (magit-current-blame-chunk 'addition t))))
(oref chunk orig-rev))
(and magit-buffer-file-name
magit-buffer-refname)
- [nongnu] elpa/git-commit updated (ea1d09e0a7 -> 6c98ba3dac), ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit d176c2a278 01/13: magit-custom-initialize-reset: Improve docstring, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit ec64fa4d63 06/13: magit-refresh: No longer hardcode magit-auto-revert-buffers, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit 2d679dff02 10/13: Move definition of magit-tramp-process-environment, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit e35f2b9be7 09/13: magit-blame.el: Move internal variables to beginning of file, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit 42a954adb4 03/13: Remove unnecessary variable declaration, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit ce29c373b9 08/13: magit-section.el: Move internal variables to beginning of file, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit 632536ca9c 07/13: Add magit-status-goto-initial-section to magit-create-buffer-hook, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit cc07643bb1 12/13: Use fboundp instead of declare-function for magit-blame functions,
ELPA Syncer <=
- [nongnu] elpa/git-commit 6c98ba3dac 13/13: Use fboundp instead of requiring magit-wip, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit 16aa4340c8 02/13: Add missing section headings, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit 85e169736e 05/13: magit-refresh: No longer hardcode dedicated post-command hooks, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit c3268fc69d 04/13: git-commit.el: Rearrange dependencies, ELPA Syncer, 2022/05/06
- [nongnu] elpa/git-commit f365aa48c4 11/13: Move shared infix argument magit:--gpg-sign to magit.el, ELPA Syncer, 2022/05/06