summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2019-08-10 23:18:02 -0400
committerKyle Meyer <kyle@kyleam.com>2019-08-10 23:18:02 -0400
commitc3c52954d1af32940afda556d33b1b29c85ff889 (patch)
treeff5cb63d6670b20f541323ab5ad66e60c0b71b06
parent6412f49cd0b51429e3653a0e30a747a5baf8b618 (diff)
downloademacs.d-c3c52954d1af32940afda556d33b1b29c85ff889.tar.gz
Use xdigit for sha1 regexps
-rw-r--r--lisp/km-magit.el10
1 files changed, 5 insertions, 5 deletions
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"))))