summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2018-12-09 14:43:20 -0500
committerKyle Meyer <kyle@kyleam.com>2018-12-09 14:43:32 -0500
commit2f20962239bc22edaf62d10bc8943765560183b2 (patch)
tree131eed1aed2131392641305163bcca9cac74b5f6 /lisp
parent01121ac2d432e6927d34da2c641356fc898edbd6 (diff)
downloademacs.d-2f20962239bc22edaf62d10bc8943765560183b2.tar.gz
km-magit: Don't use obsolete magit-section-when
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el26
1 files changed, 13 insertions, 13 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index b64765e..e7d80fe 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -734,7 +734,7 @@ COMMIT."
(user-error "%s does not exist" commit)))
(defun km/magit-copy-commit-summary-from-header (&optional _)
- (magit-section-when headers
+ (when (magit-section-match 'headers)
(km/magit-copy-commit-summary (car magit-refresh-args))))
(defun km/magit-copy-region-commits (&optional read-separator)
@@ -755,26 +755,26 @@ COMMIT."
(t (concat (car msg-lines) "[...]"))))))
(defun km/magit-copy-commit-message (&optional _)
- (magit-section-when message
+ (when (magit-section-match 'message)
(let ((msg (buffer-substring-no-properties (oref it start)
(oref it end))))
(kill-new msg)
(km/magit-copy--truncated-message msg))))
(defun km/magit-copy-region-hunk (&optional no-column)
- (when (magit-section-internal-region-p)
- (magit-section-when hunk
- (deactivate-mark)
- (let ((text (buffer-substring-no-properties
- (region-beginning) (region-end))))
- (setq text (if no-column
- (replace-regexp-in-string "^[ \\+\\-]" "" text)
- text))
- (kill-new text)
- (km/magit-copy--truncated-message text)))))
+ (when (and (magit-section-internal-region-p)
+ (magit-section-match 'hunk))
+ (deactivate-mark)
+ (let ((text (buffer-substring-no-properties
+ (region-beginning) (region-end))))
+ (setq text (if no-column
+ (replace-regexp-in-string "^[ \\+\\-]" "" text)
+ text))
+ (kill-new text)
+ (km/magit-copy--truncated-message text))))
(defun km/magit-copy-hunk (&optional _)
- (magit-section-when hunk
+ (when (magit-section-match 'hunk)
(kill-new (buffer-substring-no-properties
(save-excursion (goto-char (oref it start))
(1+ (point-at-eol)))