branch: elpa/magit
commit b4768acb1f7b903b4b66233a2f4fcbc2466d54ca
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Use font-lock-face for more text inserted into Magit buffers
Stick to doing so using `magit--propertize-face' for now.
Stick to not doing it for strings inserted into minibuffers or
into transient menu buffers, or used in messages. (Except where we
already do.)
This needs more work (including design decisions). This commit just
fixes some broken cases.
---
lisp/magit-diff.el | 12 ++++++------
lisp/magit-git.el | 2 +-
lisp/magit-process.el | 3 ++-
lisp/magit-sequence.el | 4 ++--
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 11b770676fe..c82a8e20ca7 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2266,13 +2266,13 @@ keymap is the parent of their keymaps."
(while (looking-at "^gpg: ")
(cond
((looking-at "^gpg: Good signature from")
- (setq title (propertize
+ (setq title (magit--propertize-face
(buffer-substring (point) (line-end-position))
- 'face 'magit-signature-good)))
+ 'magit-signature-good)))
((looking-at "^gpg: Can't check signature")
- (setq title (propertize
+ (setq title (magit--propertize-face
(buffer-substring (point) (line-end-position))
- 'face '(italic bold)))))
+ '(italic bold)))))
(forward-line))
(setq end (point-marker)))
(magit-insert-section (signature object title)
@@ -2477,10 +2477,10 @@ keymap is the parent of their keymaps."
(format " (%s)" (if binary "binary" long-status)))))
(when modes
(magit-insert-section (hunk '(chmod))
- (magit-insert-heading (propertize modes 'face 'default))))
+ (magit-insert-heading (magit--propertize-face modes 'default))))
(when rename
(magit-insert-section (hunk '(rename))
- (magit-insert-heading (propertize rename 'face 'default))))
+ (magit-insert-heading (magit--propertize-face rename 'default))))
(magit-wash-sequence #'magit-diff-wash-hunk)))
(defun magit-format-file (kind file face &optional status orig)
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 10296b52ed4..4896b72537e 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -576,7 +576,7 @@ standard output even in case of an error."
(exit (magit--git-insert (and keep-error 'full) args)))
(when (stringp exit)
(goto-char beg)
- (insert (propertize exit 'face 'error))
+ (insert (magit--propertize-face exit 'error))
(insert (if (bolp) "\n" "\n\n")))
(if (= (point) beg)
(magit-cancel-section)
diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index a126233f68a..a4e41b4d325 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -784,7 +784,8 @@ Magit status buffer."
default-directory))))
(concat (file-relative-name pwd default-directory) " "))
(magit-process--format-arguments program args))))
- (magit-insert-heading (if face (propertize cmd 'face face) cmd)))
+ (magit-insert-heading
+ (if face (magit--propertize-face cmd face) cmd)))
(when errlog
(if (bufferp errlog)
(insert (with-current-buffer errlog
diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el
index ecdaa06967b..a67fdeee82c 100644
--- a/lisp/magit-sequence.el
+++ b/lisp/magit-sequence.el
@@ -1118,9 +1118,9 @@ status buffer (i.e., the reverse of how they will be
applied)."
(defun magit-sequence-insert-commit (type hash face &optional abbrev msg)
(magit-insert-section (commit hash)
(magit-insert-heading
- (propertize type 'font-lock-face face) " "
+ (magit--propertize-face type face) " "
(if abbrev
- (concat (propertize abbrev 'face 'magit-hash) " " msg "\n")
+ (concat (magit--propertize-face abbrev 'magit-hash) " " msg "\n")
(concat (magit-format-rev-summary hash) "\n")))))
(defun magit-sequence-insert-step (type target)