From c3c52954d1af32940afda556d33b1b29c85ff889 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 10 Aug 2019 23:18:02 -0400 Subject: Use xdigit for sha1 regexps --- lisp/km-magit.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lisp') diff --git a/lisp/km-magit.el b/lisp/km-magit.el index fb46525..2967c86 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -72,8 +72,8 @@ argument CHOOSE-PROJECT is non-nil, 2) there is no current project, or 3) an commit object for the hash at point doesn't exist in the current project." (interactive "P") - (if (save-excursion (skip-chars-backward "a-f0-9") - (looking-at "\\b[a-f0-9]\\{4,40\\}\\b")) + (if (save-excursion (skip-chars-backward "[[:xdigit:]]") + (looking-at "\\b[[:xdigit:]]\\{4,40\\}\\b")) (let* ((hash (match-string-no-properties 0)) (project (and (or choose-project @@ -428,8 +428,8 @@ argument." (user-error "Full hashes are 40 characters")) ((> n 30) (message "That doesn't seem incredibly useful, but OK"))) - (let ((offset (- (skip-chars-backward "A-z0-9")))) - (if (looking-at "\\b[A-z0-9]\\{5,40\\}\\b") + (let ((offset (- (skip-chars-backward "[[:xdigit:]]")))) + (if (looking-at "\\b[[:xdigit:]]\\{5,40\\}\\b") (let ((hash-len (- (match-end 0) (match-beginning 0))) (hash (match-string 0))) (when (< hash-len n) @@ -439,7 +439,7 @@ argument." (substring hash 0 n)) 'fixedcase) (when (< offset n) - (skip-chars-backward "A-z0-9") + (skip-chars-backward "[[:xdigit:]]") (goto-char (+ (point) offset)))) (goto-char (+ (point) offset)) (user-error "No hash found at point")))) -- cgit v1.2.3