[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/tzz/auth-source-reveal-mode 9c5b838: auth-source-reveal-mode: fi
From: |
Teodor Zlatanov |
Subject: |
scratch/tzz/auth-source-reveal-mode 9c5b838: auth-source-reveal-mode: fixes from code review |
Date: |
Mon, 22 Jun 2020 16:31:26 -0400 (EDT) |
branch: scratch/tzz/auth-source-reveal-mode
commit 9c5b83811823b2440978572d95cd5e94f6a7fd7c
Author: Ted Zlatanov <tzz@lifelogs.com>
Commit: Ted Zlatanov <tzz@lifelogs.com>
auth-source-reveal-mode: fixes from code review
---
lisp/progmodes/prog-mode.el | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index 605b444..ffc474b 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -101,15 +101,20 @@ For example: \"->\" to the Unicode RIGHT ARROW →
Elements can also look like (IDENTIFIER REGEXP CHARACTER) which
will behave like the simpler (SYMBOL-STRING . CHARACTER) form
-except it will match regular expressions. The IDENTIFIER can be
-any symbol and should be unique to every package that augments
-`prettify-symbols-alist' (in order to remove prettifications
-easily with `prettify-symbols-remove-prettifications').
+except it will match regular expressions. The REGEXP can have
+capturing groups, in which case the first such group will be
+prettified. If there are no capturing groups, the whole REGEXP is
+prettified.
+
+The IDENTIFIER can be any symbol and should be unique to every
+package that augments `prettify-symbols-alist' (in order to
+remove prettifications easily with
+`prettify-symbols-remove-prettifications').
For example: \"abc[123]\" matching \"abc1\", \"abc2\", or
\"abc3\" could be mapped to the Unicode WORLD MAP. Note again the
IDENTIFIER is an arbitrary Lisp symbol.
- (my-worldmap \"abc[123]\" 128506)
+ (my-worldmap \"abc[123]\" ?\U0001f5fa)
CHARACTER can be a character, or it can be a list or vector, in
which case it will be used to compose the new symbol as per the
@@ -156,8 +161,12 @@ START and END are passed back and may be modified
(narrowed)."
;; ...We need to always do a string-match for the
bounds.
(string-match (nth 1 ps) match))
;; Now return the actual prettification start and end.
- return (list (+ start (match-beginning 1))
- (+ start(match-end 1))
+ return (list (+ start (or
+ (match-beginning 1)
+ (match-beginning 0)))
+ (+ start (or
+ (match-end 1)
+ (match-end 0)))
(nth 2 ps))))))
(defvar-local prettify-symbols-compose-replacer
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- scratch/tzz/auth-source-reveal-mode 9c5b838: auth-source-reveal-mode: fixes from code review,
Teodor Zlatanov <=