branch: elpa/magit commit 9ee53756b54ddb78d417861e5200c86d5cbb8f36 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-diff-wash-submodule: Use magit-format-file-function --- docs/magit.org | 3 ++- docs/magit.texi | 3 ++- lisp/magit-diff.el | 16 ++++++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/magit.org b/docs/magit.org index 23d5373620e..b4b0c29134b 100644 --- a/docs/magit.org +++ b/docs/magit.org @@ -3482,7 +3482,8 @@ that they are available here too. used for file headings in diffs, in diffstats and for lists of files (such as the untracked files). Depending on the caller, it receives either three or five arguments; the signature has to be ~(kind file - face &optional status orig)~. KIND is one of ~diff~, ~stat~ and ~list~. + face &optional status orig)~. KIND is one of ~diff~, ~module~, ~stat~ and + ~list~. *** Revision Buffer diff --git a/docs/magit.texi b/docs/magit.texi index 4a547d6c65b..639e25d65c4 100644 --- a/docs/magit.texi +++ b/docs/magit.texi @@ -4099,7 +4099,8 @@ This function is used to format lines representing a file. It is used for file headings in diffs, in diffstats and for lists of files (such as the untracked files). Depending on the caller, it receives either three or five arguments; the signature has to be @code{(kind file - face &optional status orig)}. KIND is one of @code{diff}, @code{stat} and @code{list}. + face &optional status orig)}. KIND is one of @code{diff}, @code{module}, @code{stat} and +@code{list}. @end defopt @anchor{Revision Buffer} diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index 4485cc8d033..c2a7a8ed316 100644 --- a/lisp/magit-diff.el +++ b/lisp/magit-diff.el @@ -331,8 +331,8 @@ and `--compact-summary'. See the git-diff(1) manpage." This function is used for file headings in diffs, in diffstats and for lists of files (such as the untracked files). Depending on the caller, it receives either three or five arguments; the signature has to be -(kind file face &optional status orig). KIND is one of `diff', `stat' -and `list'." +\(kind file face &optional status orig). KIND is one of `diff', +`module', `stat' and `list'." :package-version '(magit . "4.3.1") :group 'magit-diff :type `(choice (function-item ,#'magit-format-file-default) @@ -2549,8 +2549,8 @@ keymap is the parent of their keymaps." "..." range t t 1))) (magit-insert-section (module module t) (magit-insert-heading - (propertize (concat "modified " module) - 'font-lock-face 'magit-diff-file-heading) + (funcall magit-format-file-function + 'module module 'magit-diff-file-heading "modified") " (" (cond (rewind "rewind") ((string-search "..." range) "non-ff") @@ -2575,14 +2575,14 @@ keymap is the parent of their keymaps." (magit-delete-line) (magit-insert-section (module module) (magit-insert-heading - (propertize (concat "submodule " module) - 'font-lock-face 'magit-diff-file-heading) + (funcall magit-format-file-function + 'module module 'magit-diff-file-heading "submodule") " (" msg ")")))) (t (magit-insert-section (module module) (magit-insert-heading - (propertize (concat "modified " module) - 'font-lock-face 'magit-diff-file-heading) + (funcall magit-format-file-function + 'module module 'magit-diff-file-heading "modified") " (" (and modified "modified") (and modified untracked " and ")