diff options
| author | Ted Zlatanov | 2020-06-22 16:29:25 -0400 |
|---|---|---|
| committer | Ted Zlatanov | 2020-06-22 16:31:12 -0400 |
| commit | 9c5b83811823b2440978572d95cd5e94f6a7fd7c (patch) | |
| tree | c84d354d38118277f3d7e360293babbbd1f044ce | |
| parent | 4a7c98d21c20d3c9740789ba53054556486d7e04 (diff) | |
| download | emacs-scratch/tzz/auth-source-reveal-mode.tar.gz emacs-scratch/tzz/auth-source-reveal-mode.zip | |
auth-source-reveal-mode: fixes from code reviewscratch/tzz/auth-source-reveal-mode
| -rw-r--r-- | lisp/progmodes/prog-mode.el | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 605b4444f97..ffc474b2082 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el | |||
| @@ -101,15 +101,20 @@ For example: \"->\" to the Unicode RIGHT ARROW → | |||
| 101 | 101 | ||
| 102 | Elements can also look like (IDENTIFIER REGEXP CHARACTER) which | 102 | Elements can also look like (IDENTIFIER REGEXP CHARACTER) which |
| 103 | will behave like the simpler (SYMBOL-STRING . CHARACTER) form | 103 | will behave like the simpler (SYMBOL-STRING . CHARACTER) form |
| 104 | except it will match regular expressions. The IDENTIFIER can be | 104 | except it will match regular expressions. The REGEXP can have |
| 105 | any symbol and should be unique to every package that augments | 105 | capturing groups, in which case the first such group will be |
| 106 | `prettify-symbols-alist' (in order to remove prettifications | 106 | prettified. If there are no capturing groups, the whole REGEXP is |
| 107 | easily with `prettify-symbols-remove-prettifications'). | 107 | prettified. |
| 108 | |||
| 109 | The IDENTIFIER can be any symbol and should be unique to every | ||
| 110 | package that augments `prettify-symbols-alist' (in order to | ||
| 111 | remove prettifications easily with | ||
| 112 | `prettify-symbols-remove-prettifications'). | ||
| 108 | 113 | ||
| 109 | For example: \"abc[123]\" matching \"abc1\", \"abc2\", or | 114 | For example: \"abc[123]\" matching \"abc1\", \"abc2\", or |
| 110 | \"abc3\" could be mapped to the Unicode WORLD MAP. Note again the | 115 | \"abc3\" could be mapped to the Unicode WORLD MAP. Note again the |
| 111 | IDENTIFIER is an arbitrary Lisp symbol. | 116 | IDENTIFIER is an arbitrary Lisp symbol. |
| 112 | (my-worldmap \"abc[123]\" 128506) | 117 | (my-worldmap \"abc[123]\" ?\U0001f5fa) |
| 113 | 118 | ||
| 114 | CHARACTER can be a character, or it can be a list or vector, in | 119 | CHARACTER can be a character, or it can be a list or vector, in |
| 115 | which case it will be used to compose the new symbol as per the | 120 | 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)." | |||
| 156 | ;; ...We need to always do a string-match for the bounds. | 161 | ;; ...We need to always do a string-match for the bounds. |
| 157 | (string-match (nth 1 ps) match)) | 162 | (string-match (nth 1 ps) match)) |
| 158 | ;; Now return the actual prettification start and end. | 163 | ;; Now return the actual prettification start and end. |
| 159 | return (list (+ start (match-beginning 1)) | 164 | return (list (+ start (or |
| 160 | (+ start(match-end 1)) | 165 | (match-beginning 1) |
| 166 | (match-beginning 0))) | ||
| 167 | (+ start (or | ||
| 168 | (match-end 1) | ||
| 169 | (match-end 0))) | ||
| 161 | (nth 2 ps)))))) | 170 | (nth 2 ps)))))) |
| 162 | 171 | ||
| 163 | (defvar-local prettify-symbols-compose-replacer | 172 | (defvar-local prettify-symbols-compose-replacer |