branch: elpa/fedi
commit 3b6dba4407671c90be7148b47de89c30662fa2fc
Author: marty hiatt <[email protected]>
Commit: marty hiatt <[email protected]>

    add commit regex
---
 fedi-post.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/fedi-post.el b/fedi-post.el
index 4062ac11487..8f15dfcba51 100644
--- a/fedi-post.el
+++ b/fedi-post.el
@@ -123,8 +123,9 @@ face. no-label is optional.")
          (? ?@
             (group-n 3 ; = optional domain
               (* (not (any "\n" "\t" " ")))))))
-      (| "'" word-boundary) ;; FIXME: fails with full stop? but we must 
exclude it!)
-      ) ; boundary or possessive
+      ;; FIXME: fails with full stop? but we must exclude it! other regexes
+      ;; don't fail with full stops!
+      (| "'" word-boundary)) ; boundary or possessive
   "Regex for a handle, e.g. @user or @[email protected].
 Group 1 is for completion at point functions. Group 2 and 3 are
 for forming a URL.")
@@ -146,6 +147,12 @@ for forming a URL.")
    "\\b"))
                                         ; boundary
 
+(defvar fedi-post-commit-regex
+  (rx (| (any ?\( "\n" "\t" " ") bol)
+      (group-n 1 (>= 7 hex-digit)) ;; 7 or more hex
+      (| "'" word-boundary))
+  "Regex for a commit ref, a 7-digit hex value.")
+
 
 ;;; MODE MAP
 

Reply via email to