From 2f20962239bc22edaf62d10bc8943765560183b2 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 9 Dec 2018 14:43:20 -0500 Subject: km-magit: Don't use obsolete magit-section-when --- lisp/km-magit.el | 26 +++++++++++++------------- 1 file 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))) -- cgit v1.2.3